mirror of
https://github.com/samba-team/samba.git
synced 2025-07-15 16:59:09 +03:00
r25940: Rework the samldb and templates handling.
Templates just don't belong in the sam.ldb, as they don't obey any of
the other rules. This moves them to a seperate templates.ldb.
In samldb, this patch reworks the duplicate SID and Name detection
code, to use ldb_search_exp_fmt() rather than gendb_search. This
returns far more useful errors, which we now handle and report better.
The call to samdb_search_for_parent_domain() has been moved in samldb,
to allow both the account and SID uniqueness checks to be in the same
domain. This function also returns better errors.
dcesrv_drsuapi.c is updated for the new prototype of
samdb_search_for_parent_domain()
Andrew Bartlett
(This used to be commit f1ab90c88c
)
This commit is contained in:
committed by
Stefan Metzmacher
parent
cadf696f8b
commit
3f2ca10d2d
@ -383,6 +383,7 @@ function provision_default_paths(subobj)
|
||||
paths.shareconf = lp.get("private dir") + "/" + "share.ldb";
|
||||
paths.samdb = lp.get("sam database");
|
||||
paths.secrets = lp.get("secrets database");
|
||||
paths.templates = lp.get("private dir") + "/" + "templates.ldb";
|
||||
paths.keytab = "secrets.keytab";
|
||||
paths.dns_keytab = "dns.keytab";
|
||||
paths.dns_keytab_abs = lp.get("private dir") + "/" + paths.dns_keytab;
|
||||
@ -528,6 +529,9 @@ function provision_become_dc(subobj, message, erase, paths, session_info)
|
||||
info.message = message;
|
||||
info.session_info = session_info;
|
||||
|
||||
message("Setting up teplates into " + paths.templates + "\n");
|
||||
setup_ldb("provision_templates.ldif", info, paths.templates);
|
||||
|
||||
/* Also wipes the database */
|
||||
message("Setting up " + paths.samdb + " partitions\n");
|
||||
setup_ldb("provision_partitions.ldif", info, paths.samdb);
|
||||
@ -548,9 +552,6 @@ function provision_become_dc(subobj, message, erase, paths, session_info)
|
||||
message("Setting up " + paths.samdb + " indexes\n");
|
||||
setup_add_ldif("provision_index.ldif", info, samdb, false);
|
||||
|
||||
message("Setting up " + paths.samdb + " templates\n");
|
||||
setup_add_ldif("provision_templates.ldif", info, samdb, false);
|
||||
|
||||
ok = samdb.transaction_commit();
|
||||
assert(ok);
|
||||
|
||||
@ -623,6 +624,9 @@ function provision(subobj, message, blank, paths, session_info, credentials, lda
|
||||
var reg = reg_open();
|
||||
reg.apply_patchfile(lp.get("setup directory") + "/provision.reg")
|
||||
|
||||
message("Setting up teplates into " + paths.templates + "\n");
|
||||
setup_ldb("provision_templates.ldif", info, paths.templates);
|
||||
|
||||
message("Setting up sam.ldb partitions\n");
|
||||
/* Also wipes the database */
|
||||
setup_ldb("provision_partitions.ldif", info, paths.samdb);
|
||||
@ -707,8 +711,6 @@ function provision(subobj, message, blank, paths, session_info, credentials, lda
|
||||
|
||||
message("Setting up display specifiers\n");
|
||||
setup_add_ldif("display_specifiers.ldif", info, samdb, false);
|
||||
message("Setting up sam.ldb templates\n");
|
||||
setup_add_ldif("provision_templates.ldif", info, samdb, false);
|
||||
|
||||
message("Adding users container (permitted to fail)\n");
|
||||
var add_ok = setup_add_ldif("provision_users_add.ldif", info, samdb, true);
|
||||
|
Reference in New Issue
Block a user