diff options
author | Andrew Tridgell <tridge@samba.org> | 2005-07-11 05:45:42 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:20:05 -0500 |
commit | 9ab58c5e0127a66ae79cb867cfcf271734241b3d (patch) | |
tree | 669d2faf68edceb1957da14053f7ac99792652f2 | |
parent | 2696764132aea0fe61306a3516d27241a87ade35 (diff) | |
download | samba-9ab58c5e0127a66ae79cb867cfcf271734241b3d.tar.gz samba-9ab58c5e0127a66ae79cb867cfcf271734241b3d.tar.bz2 samba-9ab58c5e0127a66ae79cb867cfcf271734241b3d.zip |
r8315: fixed the generation of the serial number in the dns zone file (bind9
doesn't like it being too long)
(This used to be commit fc93ade9cdfe97bdcd2383fa256877580707181c)
-rwxr-xr-x | source4/setup/provision.pl | 11 | ||||
-rw-r--r-- | source4/setup/provision.zone | 2 |
2 files changed, 12 insertions, 1 deletions
diff --git a/source4/setup/provision.pl b/source4/setup/provision.pl index 512f0891c0..51c1d29631 100755 --- a/source4/setup/provision.pl +++ b/source4/setup/provision.pl @@ -85,6 +85,13 @@ sub timestring() $year+1900, $mon+1, $mday, $hour, $min, $sec; } +sub datestring() +{ + my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday) = gmtime(time); + return sprintf "%04u%02u%02u%02u", + $year+1900, $mon+1, $mday, $hour; +} + ####################### # substitute a single variable sub substitute($) @@ -135,6 +142,10 @@ sub substitute($) return timestring(); } + if ($var eq "DATESTRING") { + return datestring(); + } + if ($var eq "NEWGUID") { return randguid(); } diff --git a/source4/setup/provision.zone b/source4/setup/provision.zone index cde4caf092..0f5764dc11 100644 --- a/source4/setup/provision.zone +++ b/source4/setup/provision.zone @@ -2,7 +2,7 @@ $ORIGIN ${DNSDOMAIN}. $TTL 1W @ IN SOA @ hostmaster ( - ${TIMESTRING} ; serial + ${DATESTRING} ; serial 2D ; refresh 4H ; retry 6W ; expiry |