From: Martin Mares Date: Sat, 20 Dec 2003 20:55:53 +0000 (+0000) Subject: More v3.0 work. X-Git-Tag: v5.1~54 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=747c80cf4a1294d69e8905c349d796e472768c16;p=nsc-5.git More v3.0 work. --- diff --git a/TODO b/TODO index 55ea9bb..a114d10 100644 --- a/TODO +++ b/TODO @@ -2,8 +2,13 @@ DOC: mention namespaces DOC: mention trailing dot rules DOC: mention RFC 2317 (classless del.) DOC: ipv6 ::1.2.3.4 not supported +DOC: verbatim text Update the utilities +convert slashes in domain names when creating file names! + freebsd: don't use `-f' in hostname domain names with dots + +? if a zone doesn't change, don't bump the version diff --git a/m4/dnslib.m4 b/m4/dnslib.m4 index 8049ee7..0c74b45 100644 --- a/m4/dnslib.m4 +++ b/m4/dnslib.m4 @@ -19,6 +19,10 @@ define(MINUTES, `eval($1*60)') define(HOURS, `eval($1*3600)') define(DAYS, `eval($1*86400)') +# Since slashes can occur in zone names, we convert them to @'s + +define(nsc_file_name, `translit($1,/,@)') + # Reverse an IP address define(nsc_revIPa, `ifelse($#, 1, `$1', `nsc_revIPa(shift($@)).$1')') @@ -80,11 +84,11 @@ define(`nsc__forloop', define(`nsc_fatal_error', `errprint(`NSC error: $1 ')m4exit(1)') -# Default values of parameters and user configuration +# Default values of parameters define(`NAMED_RESTART_CMD', `ndc reload') -define(`BIND_OPTIONS', ` # Other options can be added here via macro BIND_OPTIONS') +define(`BIND_OPTIONS', ` # Other options can be added here via macro `BIND_OPTIONS'') define(`ROOT', `/etc/named') define(`CFDIR', `cf') @@ -101,4 +105,10 @@ define(`NSNAME', translit(esyscmd(`hostname -f'),` ',`')) define(`MAINTNAME', `root'.`nsc_corr_dot(NSNAME)') +# And finally we change comments to semicolons to be compatible with the zone files + +changecom(;) + +; User-defined parts of configuration + include(CFDIR/config) diff --git a/m4/mkconf.m4 b/m4/mkconf.m4 index 0b4c961..dff58a6 100644 --- a/m4/mkconf.m4 +++ b/m4/mkconf.m4 @@ -8,7 +8,7 @@ include(m4/dnslib.m4) define(`DO_PRIMARY', `divert(0)zone "$1" in { type master; - file "ZONEDIR/$2"; + file "ZONEDIR/nsc_file_name($2)"; }; divert(-1)') @@ -20,7 +20,7 @@ define(`REVERSE', `DO_PRIMARY(REV($1),nsc_if_v6($1,`nsc_revblock6($1)',`nsc_reva define(`SECONDARY', `divert(0)zone "$1" in { type slave; - file "BAKDIR/$1"; + file "BAKDIR/nsc_file_name($1)"; masters { $2; }; }; diff --git a/m4/mkmf.m4 b/m4/mkmf.m4 index 19942c5..36c3b8f 100644 --- a/m4/mkmf.m4 +++ b/m4/mkmf.m4 @@ -8,13 +8,13 @@ include(m4/dnslib.m4) define(`PRIMARIES', `') -define(`nsc_prepend_cf_one', ` 'CFDIR/`$1') +define(`nsc_prepend_cf_one', ` 'CFDIR/`nsc_file_name($1)') define(`nsc_prepend_cf_multi', `nsc_iterate(`nsc_prepend_cf_one', $@)') -define(`PRIMARY', `divert(0)ZONEDIR/$1:nsc_prepend_cf_multi($@) $(DDEPS) - `$'(NSC)nsc_prepend_cf_multi($@) >ZONEDIR/$1 -DVERS=VERSDIR/$1 +define(`PRIMARY', `divert(0)ZONEDIR/nsc_file_name($1):nsc_prepend_cf_multi($@) $(DDEPS) + `$'(NSC)nsc_prepend_cf_multi($@) >ZONEDIR/nsc_file_name($1) -DVERS=VERSDIR/nsc_file_name($1) divert(-1) -define(`PRIMARIES', PRIMARIES ZONEDIR/$1) +define(`PRIMARIES', PRIMARIES ZONEDIR/nsc_file_name($1)) ') define(`REVERSE', `PRIMARY(nsc_if_v6($1,`nsc_revblock6($1)',`nsc_revaddr($1)'), shift($@))') diff --git a/m4/nsc.m4 b/m4/nsc.m4 index ad6fa76..32cb793 100644 --- a/m4/nsc.m4 +++ b/m4/nsc.m4 @@ -29,10 +29,7 @@ define(nsc_abs_name, `ifelse(CURRENT_NAME, translit(CURRENT_NAME,.,:), CURRENT_N # SOA record -define(nsc_SOA, `divert; Primary file for the CURRENT_DOMAIN domain -; Generated by NSCVER (nsc.m4) on CURRENT_DATE -; Please do not edit manually - +define(nsc_SOA, ` $ORIGIN CURRENT_DOMAIN $TTL MINTTL nsc_emit_name `SOA' nsc_corr_dot(NSNAME) MAINTNAME ( @@ -120,7 +117,7 @@ define(HI, `nsc_emit_name HINFO "$1" "$2"') define(nsc_ALIAS, `$1 `CNAME' CURRENT_NAME ') -define(ALIAS, `nsc_iterate(`nsc_ALIAS', $@)dnl') +define(ALIAS, `nsc_iterate(`nsc_ALIAS', $@)nsc_set_name(CURRENT_NAME)dnl') # CNAME records @@ -139,6 +136,13 @@ define(REVBLOCK, `nsc_forloop(`i', $2, $3, `i' `CNAME' `i'.$1 # Cleanup actions define(nsc_cleanup, `ifdef(`DISABLE_LOCALHOST',,` +; Added automatically (required by RFC 1912) localhost A 127.0.0.1 ')') m4wrap(`nsc_cleanup') + +divert(0)dnl +`;;;' Primary zone file +`;;;' Generated by NSCVER (nsc.m4) on CURRENT_DATE +`;;;' Please do not edit manually +`'