svn commit: samba r8158 - in branches/SAMBA_4_0/source/setup: .
metze at samba.org
metze at samba.org
Tue Jul 5 07:10:53 GMT 2005
Author: metze
Date: 2005-07-05 07:10:52 +0000 (Tue, 05 Jul 2005)
New Revision: 8158
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=8158
Log:
- use the timestring for the serial number of the bind zone file
- add --krbtgtpass and --machinepass options, with them you can easy set them to default
values for testing so that you don't need to setup a new keytab file when you rerun provision.pl
metze
Modified:
branches/SAMBA_4_0/source/setup/provision.ldif
branches/SAMBA_4_0/source/setup/provision.pl
branches/SAMBA_4_0/source/setup/provision.zone
branches/SAMBA_4_0/source/setup/secrets.ldif
Changeset:
Modified: branches/SAMBA_4_0/source/setup/provision.ldif
===================================================================
--- branches/SAMBA_4_0/source/setup/provision.ldif 2005-07-05 06:17:47 UTC (rev 8157)
+++ branches/SAMBA_4_0/source/setup/provision.ldif 2005-07-05 07:10:52 UTC (rev 8158)
@@ -615,7 +615,7 @@
dNSHostName: ${DNSNAME}
objectCategory: CN=Computer,CN=Schema,CN=Configuration,${BASEDN}
isCriticalSystemObject: TRUE
-unicodePwd: ${JOINPASS}
+unicodePwd: ${MACHINEPASS}
servicePrincipalName: HOST/${DNSNAME}
servicePrincipalName: HOST/${NETBIOSNAME}
msDS-KeyVersionNumber: 1
@@ -653,7 +653,7 @@
servicePrincipalName: kadmin/changepw
objectCategory: CN=Person,CN=Schema,CN=Configuration,${BASEDN}
isCriticalSystemObject: TRUE
-unicodePwd: ${RANDPASS}
+unicodePwd: ${KRBTGTPASS}
dn: CN=Domain Computers,CN=Users,${BASEDN}
objectClass: top
Modified: branches/SAMBA_4_0/source/setup/provision.pl
===================================================================
--- branches/SAMBA_4_0/source/setup/provision.pl 2005-07-05 06:17:47 UTC (rev 8157)
+++ branches/SAMBA_4_0/source/setup/provision.pl 2005-07-05 07:10:52 UTC (rev 8158)
@@ -10,6 +10,8 @@
my $opt_realm;
my $opt_domain;
my $opt_adminpass;
+my $opt_krbtgtpass;
+my $opt_machinepass;
my $opt_root;
my $opt_nobody;
my $opt_nogroup;
@@ -69,8 +71,6 @@
return $pass;
}
-my $joinpass = randpass();
-
sub ldaptime()
{
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday) = gmtime(time);
@@ -78,6 +78,13 @@
$year+1900, $mon+1, $mday, $hour, $min, $sec;
}
+sub timestring()
+{
+ my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday) = gmtime(time);
+ return sprintf "%04u%02u%02u%02u%02u%02u",
+ $year+1900, $mon+1, $mday, $hour, $min, $sec;
+}
+
#######################
# substitute a single variable
sub substitute($)
@@ -124,6 +131,10 @@
return ldaptime();
}
+ if ($var eq "TIMESTRING") {
+ return timestring();
+ }
+
if ($var eq "NEWGUID") {
return randguid();
}
@@ -152,12 +163,12 @@
return $opt_adminpass;
}
- if ($var eq "RANDPASS") {
- return randpass();
+ if ($var eq "KRBTGTPASS") {
+ return $opt_krbtgtpass;
}
- if ($var eq "JOINPASS") {
- return $joinpass;
+ if ($var eq "MACHINEPASS") {
+ return $opt_machinepass;
}
if ($var eq "NTTIME") {
@@ -283,6 +294,8 @@
--invocationid GUID set invocationid (otherwise random)
--outputdir OUTPUTDIR set output directory
--adminpass PASSWORD choose admin password (otherwise random)
+ --krbtgtpass PASSWORD choose krbtgt password (otherwise random)
+ --machinepass PASSWORD choose machine password (otherwise random)
--root USERNAME choose 'root' unix username
--nobody USERNAME choose 'nobody' user
--nogroup GROUPNAME choose 'nogroup' group
@@ -309,6 +322,8 @@
'host-guid=s' => \$opt_hostguid,
'invocationid=s' => \$opt_invocationid,
'adminpass=s' => \$opt_adminpass,
+ 'krbtgtpass=s' => \$opt_krbtgtpass,
+ 'machinepass=s' => \$opt_machinepass,
'root=s' => \$opt_root,
'nobody=s' => \$opt_nobody,
'nogroup=s' => \$opt_nogroup,
@@ -401,6 +416,16 @@
print "chose random Administrator password '$opt_adminpass'\n";
}
+if (!$opt_krbtgtpass) {
+ $opt_krbtgtpass = randpass();
+ print "chose random krbtgt password '$opt_krbtgtpass'\n";
+}
+
+if (!$opt_machinepass) {
+ $opt_machinepass = randpass();
+ print "chose random machine password '$opt_machinepass'\n";
+}
+
# allow provisioning to be run from the source directory
$ENV{"PATH"} = "bin:../bin:" . $ENV{"PATH"};
Modified: branches/SAMBA_4_0/source/setup/provision.zone
===================================================================
--- branches/SAMBA_4_0/source/setup/provision.zone 2005-07-05 06:17:47 UTC (rev 8157)
+++ branches/SAMBA_4_0/source/setup/provision.zone 2005-07-05 07:10:52 UTC (rev 8158)
@@ -2,7 +2,7 @@
$ORIGIN ${DNSDOMAIN}.
$TTL 1W
@ IN SOA @ hostmaster (
- 42 ; serial (d. adams)
+ ${TIMESTRING} ; serial
2D ; refresh
4H ; retry
6W ; expiry
Modified: branches/SAMBA_4_0/source/setup/secrets.ldif
===================================================================
--- branches/SAMBA_4_0/source/setup/secrets.ldif 2005-07-05 06:17:47 UTC (rev 8157)
+++ branches/SAMBA_4_0/source/setup/secrets.ldif 2005-07-05 07:10:52 UTC (rev 8158)
@@ -23,7 +23,7 @@
objectClass: primaryDomain
flatname: ${DOMAIN}
realm: ${REALM}
-secret: ${JOINPASS}
+secret: ${MACHINEPASS}
secureChannelType: 6
sAMAccountName: ${NETBIOSNAME}$
whenCreated: ${LDAPTIME}
More information about the samba-cvs
mailing list