[svn] commit: r2679 - in /branches/trac191: ./ doc/ ext/asio/ src/bin/auth/ src/bin/auth/tests/ src/bin/bind10/ src/bin/bindctl/ src/bin/bindctl/tests/ src/bin/xfrin/ src/lib/ src/lib/bench/ src/lib/cc/ src/lib/datasrc/ src/lib/datasrc/tests/ src/lib/dns/ src/lib/dns/python/ src/lib/dns/rdata/generic/ src/lib/dns/tests/ src/lib/python/isc/config/ src/lib/python/isc/config/tests/

BIND 10 source code commits bind10-changes at lists.isc.org
Tue Aug 10 07:42:12 UTC 2010


Author: naokikambe
Date: Tue Aug 10 07:42:12 2010
New Revision: 2679

Log:
merge from trunk head

Added:
    branches/trac191/ext/asio/README
      - copied unchanged from r2678, trunk/ext/asio/README
    branches/trac191/src/bin/auth/change_user.cc
      - copied unchanged from r2678, trunk/src/bin/auth/change_user.cc
    branches/trac191/src/bin/auth/change_user.h
      - copied unchanged from r2678, trunk/src/bin/auth/change_user.h
    branches/trac191/src/bin/auth/tests/change_user_unittest.cc
      - copied unchanged from r2678, trunk/src/bin/auth/tests/change_user_unittest.cc
    branches/trac191/src/lib/bench/   (props changed)
      - copied from r2678, trunk/src/lib/bench/
Modified:
    branches/trac191/   (props changed)
    branches/trac191/ChangeLog
    branches/trac191/Makefile.am
    branches/trac191/configure.ac
    branches/trac191/doc/Doxyfile
    branches/trac191/src/bin/auth/Makefile.am
    branches/trac191/src/bin/auth/b10-auth.xml
    branches/trac191/src/bin/auth/main.cc
    branches/trac191/src/bin/auth/tests/Makefile.am
    branches/trac191/src/bin/auth/tests/asio_link_unittest.cc
    branches/trac191/src/bin/bind10/bind10.py.in
    branches/trac191/src/bin/bindctl/bindcmd.py
    branches/trac191/src/bin/bindctl/tests/bindctl_test.py
    branches/trac191/src/bin/xfrin/   (props changed)
    branches/trac191/src/lib/Makefile.am
    branches/trac191/src/lib/cc/   (props changed)
    branches/trac191/src/lib/datasrc/   (props changed)
    branches/trac191/src/lib/datasrc/static_datasrc.cc
    branches/trac191/src/lib/datasrc/tests/static_unittest.cc
    branches/trac191/src/lib/dns/   (props changed)
    branches/trac191/src/lib/dns/python/message_python.cc
    branches/trac191/src/lib/dns/python/rrclass_python.cc
    branches/trac191/src/lib/dns/python/rrttl_python.cc
    branches/trac191/src/lib/dns/python/rrtype_python.cc
    branches/trac191/src/lib/dns/rdata/generic/rrsig_46.cc   (props changed)
    branches/trac191/src/lib/dns/tests/   (props changed)
    branches/trac191/src/lib/python/isc/config/config_data.py
    branches/trac191/src/lib/python/isc/config/tests/config_data_test.py

Modified: branches/trac191/ChangeLog
==============================================================================
--- branches/trac191/ChangeLog (original)
+++ branches/trac191/ChangeLog Tue Aug 10 07:42:12 2010
@@ -1,3 +1,21 @@
+  82.	[func]		jinmei
+	bin/auth: Added -u option to allow the effective process user
+	of the authoritative server after invocation.  The same option to
+	the boss process will be propagated to b10-auth, too.
+	(Trac #268, svn r2675)
+
+  81.	[func]		jinmei
+	Added a C++ framework for micro benchmark tests.  A supplemental
+	library functions to build query data for the tests were also
+	provided. (Trac #241, svn r2664)
+
+  80.	[bug]		jelte
+	bindctl no longer accepts configuration changes for unknown or
+	non-running modules (for the latter, this is until we have a
+	way to verify those options, at which point it'll be allowed
+	again).
+	(Trac #99, r2657)
+
   79.	[func]		feng, jinmei
 	Refactored the ASIO link interfaces to move incoming XFR and
 	NOTIFY processing to the auth server class.  Wrapper classes for

Modified: branches/trac191/Makefile.am
==============================================================================
--- branches/trac191/Makefile.am (original)
+++ branches/trac191/Makefile.am Tue Aug 10 07:42:12 2010
@@ -41,8 +41,8 @@
 coverage: clean-coverage perform-coverage report-coverage
 
 #### include external sources in the distributed tarball:
-# EXTRA_DIST = ext/asio/README
-EXTRA_DIST = ext/asio/asio/local/stream_protocol.hpp
+EXTRA_DIST = ext/asio/README
+EXTRA_DIST += ext/asio/asio/local/stream_protocol.hpp
 EXTRA_DIST += ext/asio/asio/local/basic_endpoint.hpp
 EXTRA_DIST += ext/asio/asio/local/datagram_protocol.hpp
 EXTRA_DIST += ext/asio/asio/local/connect_pair.hpp

Modified: branches/trac191/configure.ac
==============================================================================
--- branches/trac191/configure.ac (original)
+++ branches/trac191/configure.ac Tue Aug 10 07:42:12 2010
@@ -415,6 +415,9 @@
                  src/bin/stats/tests/Makefile
                  src/bin/usermgr/Makefile
                  src/lib/Makefile
+                 src/lib/bench/Makefile
+                 src/lib/bench/example/Makefile
+                 src/lib/bench/tests/Makefile
                  src/lib/cc/Makefile
                  src/lib/python/Makefile
                  src/lib/python/isc/Makefile

Modified: branches/trac191/doc/Doxyfile
==============================================================================
--- branches/trac191/doc/Doxyfile (original)
+++ branches/trac191/doc/Doxyfile Tue Aug 10 07:42:12 2010
@@ -568,7 +568,7 @@
 # directories like "/usr/src/myproject". Separate the files or directories
 # with spaces.
 
-INPUT                  = ../src/lib/cc ../src/lib/config ../src/lib/dns ../src/lib/exceptions ../src/lib/datasrc ../src/bin/auth
+INPUT                  = ../src/lib/cc ../src/lib/config ../src/lib/dns ../src/lib/exceptions ../src/lib/datasrc ../src/bin/auth ../src/lib/bench
 
 # This tag can be used to specify the character encoding of the source files
 # that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is

Modified: branches/trac191/src/bin/auth/Makefile.am
==============================================================================
--- branches/trac191/src/bin/auth/Makefile.am (original)
+++ branches/trac191/src/bin/auth/Makefile.am Tue Aug 10 07:42:12 2010
@@ -47,6 +47,7 @@
 BUILT_SOURCES = spec_config.h 
 pkglibexec_PROGRAMS = b10-auth
 b10_auth_SOURCES = auth_srv.cc auth_srv.h
+b10_auth_SOURCES += change_user.cc change_user.h
 b10_auth_SOURCES += common.h
 b10_auth_SOURCES += main.cc
 b10_auth_LDADD =  $(top_builddir)/src/lib/datasrc/.libs/libdatasrc.a

Modified: branches/trac191/src/bin/auth/b10-auth.xml
==============================================================================
--- branches/trac191/src/bin/auth/b10-auth.xml (original)
+++ branches/trac191/src/bin/auth/b10-auth.xml Tue Aug 10 07:42:12 2010
@@ -48,6 +48,7 @@
       <arg><option>-4</option></arg>
       <arg><option>-6</option></arg>
       <arg><option>-p <replaceable>number</replaceable></option></arg>
+      <arg><option>-u <replaceable>username</replaceable></option></arg>
       <arg><option>-v</option></arg>
     </cmdsynopsis>
   </refsynopsisdiv>
@@ -120,6 +121,20 @@
       </varlistentry>
 
       <varlistentry>
+        <term><option>-u <replaceable>username</replaceable></option></term>
+        <listitem>
+	  <para>
+	    The user name of the <command>b10-auth</command> daemon.
+	    If specified, the daemon changes the process owner to the
+	    specified user.
+	    The <replaceable>username</replaceable> must be either a
+	    valid numeric user ID or a valid user name.
+	    By default the daemon runs as the user who invokes it.
+	  </para>
+        </listitem>
+      </varlistentry>
+
+      <varlistentry>
         <term><option>-v</option></term>
         <listitem><para>
           Enabled verbose mode. This enables diagnostic messages to

Modified: branches/trac191/src/bin/auth/main.cc
==============================================================================
--- branches/trac191/src/bin/auth/main.cc (original)
+++ branches/trac191/src/bin/auth/main.cc Tue Aug 10 07:42:12 2010
@@ -41,6 +41,7 @@
 
 #include <auth/spec_config.h>
 #include <auth/common.h>
+#include <auth/change_user.h>
 #include <auth/auth_srv.h>
 #include <auth/asio_link.h>
 
@@ -97,9 +98,10 @@
     int ch;
     const char* port = DNSPORT;
     const char* address = NULL;
+    const char* uid = NULL;
     bool use_ipv4 = true, use_ipv6 = true, cache = true;
 
-    while ((ch = getopt(argc, argv, "46a:np:v")) != -1) {
+    while ((ch = getopt(argc, argv, "46a:np:u:v")) != -1) {
         switch (ch) {
         case '4':
             // Note that -4 means "ipv4 only", we need to set "use_ipv6" here,
@@ -120,6 +122,9 @@
             break;
         case 'p':
             port = optarg;
+            break;
+        case 'u':
+            uid = optarg;
             break;
         case 'v':
             verbose_mode = true;
@@ -188,6 +193,10 @@
                                              my_command_handler);
         cout << "[b10-auth] Configuration channel established." << endl;
 
+        if (uid != NULL) {
+            changeUser(uid);
+        }
+
         xfrin_session = new Session(io_service->get_io_service());
         cout << "[b10-auth] Xfrin session channel created." << endl;
         xfrin_session->establish(NULL);

Modified: branches/trac191/src/bin/auth/tests/Makefile.am
==============================================================================
--- branches/trac191/src/bin/auth/tests/Makefile.am (original)
+++ branches/trac191/src/bin/auth/tests/Makefile.am Tue Aug 10 07:42:12 2010
@@ -13,7 +13,9 @@
 run_unittests_SOURCES = $(top_srcdir)/src/lib/dns/tests/unittest_util.h
 run_unittests_SOURCES += $(top_srcdir)/src/lib/dns/tests/unittest_util.cc
 run_unittests_SOURCES += ../auth_srv.h ../auth_srv.cc
+run_unittests_SOURCES += ../change_user.h ../change_user.cc
 run_unittests_SOURCES += auth_srv_unittest.cc
+run_unittests_SOURCES += change_user_unittest.cc
 run_unittests_SOURCES += asio_link_unittest.cc
 run_unittests_SOURCES += run_unittests.cc
 run_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES)

Modified: branches/trac191/src/bin/auth/tests/asio_link_unittest.cc
==============================================================================
--- branches/trac191/src/bin/auth/tests/asio_link_unittest.cc (original)
+++ branches/trac191/src/bin/auth/tests/asio_link_unittest.cc Tue Aug 10 07:42:12 2010
@@ -108,8 +108,14 @@
 TEST(IOServiceTest, unavailableAddress) {
     // These addresses should generally be unavailable as a valid local
     // address, although there's no guarantee in theory.
-    EXPECT_THROW(IOService(NULL, *TEST_PORT, *"ffff:ffff::"), IOError);
     EXPECT_THROW(IOService(NULL, *TEST_PORT, *"255.255.0.0"), IOError);
+
+    // Some OSes would simply reject binding attempt for an AF_INET6 socket
+    // to an IPv4-mapped IPv6 address.  Even if those that allow it, since
+    // the corresponding IPv4 address is the same as the one used in the
+    // AF_INET socket case above, it should at least show the same result
+    // as the previous one.
+    EXPECT_THROW(IOService(NULL, *TEST_PORT, *"::ffff:255.255.0.0"), IOError);
 }
 
 TEST(IOServiceTest, duplicateBind) {

Modified: branches/trac191/src/bin/bind10/bind10.py.in
==============================================================================
--- branches/trac191/src/bin/bind10/bind10.py.in (original)
+++ branches/trac191/src/bin/bind10/bind10.py.in Tue Aug 10 07:42:12 2010
@@ -336,6 +336,8 @@
             authargs += ['-a', str(self.address)]
         if self.nocache:
             authargs += ['-n']
+        if self.uid:
+            authargs += ['-u', str(self.uid)]
         if self.verbose:
             authargs += ['-v']
             sys.stdout.write("Starting b10-auth using port %d" %

Modified: branches/trac191/src/bin/bindctl/bindcmd.py
==============================================================================
--- branches/trac191/src/bin/bindctl/bindcmd.py (original)
+++ branches/trac191/src/bin/bindctl/bindcmd.py Tue Aug 10 07:42:12 2010
@@ -543,6 +543,16 @@
                     identifier = cmd.params['identifier']
                 else:
                     identifier += cmd.params['identifier']
+
+                # Check if the module is known; for unknown modules
+                # we currently deny setting preferences, as we have
+                # no way yet to determine if they are ok.
+                module_name = identifier.split('/')[1]
+                if self.config_data is None or \
+                   not self.config_data.have_specification(module_name):
+                    print("Error: Module '" + module_name + "' unknown or not running")
+                    return
+
             if cmd.command == "show":
                 values = self.config_data.get_value_maps(identifier)
                 for value_map in values:

Modified: branches/trac191/src/bin/bindctl/tests/bindctl_test.py
==============================================================================
--- branches/trac191/src/bin/bindctl/tests/bindctl_test.py (original)
+++ branches/trac191/src/bin/bindctl/tests/bindctl_test.py Tue Aug 10 07:42:12 2010
@@ -237,6 +237,11 @@
             assert self.random_names[i] == cmd_names[i+1]
             assert self.random_names[i] == module_names[i+1]
             i = i + 1
+
+    def test_apply_cfg_command(self):
+        self.tool.location = '/'
+        cmd = cmdparse.BindCmdParse("config set identifier=\"foo/bar\" value=\"5\"")
+        self.tool.apply_config_cmd(cmd)
     
 class FakeBindCmdInterpreter(bindcmd.BindCmdInterpreter):
     def __init__(self):

Modified: branches/trac191/src/lib/Makefile.am
==============================================================================
--- branches/trac191/src/lib/Makefile.am (original)
+++ branches/trac191/src/lib/Makefile.am Tue Aug 10 07:42:12 2010
@@ -1,1 +1,1 @@
-SUBDIRS = exceptions dns cc config datasrc python xfr
+SUBDIRS = exceptions dns cc config datasrc python xfr bench

Modified: branches/trac191/src/lib/datasrc/static_datasrc.cc
==============================================================================
--- branches/trac191/src/lib/datasrc/static_datasrc.cc (original)
+++ branches/trac191/src/lib/datasrc/static_datasrc.cc Tue Aug 10 07:42:12 2010
@@ -70,6 +70,7 @@
 {
     authors = RRsetPtr(new RRset(authors_name, RRClass::CH(),
                                  RRType::TXT(), RRTTL(0)));
+    authors->addRdata(generic::TXT("Chen Zhengzhang")); // Jerry
     authors->addRdata(generic::TXT("Evan Hunt"));
     authors->addRdata(generic::TXT("Han Feng"));
     authors->addRdata(generic::TXT("Jelte Jansen"));
@@ -80,6 +81,8 @@
     authors->addRdata(generic::TXT("Michael Graff"));
     authors->addRdata(generic::TXT("Naoki Kambe"));
     authors->addRdata(generic::TXT("Shane Kerr"));
+    authors->addRdata(generic::TXT("Shen Tingting"));
+    authors->addRdata(generic::TXT("Stephen Morris"));
     authors->addRdata(generic::TXT("Zhang Likun"));
 
     authors_ns = RRsetPtr(new RRset(authors_name, RRClass::CH(),

Modified: branches/trac191/src/lib/datasrc/tests/static_unittest.cc
==============================================================================
--- branches/trac191/src/lib/datasrc/tests/static_unittest.cc (original)
+++ branches/trac191/src/lib/datasrc/tests/static_unittest.cc Tue Aug 10 07:42:12 2010
@@ -54,6 +54,7 @@
         version_data.push_back(PACKAGE_STRING);
 
         // XXX: in addition, the order the following items matter.
+        authors_data.push_back("Chen Zhengzhang");
         authors_data.push_back("Evan Hunt");
         authors_data.push_back("Han Feng");
         authors_data.push_back("Jelte Jansen");
@@ -64,6 +65,8 @@
         authors_data.push_back("Michael Graff");
         authors_data.push_back("Naoki Kambe");
         authors_data.push_back("Shane Kerr");
+        authors_data.push_back("Shen Tingting");
+        authors_data.push_back("Stephen Morris");
         authors_data.push_back("Zhang Likun");
 
         version_ns_data.push_back("version.bind.");

Modified: branches/trac191/src/lib/dns/python/message_python.cc
==============================================================================
--- branches/trac191/src/lib/dns/python/message_python.cc (original)
+++ branches/trac191/src/lib/dns/python/message_python.cc Tue Aug 10 07:42:12 2010
@@ -1192,8 +1192,7 @@
 
 static void
 Message_destroy(s_Message* self) {
-    if (self->message != NULL)
-        delete self->message;
+    delete self->message;
     self->message = NULL;
     Py_TYPE(self)->tp_free(self);
 }

Modified: branches/trac191/src/lib/dns/python/rrclass_python.cc
==============================================================================
--- branches/trac191/src/lib/dns/python/rrclass_python.cc (original)
+++ branches/trac191/src/lib/dns/python/rrclass_python.cc Tue Aug 10 07:42:12 2010
@@ -201,8 +201,7 @@
 
 static void
 RRClass_destroy(s_RRClass* self) {
-    if (self->rrclass != NULL)
-        delete self->rrclass;
+    delete self->rrclass;
     self->rrclass = NULL;
     Py_TYPE(self)->tp_free(self);
 }

Modified: branches/trac191/src/lib/dns/python/rrttl_python.cc
==============================================================================
--- branches/trac191/src/lib/dns/python/rrttl_python.cc (original)
+++ branches/trac191/src/lib/dns/python/rrttl_python.cc Tue Aug 10 07:42:12 2010
@@ -199,8 +199,7 @@
 
 static void
 RRTTL_destroy(s_RRTTL* self) {
-    if (self->rrttl != NULL)
-        delete self->rrttl;
+    delete self->rrttl;
     self->rrttl = NULL;
     Py_TYPE(self)->tp_free(self);
 }

Modified: branches/trac191/src/lib/dns/python/rrtype_python.cc
==============================================================================
--- branches/trac191/src/lib/dns/python/rrtype_python.cc (original)
+++ branches/trac191/src/lib/dns/python/rrtype_python.cc Tue Aug 10 07:42:12 2010
@@ -239,8 +239,7 @@
 
 static void
 RRType_destroy(s_RRType* self) {
-    if (self->rrtype != NULL)
-        delete self->rrtype;
+    delete self->rrtype;
     self->rrtype = NULL;
     Py_TYPE(self)->tp_free(self);
 }

Modified: branches/trac191/src/lib/python/isc/config/config_data.py
==============================================================================
--- branches/trac191/src/lib/python/isc/config/config_data.py (original)
+++ branches/trac191/src/lib/python/isc/config/config_data.py Tue Aug 10 07:42:12 2010
@@ -250,6 +250,11 @@
         """Removes the specification with the given module name. Does nothing if it wasn't there."""
         if module_name in self._specifications:
             del self._specifications[module_name]
+
+    def have_specification(self, module_name):
+        """Returns True if we have a specification for the module with the given name.
+           Returns False if we do not."""
+        return module_name in self._specifications
 
     def get_module_spec(self, module):
         """Returns the ModuleSpec for the module with the given name.

Modified: branches/trac191/src/lib/python/isc/config/tests/config_data_test.py
==============================================================================
--- branches/trac191/src/lib/python/isc/config/tests/config_data_test.py (original)
+++ branches/trac191/src/lib/python/isc/config/tests/config_data_test.py Tue Aug 10 07:42:12 2010
@@ -267,12 +267,16 @@
         self.assertEqual({}, self.mcd._current_config)
         self.assertEqual({}, self.mcd._local_changes)
 
-    def test_set_specification(self):
+    def test_set_remove_specification(self):
         module_spec = isc.config.module_spec_from_file(self.data_path + os.sep + "spec1.spec")
-        self.mcd.set_specification(module_spec)
+        self.assertFalse(self.mcd.have_specification(module_spec.get_module_name()))
+        self.mcd.set_specification(module_spec)
+        self.assertTrue(self.mcd.have_specification(module_spec.get_module_name()))
         self.assert_(module_spec.get_module_name() in self.mcd._specifications)
         self.assertEquals(module_spec, self.mcd._specifications[module_spec.get_module_name()])
         self.assertRaises(ConfigDataError, self.mcd.set_specification, "asdf")
+        self.mcd.remove_specification(module_spec.get_module_name())
+        self.assertFalse(self.mcd.have_specification(module_spec.get_module_name()))
 
     def test_get_module_spec(self):
         module_spec = isc.config.module_spec_from_file(self.data_path + os.sep + "spec1.spec")




More information about the bind10-changes mailing list