Parcourir la source

[1294] changed the default of zones/ixfr_disabled to true. also make sure
the spec default is used when unspecified.

JINMEI Tatuya il y a 13 ans
Parent
commit
b9aefd1018
3 fichiers modifiés avec 51 ajouts et 28 suppressions
  1. 39 21
      doc/guide/bind10-guide.xml
  2. 1 1
      src/bin/xfrin/b10-xfrin.xml
  3. 11 6
      src/bin/xfrin/xfrin.py.in

+ 39 - 21
doc/guide/bind10-guide.xml

@@ -1278,13 +1278,19 @@ TODO
      that is, they don't work for an in-memory data source.
     </simpara></note>
 
-    <para>
-      To enable IXFR, you need to
-      configure <command>b10-xfrin</command> with an explicit zone
-      configuration for the zone.
-      For example, to enable IXFR for a zone named "example.com"
-      (whose master address is assumed to be 2001:db8::53 here),
-      run the following at the <command>bindctl</command> prompt:
+    <section>
+      <title>Configuration for Incoming Zone Transfers</title>
+      <para>
+	In practice, you need to specify a list of secondary zones to
+	enable incoming zone transfers for these zones (you can still
+	trigger a zone transfer manually, without a prior configuration
+	(see below)).
+      </para>
+
+      <para>
+	For example, to enable zone transfers for a zone named "example.com"
+	(whose master address is assumed to be 2001:db8::53 here),
+	run the following at the <command>bindctl</command> prompt:
 
       <screen>&gt; <userinput>config add Xfrin/zones</userinput>
 &gt; <userinput>config set Xfrin/zones[0]/name "<option>example.com</option>"</userinput>
@@ -1292,16 +1298,22 @@ TODO
 &gt; <userinput>config commit</userinput></screen>
 
       (We assume there has been no zone configuration before).
-      Note that you do NOT have to explicitly enable IXFR in the zone
-      configuration; once it's defined, IXFR is enabled by default.
-      This also means if you specify a zone configuration for some
-      other reason but don't want to use IXFR for that zone, you need
-      to disable it explicitly:
+      </para>
+    </section>
 
+    <section>
+      <title>Enabling IXFR</title>
+      <para>
+	As noted above, <command>b10-xfrin</command> uses AXFR for
+	zone transfers by default.  To enable IXFR for zone transfers
+	for a particular zone, set the <userinput>ixfr_disabled</userinput>
+	configuration parameter to <userinput>true</userinput>.
+	In the above example of configuration sequence, you'll need
+	to add the following before performing <userinput>commit</userinput>:
       <screen>&gt; <userinput>config set Xfrin/zones[0]/ixfr_disabled true</userinput></screen>
-    </para>
+      </para>
 
-    <para>
+      <note><simpara>
       One reason why IXFR is disabled by default in the current
       release is because it does not support automatic fallback from IXFR to
       AXFR when it encounters a primary server that doesn't support
@@ -1315,7 +1327,8 @@ TODO
       make this selection automatically.
       These features will be implemented in a near future
       version, at which point we will enable IXFR by default.
-    </para>
+      </simpara></note>
+    </section>
 
 <!-- TODO:
 
@@ -1328,13 +1341,18 @@ what if a NOTIFY is sent?
 
 -->
 
-    <para>
-       To manually trigger a zone transfer to retrieve a remote zone,
-       you may use the <command>bindctl</command> utility.
-       For example, at the <command>bindctl</command> prompt run:
+    <section>
+      <title>Trigger an Incoming Zone Transfer Manually</title>
+
+      <para>
+	To manually trigger a zone transfer to retrieve a remote zone,
+	you may use the <command>bindctl</command> utility.
+	For example, at the <command>bindctl</command> prompt run:
+
+	<screen>&gt; <userinput>Xfrin retransfer zone_name="<option>foo.example.org</option>" master=<option>192.0.2.99</option></userinput></screen>
+      </para>
+    </section>
 
-       <screen>&gt; <userinput>Xfrin retransfer zone_name="<option>foo.example.org</option>" master=<option>192.0.2.99</option></userinput></screen>
-    </para>
 
 <!-- TODO: can that retransfer be used to identify a new zone? -->
 <!-- TODO: what if doesn't exist at that master IP? -->

+ 1 - 1
src/bin/xfrin/b10-xfrin.xml

@@ -110,7 +110,7 @@ in separate zonemgr process.
       <varname>class</varname> (defaults to <quote>IN</quote>),
       <varname>master_addr</varname> (the zone master to transfer from),
       <varname>master_port</varname> (defaults to 53),
-      <varname>ixfr_disabled</varname> (defaults to false), and
+      <varname>ixfr_disabled</varname> (defaults to true), and
       <varname>tsig_key</varname> (optional TSIG key to use).
       The <varname>tsig_key</varname> is specified using a full string
       colon-delimited name:key:algorithm representation (e.g.

+ 11 - 6
src/bin/xfrin/xfrin.py.in

@@ -876,7 +876,12 @@ class ZoneInfo:
         self.set_master_port(config_data.get('master_port'))
         self.set_zone_class(config_data.get('class'))
         self.set_tsig_key(config_data.get('tsig_key'))
-        self.set_ixfr_disabled(config_data.get('ixfr_disabled'))
+        # XXX: harecode the default for ixfr_disabled.  We should retrieve
+        # it from the 
+        ixfr_disabled = config_data.get('ixfr_disabled')
+        if ixfr_disabled is None:
+            ixfr_disabled = True
+        self.set_ixfr_disabled(ixfr_disabled)
 
     def set_name(self, name_str):
         """Set the name for this zone given a name string.
@@ -952,14 +957,14 @@ class ZoneInfo:
                 raise XfrinZoneInfoException(errmsg)
 
     def set_ixfr_disabled(self, ixfr_disabled):
-        """Set ixfr_disabled. If set to False (the default), it will use
+        """Set ixfr_disabled. If set to False, it will use
            IXFR for incoming transfers. If set to True, it will use AXFR.
            At this moment there is no automatic fallback"""
-        # don't care what type it is; if evaluates to true, set to True
-        if ixfr_disabled:
-            self.ixfr_disabled = True
+        if ixfr_disabled is None:
+            self.ixfr_disabled = \
+                self._module_cc.get_default_value("zones/ixfr_disabled")
         else:
-            self.ixfr_disabled = False
+            self.ixfr_disabled = ixfr_disabled
 
     def get_master_addr_info(self):
         return (self.master_addr.family, socket.SOCK_STREAM,