svn commit: samba r15783 - in branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules: .

idra at samba.org idra at samba.org
Sun May 21 20:21:35 GMT 2006


Author: idra
Date: 2006-05-21 20:21:34 +0000 (Sun, 21 May 2006)
New Revision: 15783

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=15783

Log:


Fix previous commit, was the wrong way to deal with the problem


Modified:
   branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/samldb.c


Changeset:
Modified: branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/samldb.c
===================================================================
--- branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/samldb.c	2006-05-21 20:06:01 UTC (rev 15782)
+++ branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/samldb.c	2006-05-21 20:21:34 UTC (rev 15783)
@@ -776,18 +776,16 @@
 		return ldb_next_request(module, req);
 	}
 
-	/* is user or computer? Skip if not */
-	if ((samldb_find_attribute(msg, "objectclass", "user") == NULL) &&
-	    (samldb_find_attribute(msg, "objectclass", "computer") == NULL)) {
-		return ldb_next_request(module, req);
+	/* is user or computer? */
+	if ((samldb_find_attribute(msg, "objectclass", "user") != NULL) ||
+	    (samldb_find_attribute(msg, "objectclass", "computer") != NULL)) {
+		/*  add all relevant missing objects */
+		ret = samldb_fill_user_or_computer_object(module, msg, &msg2);
+		if (ret) {
+			return ret;
+		}
 	}
 
-	/*  add all relevant missing objects */
-	ret = samldb_fill_user_or_computer_object(module, msg, &msg2);
-	if (ret) {
-		return ret;
-	}
-
 	/* is group? add all relevant missing objects */
 	if ( ! msg2 ) {
 		if (samldb_find_attribute(msg, "objectclass", "group") != NULL) {
@@ -842,23 +840,16 @@
 		return ldb_next_request(module, req);
 	}
 
-	down_req = talloc(module, struct ldb_request);
-	if (down_req == NULL) {
-		return LDB_ERR_OPERATIONS_ERROR;
-	}
-
-	/* is user or computer? Skip if not */
+	/* is user or computer? */
 	if ((samldb_find_attribute(msg, "objectclass", "user") == NULL) &&
 	    (samldb_find_attribute(msg, "objectclass", "computer") == NULL)) {
-		return ldb_next_request(module, req);
+		/*  add all relevant missing objects */
+		ret = samldb_fill_user_or_computer_object(module, msg, &msg2);
+		if (ret) {
+			return ret;
+		}
 	}
 
-	/*  add all relevant missing objects */
-	ret = samldb_fill_user_or_computer_object(module, msg, &msg2);
-	if (ret) {
-		return ret;
-	}
-
 	/* is group? add all relevant missing objects */
 	if ( ! msg2 ) {
 		if (samldb_find_attribute(msg, "objectclass", "group") != NULL) {
@@ -879,11 +870,18 @@
 		}
 	}
 
+	if (msg2 == NULL) {
+		return ldb_next_request(module, req);
+	}
+
+	down_req = talloc(module, struct ldb_request);
+	if (down_req == NULL) {
+		return LDB_ERR_OPERATIONS_ERROR;
+	}
+
 	*down_req = *req;
 	
-	if (msg2 != NULL) {
-		down_req->op.add.message = talloc_steal(down_req, msg2);
-	}
+	down_req->op.add.message = talloc_steal(down_req, msg2);
 	
 	/* go on with the call chain */
 	ret = ldb_next_request(module, down_req);



More information about the samba-cvs mailing list