summaryrefslogtreecommitdiff
path: root/source4/script/provision.pl
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-05-09 00:41:32 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:51:49 -0500
commit961060351e3e3a3bfeb41c8d238babd349926ebf (patch)
tree10851599469434fe60ff281359585320e02ceb28 /source4/script/provision.pl
parent7aa41d890c8e886bfd9c1331c06329b9b97f2c14 (diff)
downloadsamba-961060351e3e3a3bfeb41c8d238babd349926ebf.tar.gz
samba-961060351e3e3a3bfeb41c8d238babd349926ebf.tar.bz2
samba-961060351e3e3a3bfeb41c8d238babd349926ebf.zip
r594: - make sure all users in the domain have the same base sid!
- added proper ldap time construction to provisioning (This used to be commit 0f12584b4b1b90aa20c6a4a5199829b5beba2a1d)
Diffstat (limited to 'source4/script/provision.pl')
-rwxr-xr-xsource4/script/provision.pl13
1 files changed, 11 insertions, 2 deletions
diff --git a/source4/script/provision.pl b/source4/script/provision.pl
index faa7cef385..e71c065328 100755
--- a/source4/script/provision.pl
+++ b/source4/script/provision.pl
@@ -36,6 +36,15 @@ sub randsid()
int(rand(10**8)), int(rand(10**8)), int(rand(10**8)));
}
+my $domainsid = randsid();
+
+sub ldaptime()
+{
+ my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday) = gmtime(time);
+ return sprintf "%04u%02u%02u%02u%02u%02u.0Z",
+ $year+1900, $mon+1, $mday, $hour, $min, $sec;
+}
+
#######################
# substitute a single variable
sub substitute($)
@@ -47,7 +56,7 @@ sub substitute($)
}
if ($var eq "DOMAINSID") {
- return randsid();
+ return $domainsid;
}
if ($var eq "DOMAIN") {
@@ -63,7 +72,7 @@ sub substitute($)
}
if ($var eq "LDAPTIME") {
- return "20040408072022.0Z";
+ return ldaptime();
}
if ($var eq "NEWGUID") {