diff options
-rw-r--r-- | source4/include/includes.h | 6 | ||||
-rw-r--r-- | source4/lib/ldb/common/ldb.c | 10 | ||||
-rw-r--r-- | source4/lib/ldb/common/ldb_modules.c | 10 | ||||
-rw-r--r-- | source4/param/util.c | 2 | ||||
-rw-r--r-- | source4/scripting/python/samba/provision.py | 5 | ||||
-rw-r--r-- | source4/selftest/target/Samba4.pm | 2 |
6 files changed, 12 insertions, 23 deletions
diff --git a/source4/include/includes.h b/source4/include/includes.h index 1a92e46657..df0d8f7713 100644 --- a/source4/include/includes.h +++ b/source4/include/includes.h @@ -54,4 +54,10 @@ #define TALLOC_ABORT(reason) smb_panic(reason) #endif +/* this needs to be a string which is not in the C library. We + previously used "init_module", but that meant that modules which + did not define this function ended up calling the C library + function init_module() which makes a system call */ +#define SAMBA_INIT_MODULE "samba_init_module" + #endif /* _INCLUDES_H */ diff --git a/source4/lib/ldb/common/ldb.c b/source4/lib/ldb/common/ldb.c index d0570c5382..cac0a383d8 100644 --- a/source4/lib/ldb/common/ldb.c +++ b/source4/lib/ldb/common/ldb.c @@ -185,16 +185,6 @@ int ldb_connect_backend(struct ldb_context *ldb, fn = ldb_find_backend(backend); if (fn == NULL) { - int (*init_fn) (void); - - init_fn = ldb_dso_load_symbol(ldb, backend, - "init_module"); - if (init_fn != NULL && init_fn() == 0) { - fn = ldb_find_backend(backend); - } - } - - if (fn == NULL) { struct ldb_backend_ops *ops; char *symbol_name = talloc_asprintf(ldb, "ldb_%s_backend_ops", backend); if (symbol_name == NULL) { diff --git a/source4/lib/ldb/common/ldb_modules.c b/source4/lib/ldb/common/ldb_modules.c index ddbe0f23a6..fbfb5e5322 100644 --- a/source4/lib/ldb/common/ldb_modules.c +++ b/source4/lib/ldb/common/ldb_modules.c @@ -224,16 +224,6 @@ int ldb_load_modules_list(struct ldb_context *ldb, const char **module_list, str ops = ldb_find_module_ops(module_list[i]); if (ops == NULL) { - int (*init_fn) (void); - - init_fn = ldb_dso_load_symbol(ldb, module_list[i], - "init_module"); - if (init_fn != NULL && init_fn() == 0) { - ops = ldb_find_module_ops(module_list[i]); - } - } - - if (ops == NULL) { char *symbol_name = talloc_asprintf(ldb, "ldb_%s_module_ops", module_list[i]); if (symbol_name == NULL) { diff --git a/source4/param/util.c b/source4/param/util.c index 15e3b4768c..ec192939d0 100644 --- a/source4/param/util.c +++ b/source4/param/util.c @@ -182,7 +182,7 @@ init_module_fn load_module(TALLOC_CTX *mem_ctx, const char *path) return NULL; } - init_fn = dlsym(handle, "init_module"); + init_fn = dlsym(handle, SAMBA_INIT_MODULE); if (init_fn == NULL) { DEBUG(0, ("Unable to find init_module() in %s: %s\n", path, dlerror())); diff --git a/source4/scripting/python/samba/provision.py b/source4/scripting/python/samba/provision.py index 3f936c3301..93a4c8f502 100644 --- a/source4/scripting/python/samba/provision.py +++ b/source4/scripting/python/samba/provision.py @@ -1180,6 +1180,8 @@ def provision_backend(setup_dir=None, message=None, schemadb = Ldb(schemadb_path, lp=lp) + prefixmap = open(setup_path("prefixMap.txt"), 'r').read() + setup_add_ldif(schemadb, setup_path("provision_schema_basedn.ldif"), {"SCHEMADN": names.schemadn, "ACI": "#", @@ -1191,7 +1193,8 @@ def provision_backend(setup_dir=None, message=None, "NETBIOSNAME": names.netbiosname, "DEFAULTSITE": DEFAULTSITE, "CONFIGDN": names.configdn, - "SERVERDN": names.serverdn + "SERVERDN": names.serverdn, + "PREFIXMAP_B64": b64encode(prefixmap) }) setup_add_ldif(schemadb, setup_path("schema_samba4.ldif"), diff --git a/source4/selftest/target/Samba4.pm b/source4/selftest/target/Samba4.pm index b1b74e4323..b3dc984593 100644 --- a/source4/selftest/target/Samba4.pm +++ b/source4/selftest/target/Samba4.pm @@ -751,7 +751,7 @@ nogroup:x:65534:nobody if (defined($self->{ldap})) { push (@provision_options, "--ldap-backend=$ldap_uri"); - system("$self->{bindir}/smbpython $self->{setupdir}/provision-backend $configuration --ldap-manager-pass=$password --root=$unix_name --realm=$realm --domain=$domain --host-name=$netbiosname --ldap-backend-type=$self->{ldap}>&2") == 0 or die("backend provision failed"); + system("$self->{setupdir}/provision-backend $configuration --ldap-manager-pass=$password --root=$unix_name --realm=$realm --domain=$domain --host-name=$netbiosname --ldap-backend-type=$self->{ldap}>&2") == 0 or die("backend provision failed"); if ($self->{ldap} eq "openldap") { ($ret->{SLAPD_CONF}, $ret->{OPENLDAP_PIDFILE}) = $self->mk_openldap($ldapdir, $configuration) or die("Unable to create openldap directories"); |