summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2007-05-08 04:38:16 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:52:15 -0500
commit112728c65101948204fe9a7c1373ff21f1724cdb (patch)
tree633f140cfad853713fd29aef1abd3acc9abaabb7
parent19d56c775a175c894a0e88ad6c9a918b6fa8c532 (diff)
downloadsamba-112728c65101948204fe9a7c1373ff21f1724cdb.tar.gz
samba-112728c65101948204fe9a7c1373ff21f1724cdb.tar.bz2
samba-112728c65101948204fe9a7c1373ff21f1724cdb.zip
r22756: Make it easier to setup an LDAP replica. Provision with
--partitions-only (suggestions for a better name welcome) will setup the partitions records, but no any data in those partitions. This can then point at the already configured remote LDAP server. Andrew Bartlett (This used to be commit ee7b06fc832ca7c572205c7c268c3c7c552effa0)
-rw-r--r--source4/scripting/libjs/provision.js8
-rwxr-xr-xsource4/setup/provision6
-rw-r--r--source4/torture/libnet/libnet_BecomeDC.c2
3 files changed, 11 insertions, 5 deletions
diff --git a/source4/scripting/libjs/provision.js b/source4/scripting/libjs/provision.js
index 6af753e7eb..948c02470d 100644
--- a/source4/scripting/libjs/provision.js
+++ b/source4/scripting/libjs/provision.js
@@ -453,7 +453,7 @@ function provision_fix_subobj(subobj, message, paths)
return true;
}
-function provision_become_dc(subobj, message, paths, session_info)
+function provision_become_dc(subobj, message, erase, paths, session_info)
{
var lp = loadparm_init();
var sys = sys_init();
@@ -478,8 +478,10 @@ function provision_become_dc(subobj, message, paths, session_info)
message("Setting up " + paths.samdb + " rootDSE\n");
setup_add_ldif("provision_rootdse_add.ldif", info, samdb, false);
- message("Erasing data from partitions\n");
- ldb_erase_partitions(info, samdb, undefined);
+ if (erase) {
+ message("Erasing data from partitions\n");
+ ldb_erase_partitions(info, samdb, undefined);
+ }
message("Setting up " + paths.samdb + " indexes\n");
setup_add_ldif("provision_index.ldif", info, samdb, false);
diff --git a/source4/setup/provision b/source4/setup/provision
index 168fe8292f..2a3ddecd3e 100755
--- a/source4/setup/provision
+++ b/source4/setup/provision
@@ -29,6 +29,7 @@ options = GetOptions(ARGV,
'users=s',
'quiet',
'blank',
+ 'partitions-only',
'ldap-base',
'ldap-backend=s',
'ldap-module=s',
@@ -79,6 +80,7 @@ provision [options]
--users GROUPNAME choose 'users' group
--quiet Be quiet
--blank do not add users or groups, just the structure
+ --partitions-only Configure Samba's partitions, but do not modify them (ie, join a BDC)
--ldap-base output only an LDIF file, suitable for creating an LDAP baseDN
--ldap-backend LDAPSERVER LDAP server to use for this provision
--ldap-module= MODULE LDB mapping module to use for the LDAP backend
@@ -118,7 +120,7 @@ var blank = (options["blank"] != undefined);
var ldapbase = (options["ldap-base"] != undefined);
var ldapbackend = (options["ldap-backend"] != undefined);
var ldapmodule = (options["ldap-module"] != undefined);
-
+var partitions_only = (options["partitions-only"] != undefined);
if (options["aci"] != undefined) {
message("set ACI: %s\n", subobj["ACI"]);
}
@@ -148,6 +150,8 @@ message("Provisioning for %s in realm %s\n", subobj.DOMAIN, subobj.REALM);
message("Using administrator password: %s\n", subobj.ADMINPASS);
if (ldapbase) {
provision_ldapbase(subobj, message, paths);
+} else if (partitions_only) {
+ provision_become_dc(subobj, message, false, paths, system_session);
} else {
provision(subobj, message, blank, paths, system_session, creds, ldapbackend);
provision_dns(subobj, message, paths, system_session, creds);
diff --git a/source4/torture/libnet/libnet_BecomeDC.c b/source4/torture/libnet/libnet_BecomeDC.c
index 827a79a0f0..b164ee4906 100644
--- a/source4/torture/libnet/libnet_BecomeDC.c
+++ b/source4/torture/libnet/libnet_BecomeDC.c
@@ -224,7 +224,7 @@ static NTSTATUS test_become_dc_prepare_db(void *private_data,
"\n"
"var system_session = system_session();\n"
"\n"
- "var ok = provision_become_dc(subobj, message, paths, system_session);\n"
+ "var ok = provision_become_dc(subobj, message, true, paths, system_session);\n"
"assert(ok);\n"
"\n"
"return 0;\n",