mirror of
https://github.com/samba-team/samba.git
synced 2025-08-03 04:22:09 +03:00
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 fc93ade9cd
)
This commit is contained in:
committed by
Gerald (Jerry) Carter
parent
2696764132
commit
9ab58c5e01
@ -85,6 +85,13 @@ sub timestring()
|
|||||||
$year+1900, $mon+1, $mday, $hour, $min, $sec;
|
$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
|
# substitute a single variable
|
||||||
sub substitute($)
|
sub substitute($)
|
||||||
@ -135,6 +142,10 @@ sub substitute($)
|
|||||||
return timestring();
|
return timestring();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($var eq "DATESTRING") {
|
||||||
|
return datestring();
|
||||||
|
}
|
||||||
|
|
||||||
if ($var eq "NEWGUID") {
|
if ($var eq "NEWGUID") {
|
||||||
return randguid();
|
return randguid();
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
$ORIGIN ${DNSDOMAIN}.
|
$ORIGIN ${DNSDOMAIN}.
|
||||||
$TTL 1W
|
$TTL 1W
|
||||||
@ IN SOA @ hostmaster (
|
@ IN SOA @ hostmaster (
|
||||||
${TIMESTRING} ; serial
|
${DATESTRING} ; serial
|
||||||
2D ; refresh
|
2D ; refresh
|
||||||
4H ; retry
|
4H ; retry
|
||||||
6W ; expiry
|
6W ; expiry
|
||||||
|
Reference in New Issue
Block a user