#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 */
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);
const struct ldb_module_ops *ops;
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]);
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()));
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": "#",
"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"),
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");