r594: - make sure all users in the domain have the same base sid!
authorAndrew Tridgell <tridge@samba.org>
Sun, 9 May 2004 00:41:32 +0000 (00:41 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:51:49 +0000 (12:51 -0500)
 - added proper ldap time construction to provisioning
(This used to be commit 0f12584b4b1b90aa20c6a4a5199829b5beba2a1d)

source4/script/provision.pl

index faa7cef385fad01b49d858d10d49ef4bbee7263a..e71c065328f77604bf3e85153207d02bbb6dc0b6 100755 (executable)
@@ -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") {