- /* The recycle-bin is not enabled and
- * the replicated attributes for the current object has the isDeleted attribute
- * but not the isRecycled and no the lastKnownRDN and isDeleted is true.
- * It means that we knew the object before and now we are notified
- * that is has been deleted but it's not a recycled one.
- * If we support the isRecycled attribute we had this attribute.
- * As we check for the recycle bin not to be enabled we are insured
- * that we will face only simple cases.
+ if (strncmp((const char*)v->data, "TRUE", 4) == 0) {
+ new_is_deleted = true;
+ }
+ }
+
+ if (ar->isRecycled && strcmp(el->name, ar->isRecycled->lDAPDisplayName) == 0) {
+ struct ldb_val *v = NULL;
+
+ if (el->num_values == 0) {
+ continue;
+ }
+
+ found_new_is_recycled = true;
+
+ v = &el->values[0];
+
+ if (strncmp((const char*)v->data, "TRUE", 4) == 0) {
+ new_is_recycled = true;
+ }
+ }
+
+ if (ar->lastKnownRDN && strcmp(el->name, ar->lastKnownRDN->lDAPDisplayName) == 0) {
+ struct ldb_val *v = NULL;
+
+ if (el->num_values == 0) {
+ continue;
+ }
+
+ found_new_has_lastknownrdn = true;
+
+ v = &el->values[0];
+
+ if (strncmp((const char*)v->data, "TRUE", 4) == 0) {
+ new_has_lastknownrdn = true;
+ }
+ }
+ }
+
+ is_deleted = false;
+ if (found_old_is_deleted) {
+ is_deleted = old_is_deleted;
+ }
+ if (found_new_is_deleted) {
+ is_deleted = new_is_deleted;
+ }
+
+ is_recycled = false;
+ if (found_old_is_recycled) {
+ is_recycled = old_is_recycled;
+ }
+ if (found_new_is_recycled) {
+ is_recycled = new_is_recycled;
+ }
+
+ has_lastknownrdn = false;
+ if (found_old_has_lastknownrdn) {
+ has_lastknownrdn = old_has_lastknownrdn;
+ }
+ if (found_new_has_lastknownrdn) {
+ has_lastknownrdn = new_has_lastknownrdn;
+ }
+
+ if (is_deleted && ar->isRecycled && !is_recycled && !has_lastknownrdn) {
+ /*
+ * The replicated attributes for the current object has the
+ * isDeleted attribute but not the isRecycled and no the
+ * lastKnownRDN. It means that we knew the object before and
+ * now we are notified that is has been deleted but it's not a
+ * recycled one. If we support the isRecycled attribute we had
+ * this attribute.