svn commit: samba r22756 - in branches/SAMBA_4_0/source: scripting/libjs setup torture/libnet

abartlet at samba.org abartlet at samba.org
Tue May 8 04:38:17 GMT 2007


Author: abartlet
Date: 2007-05-08 04:38:16 +0000 (Tue, 08 May 2007)
New Revision: 22756

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=22756

Log:
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

Modified:
   branches/SAMBA_4_0/source/scripting/libjs/provision.js
   branches/SAMBA_4_0/source/setup/provision
   branches/SAMBA_4_0/source/torture/libnet/libnet_BecomeDC.c


Changeset:
Modified: branches/SAMBA_4_0/source/scripting/libjs/provision.js
===================================================================
--- branches/SAMBA_4_0/source/scripting/libjs/provision.js	2007-05-07 20:53:10 UTC (rev 22755)
+++ branches/SAMBA_4_0/source/scripting/libjs/provision.js	2007-05-08 04:38:16 UTC (rev 22756)
@@ -453,7 +453,7 @@
 	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 @@
 	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);

Modified: branches/SAMBA_4_0/source/setup/provision
===================================================================
--- branches/SAMBA_4_0/source/setup/provision	2007-05-07 20:53:10 UTC (rev 22755)
+++ branches/SAMBA_4_0/source/setup/provision	2007-05-08 04:38:16 UTC (rev 22756)
@@ -29,6 +29,7 @@
 		'users=s',
 		'quiet',
 		'blank',
+		'partitions-only',
 		'ldap-base',
 		'ldap-backend=s',
                 'ldap-module=s',
@@ -79,6 +80,7 @@
  --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 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("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);

Modified: branches/SAMBA_4_0/source/torture/libnet/libnet_BecomeDC.c
===================================================================
--- branches/SAMBA_4_0/source/torture/libnet/libnet_BecomeDC.c	2007-05-07 20:53:10 UTC (rev 22755)
+++ branches/SAMBA_4_0/source/torture/libnet/libnet_BecomeDC.c	2007-05-08 04:38:16 UTC (rev 22756)
@@ -224,7 +224,7 @@
 		"\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",



More information about the samba-cvs mailing list