[SCM] Samba Shared Repository - branch master updated

Nadezhda Ivanova nivanova at samba.org
Wed Sep 18 07:44:03 CEST 2013


The branch, master has been updated
       via  ff88694 Give slapd a second to startup
       via  68a4081 Add an OpenLDAP-specific extended_dn_in module
      from  4879d08 libcli/smb: only check the SMB2 session setup signature if required and valid

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit ff886940272354743cd6eb50717891454d8e5500
Author: Howard Chu <hyc at symas.com>
Date:   Tue Sep 17 08:19:47 2013 -0700

    Give slapd a second to startup
    
    Moving the sleep to the beginning of the loop avoids most
    occurrences of the "connection failed" message
    
    Signed-off-by: Howard Chu <hyc at symas.com>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    Reviewed-by: Nadezhda Ivanova <nivanova at symas.com>
    
    Autobuild-User(master): Nadezhda Ivanova <nivanova at samba.org>
    Autobuild-Date(master): Wed Sep 18 07:43:09 CEST 2013 on sn-devel-104

commit 68a4081dd47344651cb4dfdf57247ce8e893a96e
Author: Howard Chu <hyc at symas.com>
Date:   Mon Sep 16 19:51:20 2013 -0700

    Add an OpenLDAP-specific extended_dn_in module
    
    Don't "fix" plain DNs before sending them to OpenLDAP
    
    Signed-off-by: Howard Chu <hyc at symas.com>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    Reviewed-by: Nadezhda Ivanova <nivanova at symas.com>

-----------------------------------------------------------------------

Summary of changes:
 python/samba/provision/backend.py               |    2 +-
 source4/dsdb/samdb/ldb_modules/extended_dn_in.c |   25 ++++++++++++++++++++++-
 source4/dsdb/samdb/ldb_modules/samba_dsdb.c     |   17 ++++++++++++---
 3 files changed, 38 insertions(+), 6 deletions(-)


Changeset truncated at 500 lines:

diff --git a/python/samba/provision/backend.py b/python/samba/provision/backend.py
index 58aab98..24d8675 100644
--- a/python/samba/provision/backend.py
+++ b/python/samba/provision/backend.py
@@ -292,6 +292,7 @@ class LDAPBackend(ProvisionBackend):
         while self.slapd.poll() is None:
             # Wait until the socket appears
             try:
+                time.sleep(1)
                 ldapi_db = Ldb(self.ldap_uri, lp=self.lp, credentials=self.credentials)
                 ldapi_db.search(base="", scope=SCOPE_BASE,
                     expression="(objectClass=OpenLDAProotDSE)")
@@ -299,7 +300,6 @@ class LDAPBackend(ProvisionBackend):
                 # the LDAP server!
                 return
             except LdbError:
-                time.sleep(1)
                 count = count + 1
 
                 if count > 15:
diff --git a/source4/dsdb/samdb/ldb_modules/extended_dn_in.c b/source4/dsdb/samdb/ldb_modules/extended_dn_in.c
index 034d22a..df45f75 100644
--- a/source4/dsdb/samdb/ldb_modules/extended_dn_in.c
+++ b/source4/dsdb/samdb/ldb_modules/extended_dn_in.c
@@ -56,6 +56,9 @@ static const char *wkattr[] = {
 	"otherWellKnownObjects",
 	NULL
 };
+
+static const struct ldb_module_ops ldb_extended_dn_in_openldap_module_ops;
+
 /* An extra layer of indirection because LDB does not allow the original request to be altered */
 
 static int extended_final_callback(struct ldb_request *req, struct ldb_reply *ares)
@@ -376,7 +379,14 @@ static int extended_dn_filter_callback(struct ldb_parse_tree *tree, void *privat
 	has_extended_component = (memchr(tree->u.equality.value.data, '<',
 					 tree->u.equality.value.length) != NULL);
 
-	if (!attribute->one_way_link && !has_extended_component) {
+	/*
+	 * Don't turn it into an extended DN if we're talking to OpenLDAP.
+	 * We just check the module_ops pointer instead of adding a private
+	 * pointer and a boolean to tell us the exact same thing.
+	 */
+	if (!has_extended_component) {
+		if (!attribute->one_way_link ||
+		    ldb_module_get_ops(filter_ctx->module) == &ldb_extended_dn_in_openldap_module_ops)
 		return LDB_SUCCESS;
 	}
 
@@ -706,8 +716,21 @@ static const struct ldb_module_ops ldb_extended_dn_in_module_ops = {
 	.rename            = extended_dn_in_rename,
 };
 
+static const struct ldb_module_ops ldb_extended_dn_in_openldap_module_ops = {
+	.name		   = "extended_dn_in_openldap",
+	.search            = extended_dn_in_search,
+	.modify            = extended_dn_in_modify,
+	.del               = extended_dn_in_del,
+	.rename            = extended_dn_in_rename,
+};
+
 int ldb_extended_dn_in_module_init(const char *version)
 {
+	int ret;
 	LDB_MODULE_CHECK_VERSION(version);
+	ret = ldb_register_module(&ldb_extended_dn_in_openldap_module_ops);
+	if (ret != LDB_SUCCESS) {
+		return ret;
+	}
 	return ldb_register_module(&ldb_extended_dn_in_module_ops);
 }
diff --git a/source4/dsdb/samdb/ldb_modules/samba_dsdb.c b/source4/dsdb/samdb/ldb_modules/samba_dsdb.c
index cde53bc..060a9d7 100644
--- a/source4/dsdb/samdb/ldb_modules/samba_dsdb.c
+++ b/source4/dsdb/samdb/ldb_modules/samba_dsdb.c
@@ -253,7 +253,7 @@ static int samba_dsdb_init(struct ldb_module *module)
 	  stack visually - the code below then handles the creation of the list
 	  based on the parameters loaded from the database.
 	*/
-	static const char *modules_list[] = {"resolve_oids",
+	static const char *modules_list1[] = {"resolve_oids",
 					     "rootdse",
 					     "schema_load",
 					     "lazy_commit",
@@ -264,8 +264,9 @@ static int samba_dsdb_init(struct ldb_module *module)
 					     "server_sort",
 					     "asq",
 					     "extended_dn_store",
-					     "extended_dn_in",
-					     "objectclass",
+					     NULL };
+	/* extended_dn_in or extended_dn_in_openldap goes here */
+	static const char *modules_list1a[] = {"objectclass",
 					     "descriptor",
 					     "acl",
 					     "aclread",
@@ -293,6 +294,7 @@ static int samba_dsdb_init(struct ldb_module *module)
 	const char *extended_dn_module_ldb = "extended_dn_out_ldb";
 	const char *extended_dn_module_fds = "extended_dn_out_fds";
 	const char *extended_dn_module_openldap = "extended_dn_out_openldap";
+	const char *extended_dn_in_module = "extended_dn_in";
 
 	static const char *modules_list2[] = {"show_deleted",
 					      "new_partition",
@@ -357,6 +359,7 @@ static int samba_dsdb_init(struct ldb_module *module)
 			link_modules = openldap_modules;
 			backend_modules = openldap_backend_modules;
 			extended_dn_module = extended_dn_module_openldap;
+			extended_dn_in_module = "extended_dn_in_openldap";
 		} else {
 			return ldb_error(ldb, LDB_ERR_OPERATIONS_ERROR, "invalid backend type");
 		}
@@ -382,7 +385,13 @@ static int samba_dsdb_init(struct ldb_module *module)
 		}						\
 	} while (0)
 
-	final_module_list = str_list_copy_const(tmp_ctx, modules_list);
+	final_module_list = str_list_copy_const(tmp_ctx, modules_list1);
+	CHECK_MODULE_LIST;
+
+	final_module_list = str_list_add_const(final_module_list, extended_dn_in_module);
+	CHECK_MODULE_LIST;
+
+	final_module_list = str_list_append_const(final_module_list, modules_list1a);
 	CHECK_MODULE_LIST;
 
 	final_module_list = str_list_append_const(final_module_list, link_modules);


-- 
Samba Shared Repository


More information about the samba-cvs mailing list