r8315: fixed the generation of the serial number in the dns zone file (bind9
authorAndrew Tridgell <tridge@samba.org>
Mon, 11 Jul 2005 05:45:42 +0000 (05:45 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:20:05 +0000 (13:20 -0500)
doesn't like it being too long)
(This used to be commit fc93ade9cdfe97bdcd2383fa256877580707181c)

source4/setup/provision.pl
source4/setup/provision.zone

index 512f0891c079c1d153933b7f3e376b1f52f3dfeb..51c1d29631f06b94fb9aa077b6039525433bbe55 100755 (executable)
@@ -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();
        }
index cde4caf092bf73da0c171a35b7444a30b55cfb7f..0f5764dc11ee2eaaa71cd9f7fb2108e0152f0757 100644 (file)
@@ -2,7 +2,7 @@
 $ORIGIN ${DNSDOMAIN}.
 $TTL 1W
 @               IN SOA  @   hostmaster (
-                                ${TIMESTRING}   ; serial
+                                ${DATESTRING}   ; serial
                                 2D              ; refresh
                                 4H              ; retry
                                 6W              ; expiry