[svn] commit: r2731 - in /branches/trac289: ./ doc/ doc/guide/ ext/asio/ src/bin/auth/ src/bin/auth/tests/ src/bin/bind10/ src/bin/bindctl/ src/bin/bindctl/tests/ src/bin/cfgmgr/ src/bin/host/ src/bin/msgq/ src/bin/usermgr/ src/bin/xfrin/ src/bin/xfrin/tests/ src/bin/xfrout/tests/ src/lib/ src/lib/bench/ src/lib/cc/ src/lib/cc/tests/ src/lib/config/ src/lib/config/testdata/ src/lib/config/tests/ 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/exceptions/ src/lib/exceptions/tests/ src/lib/python/isc/config/ src/lib/python/isc/config/tests/ src/lib/xfr/
BIND 10 source code commits
bind10-changes at lists.isc.org
Mon Aug 16 05:23:40 UTC 2010
Author: chenzhengzhang
Date: Mon Aug 16 05:23:39 2010
New Revision: 2731
Log:
merge trunk into trac289
Added:
branches/trac289/ext/asio/README
- copied unchanged from r2729, trunk/ext/asio/README
branches/trac289/src/bin/auth/change_user.cc
- copied unchanged from r2729, trunk/src/bin/auth/change_user.cc
branches/trac289/src/bin/auth/change_user.h
- copied unchanged from r2729, trunk/src/bin/auth/change_user.h
branches/trac289/src/bin/auth/tests/change_user_unittest.cc
- copied unchanged from r2729, trunk/src/bin/auth/tests/change_user_unittest.cc
branches/trac289/src/lib/bench/ (props changed)
- copied from r2729, trunk/src/lib/bench/
branches/trac289/src/lib/cc/tests/
- copied from r2729, trunk/src/lib/cc/tests/
branches/trac289/src/lib/config/testdata/b10-config-bad4.db
- copied unchanged from r2729, trunk/src/lib/config/testdata/b10-config-bad4.db
branches/trac289/src/lib/exceptions/tests/
- copied from r2729, trunk/src/lib/exceptions/tests/
Removed:
branches/trac289/src/lib/cc/data_unittests.cc
branches/trac289/src/lib/cc/run_unittests.cc
branches/trac289/src/lib/cc/session_unittests.cc
branches/trac289/src/lib/exceptions/exceptions_unittest.cc
branches/trac289/src/lib/exceptions/run_unittests.cc
Modified:
branches/trac289/ (props changed)
branches/trac289/ChangeLog
branches/trac289/Makefile.am
branches/trac289/configure.ac
branches/trac289/doc/Doxyfile
branches/trac289/doc/guide/bind10-guide.html
branches/trac289/doc/guide/bind10-guide.xml
branches/trac289/src/bin/auth/Makefile.am
branches/trac289/src/bin/auth/asio_link.cc
branches/trac289/src/bin/auth/auth_srv.cc
branches/trac289/src/bin/auth/b10-auth.8
branches/trac289/src/bin/auth/b10-auth.xml
branches/trac289/src/bin/auth/main.cc
branches/trac289/src/bin/auth/tests/Makefile.am
branches/trac289/src/bin/auth/tests/asio_link_unittest.cc
branches/trac289/src/bin/auth/tests/auth_srv_unittest.cc
branches/trac289/src/bin/bind10/bind10.8
branches/trac289/src/bin/bind10/bind10.py.in
branches/trac289/src/bin/bind10/bind10.xml
branches/trac289/src/bin/bindctl/bindcmd.py
branches/trac289/src/bin/bindctl/tests/bindctl_test.py
branches/trac289/src/bin/cfgmgr/b10-cfgmgr.py.in
branches/trac289/src/bin/host/Makefile.am
branches/trac289/src/bin/msgq/b10-msgq.8
branches/trac289/src/bin/msgq/msgq.xml
branches/trac289/src/bin/usermgr/b10-cmdctl-usermgr.py.in
branches/trac289/src/bin/xfrin/ (props changed)
branches/trac289/src/bin/xfrin/tests/Makefile.am
branches/trac289/src/bin/xfrout/tests/Makefile.am
branches/trac289/src/lib/Makefile.am
branches/trac289/src/lib/cc/ (props changed)
branches/trac289/src/lib/cc/Makefile.am
branches/trac289/src/lib/cc/session.cc
branches/trac289/src/lib/config/Makefile.am
branches/trac289/src/lib/config/testdata/b10-config-bad1.db
branches/trac289/src/lib/config/testdata/b10-config.db
branches/trac289/src/lib/config/tests/Makefile.am
branches/trac289/src/lib/datasrc/ (props changed)
branches/trac289/src/lib/datasrc/static_datasrc.cc
branches/trac289/src/lib/datasrc/tests/Makefile.am
branches/trac289/src/lib/datasrc/tests/datasrc_unittest.cc
branches/trac289/src/lib/datasrc/tests/static_unittest.cc
branches/trac289/src/lib/dns/ (props changed)
branches/trac289/src/lib/dns/message.h
branches/trac289/src/lib/dns/python/libdns_python.cc
branches/trac289/src/lib/dns/python/message_python.cc (contents, props changed)
branches/trac289/src/lib/dns/python/name_python.cc
branches/trac289/src/lib/dns/python/question_python.cc
branches/trac289/src/lib/dns/python/rrclass_python.cc
branches/trac289/src/lib/dns/python/rrset_python.cc
branches/trac289/src/lib/dns/python/rrttl_python.cc
branches/trac289/src/lib/dns/python/rrtype_python.cc
branches/trac289/src/lib/dns/rdata/generic/rrsig_46.cc (props changed)
branches/trac289/src/lib/dns/rdata/generic/txt_16.cc
branches/trac289/src/lib/dns/tests/ (props changed)
branches/trac289/src/lib/dns/tests/Makefile.am
branches/trac289/src/lib/exceptions/Makefile.am
branches/trac289/src/lib/python/isc/config/ccsession.py
branches/trac289/src/lib/python/isc/config/cfgmgr.py
branches/trac289/src/lib/python/isc/config/config_data.py
branches/trac289/src/lib/python/isc/config/tests/ccsession_test.py
branches/trac289/src/lib/python/isc/config/tests/cfgmgr_test.py
branches/trac289/src/lib/python/isc/config/tests/config_data_test.py
branches/trac289/src/lib/xfr/xfrout_client.cc
Modified: branches/trac289/ChangeLog
==============================================================================
--- branches/trac289/ChangeLog (original)
+++ branches/trac289/ChangeLog Mon Aug 16 05:23:39 2010
@@ -1,3 +1,39 @@
+ 85. [build]* jinmei
+ Build programs using dynamic link by default. A new configure
+ option --enable-static-link is provided to force static link for
+ executable programs. Statically linked programs can be run on a
+ debugger more easily and would be convenient for developers.
+ (Trac #309, svn r2723)
+
+bind10-devel-20100812 released on August 12, 2010
+
+ 84. [bug] jinmei, jerry
+ This is a quick fix patch for the issue: AXFR fails half the
+ time because of connection problems. xfrout client will make
+ a new connection every time. (Trac #299, svn r2697)
+
+ 83. [build]* jreed
+ The configure --with-boost-lib option is removed. It was not
+ used since the build included ASIO. (svn r2684)
+
+ 82. [func] jinmei
+ bin/auth: Added -u option to change 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
@@ -196,7 +232,11 @@
a remote server. (Trac #218, svn r2038)
49. [func]* jelte
- Use unix domain sockets for msgq. (Trac #183, svn r2009)
+ Use unix domain sockets for msgq. For b10-msgq, the command
+ line options --msgq-port and -m were removed. For bind10,
+ the -msgq-port option was removed, and the -m command line
+ option was changed to be a filename (instead of port number).
+ (Trac #183, svn r2009)
48. [func] jelte
bin/auth: Use asio's io_service for the msgq handling.
Modified: branches/trac289/Makefile.am
==============================================================================
--- branches/trac289/Makefile.am (original)
+++ branches/trac289/Makefile.am Mon Aug 16 05:23:39 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/trac289/configure.ac
==============================================================================
--- branches/trac289/configure.ac (original)
+++ branches/trac289/configure.ac Mon Aug 16 05:23:39 2010
@@ -31,6 +31,14 @@
rpath_available=no
])
LDFLAGS=$LDFLAGS_SAVED
+
+# allow building programs with static link. we need to make it selective
+# because loadable modules cannot be statically linked.
+AC_ARG_ENABLE([static-link],
+AC_HELP_STRING([--enable-static-link],
+ [build programs with static link [[default=no]]]),
+ [enable_static_link=yes], [enable_static_link=no])
+AM_CONDITIONAL(USE_STATIC_LINK, test $enable_static_link = yes)
# OS dependent compiler flags
case "$host" in
@@ -255,14 +263,6 @@
CPPFLAGS="$CPPFLAGS $BOOST_INCLUDES"
fi
AC_SUBST(BOOST_INCLUDES)
-
-AC_ARG_WITH([boost-lib],
-AC_HELP_STRING([--with-boost-lib=PATH],
- [specify exact directory for Boost libraries]),
- [if test "$withval" != "yes" -a "$withval" != "no"; then
- BOOST_LDFLAGS="-L$withval"
- fi])
-AC_SUBST(BOOST_LDFLAGS)
#
# Check availability of gtest, which will be used for unit tests.
@@ -415,7 +415,11 @@
src/bin/zonemgr/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/cc/tests/Makefile
src/lib/python/Makefile
src/lib/python/isc/Makefile
src/lib/python/isc/datasrc/Makefile
@@ -434,6 +438,7 @@
src/lib/dns/python/Makefile
src/lib/dns/python/tests/Makefile
src/lib/exceptions/Makefile
+ src/lib/exceptions/tests/Makefile
src/lib/datasrc/Makefile
src/lib/datasrc/tests/Makefile
src/lib/xfr/Makefile
Modified: branches/trac289/doc/Doxyfile
==============================================================================
--- branches/trac289/doc/Doxyfile (original)
+++ branches/trac289/doc/Doxyfile Mon Aug 16 05:23:39 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/trac289/doc/guide/bind10-guide.html
==============================================================================
--- branches/trac289/doc/guide/bind10-guide.html (original)
+++ branches/trac289/doc/guide/bind10-guide.html Mon Aug 16 05:23:39 2010
@@ -2,7 +2,7 @@
The most up-to-date version of this document, along with other documents
for BIND 10, can be found at
<a class="ulink" href="http://bind10.isc.org/docs" target="_top">http://bind10.isc.org/docs</a>.
- </p></div></div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="chapter"><a href="#intro">1. Introduction</a></span></dt><dd><dl><dt><span class="section"><a href="#id1168230342718">Supported Platforms</a></span></dt><dt><span class="section"><a href="#id1168230342746">Required Software</a></span></dt><dt><span class="section"><a href="#starting_stopping">Starting and Stopping the Server</a></span></dt><dt><span class="section"><a href="#managing_once_running">Managing BIND 10</a></span></dt></dl></dd><dt><span class="chapter"><a href="#installation">2. Installation</a></span></dt><dd><dl><dt><span class="section"><a href="#id1168230328220">Building Requirements</a></span></dt><dt><span class="section"><a href="#quickstart">Quick start</a></span></dt><dt><span class="section"><a href="#install">Installation from source</a></span></dt><dd><dl><dt><span class="section"><a href="#id1168230328405">Download Tar File</a></span></dt><dt><s
pan class="section"><a href="#id1168230328425">Retrieve from Subversion</a></span></dt><dt><span class="section"><a href="#id1168230328485">Configure before the build</a></span></dt><dt><span class="section"><a href="#id1168230328596">Build</a></span></dt><dt><span class="section"><a href="#id1168230328611">Install</a></span></dt><dt><span class="section"><a href="#id1168230328642">Install Hierarchy</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="#bind10">3. Starting BIND10 with <span class="command"><strong>bind10</strong></span></a></span></dt><dd><dl><dt><span class="section"><a href="#start">Starting BIND 10</a></span></dt></dl></dd><dt><span class="chapter"><a href="#msgq">4. Command channel</a></span></dt><dt><span class="chapter"><a href="#cfgmgr">5. Configuration manager</a></span></dt><dt><span class="chapter"><a href="#cmdctl">6. Remote control daemon</a></span></dt><dd><dl><dt><span class="section"><a href="#cmdctl.spec">Configuration specifi
cation for b10-cmdctl</a></span></dt></dl></dd><dt><span class="chapter"><a href="#bindctl">7. Control and configure user interface</a></span></dt><dt><span class="chapter"><a href="#authserver">8. Authoritative Server</a></span></dt><dd><dl><dt><span class="section"><a href="#id1168230329208">Server Configurations</a></span></dt><dt><span class="section"><a href="#id1168230329273">Data Source Backends</a></span></dt><dt><span class="section"><a href="#id1168230329303">Loading Master Zones Files</a></span></dt></dl></dd><dt><span class="chapter"><a href="#xfrin">9. Incoming Zone Transfers</a></span></dt><dt><span class="chapter"><a href="#xfrout">10. Outbound Zone Transfers</a></span></dt></dl></div><div class="chapter" title="Chapter 1. Introduction"><div class="titlepage"><div><div><h2 class="title"><a name="intro"></a>Chapter 1. Introduction</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="section"><a href="#id1168230342718">S
upported Platforms</a></span></dt><dt><span class="section"><a href="#id1168230342746">Required Software</a></span></dt><dt><span class="section"><a href="#starting_stopping">Starting and Stopping the Server</a></span></dt><dt><span class="section"><a href="#managing_once_running">Managing BIND 10</a></span></dt></dl></div><p>
+ </p></div></div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="chapter"><a href="#intro">1. Introduction</a></span></dt><dd><dl><dt><span class="section"><a href="#id1168230342718">Supported Platforms</a></span></dt><dt><span class="section"><a href="#id1168230342746">Required Software</a></span></dt><dt><span class="section"><a href="#starting_stopping">Starting and Stopping the Server</a></span></dt><dt><span class="section"><a href="#managing_once_running">Managing BIND 10</a></span></dt></dl></dd><dt><span class="chapter"><a href="#installation">2. Installation</a></span></dt><dd><dl><dt><span class="section"><a href="#id1168230328220">Building Requirements</a></span></dt><dt><span class="section"><a href="#quickstart">Quick start</a></span></dt><dt><span class="section"><a href="#install">Installation from source</a></span></dt><dd><dl><dt><span class="section"><a href="#id1168230328406">Download Tar File</a></span></dt><dt><s
pan class="section"><a href="#id1168230328426">Retrieve from Subversion</a></span></dt><dt><span class="section"><a href="#id1168230328486">Configure before the build</a></span></dt><dt><span class="section"><a href="#id1168230328584">Build</a></span></dt><dt><span class="section"><a href="#id1168230328599">Install</a></span></dt><dt><span class="section"><a href="#id1168230328622">Install Hierarchy</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="#bind10">3. Starting BIND10 with <span class="command"><strong>bind10</strong></span></a></span></dt><dd><dl><dt><span class="section"><a href="#start">Starting BIND 10</a></span></dt></dl></dd><dt><span class="chapter"><a href="#msgq">4. Command channel</a></span></dt><dt><span class="chapter"><a href="#cfgmgr">5. Configuration manager</a></span></dt><dt><span class="chapter"><a href="#cmdctl">6. Remote control daemon</a></span></dt><dd><dl><dt><span class="section"><a href="#cmdctl.spec">Configuration specifi
cation for b10-cmdctl</a></span></dt></dl></dd><dt><span class="chapter"><a href="#bindctl">7. Control and configure user interface</a></span></dt><dt><span class="chapter"><a href="#authserver">8. Authoritative Server</a></span></dt><dd><dl><dt><span class="section"><a href="#id1168230329190">Server Configurations</a></span></dt><dt><span class="section"><a href="#id1168230329255">Data Source Backends</a></span></dt><dt><span class="section"><a href="#id1168230329285">Loading Master Zones Files</a></span></dt></dl></dd><dt><span class="chapter"><a href="#xfrin">9. Incoming Zone Transfers</a></span></dt><dt><span class="chapter"><a href="#xfrout">10. Outbound Zone Transfers</a></span></dt></dl></div><div class="chapter" title="Chapter 1. Introduction"><div class="titlepage"><div><div><h2 class="title"><a name="intro"></a>Chapter 1. Introduction</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="section"><a href="#id1168230342718">S
upported Platforms</a></span></dt><dt><span class="section"><a href="#id1168230342746">Required Software</a></span></dt><dt><span class="section"><a href="#starting_stopping">Starting and Stopping the Server</a></span></dt><dt><span class="section"><a href="#managing_once_running">Managing BIND 10</a></span></dt></dl></div><p>
BIND is the popular implementation of a DNS server, developer
interfaces, and DNS tools.
BIND 10 is a rewrite of BIND 9. BIND 10 is written in C++ and Python
@@ -32,9 +32,8 @@
data source backend is SQLite3. The authoritative server
requires SQLite 3.3.9 or newer.
The <span class="command"><strong>b10-xfrin</strong></span> and <span class="command"><strong>b10-xfrout</strong></span>
- modules require the libboost library,
- libpython3 library,
- and the Python _sqlite3.so module.
+ modules require the libpython3 library and the Python
+ _sqlite3.so module.
</p></div><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
Some operating systems do not provide these dependencies
in their default installation nor standard packages
@@ -117,7 +116,7 @@
and, of course, DNS. These include detailed developer
documentation and code examples.
- </p></div><div class="chapter" title="Chapter 2. Installation"><div class="titlepage"><div><div><h2 class="title"><a name="installation"></a>Chapter 2. Installation</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="section"><a href="#id1168230328220">Building Requirements</a></span></dt><dt><span class="section"><a href="#quickstart">Quick start</a></span></dt><dt><span class="section"><a href="#install">Installation from source</a></span></dt><dd><dl><dt><span class="section"><a href="#id1168230328405">Download Tar File</a></span></dt><dt><span class="section"><a href="#id1168230328425">Retrieve from Subversion</a></span></dt><dt><span class="section"><a href="#id1168230328485">Configure before the build</a></span></dt><dt><span class="section"><a href="#id1168230328596">Build</a></span></dt><dt><span class="section"><a href="#id1168230328611">Install</a></span></dt><dt><span class="section"><a href="#id1168230328642">Install
Hierarchy</a></span></dt></dl></dd></dl></div><div class="section" title="Building Requirements"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id1168230328220"></a>Building Requirements</h2></div></div></div><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
+ </p></div><div class="chapter" title="Chapter 2. Installation"><div class="titlepage"><div><div><h2 class="title"><a name="installation"></a>Chapter 2. Installation</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="section"><a href="#id1168230328220">Building Requirements</a></span></dt><dt><span class="section"><a href="#quickstart">Quick start</a></span></dt><dt><span class="section"><a href="#install">Installation from source</a></span></dt><dd><dl><dt><span class="section"><a href="#id1168230328406">Download Tar File</a></span></dt><dt><span class="section"><a href="#id1168230328426">Retrieve from Subversion</a></span></dt><dt><span class="section"><a href="#id1168230328486">Configure before the build</a></span></dt><dt><span class="section"><a href="#id1168230328584">Build</a></span></dt><dt><span class="section"><a href="#id1168230328599">Install</a></span></dt><dt><span class="section"><a href="#id1168230328622">Install
Hierarchy</a></span></dt></dl></dd></dl></div><div class="section" title="Building Requirements"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id1168230328220"></a>Building Requirements</h2></div></div></div><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
Some operating systems have split their distribution packages into
a run-time and a development package. You will need to install
the development package versions, which include header files and
@@ -128,9 +127,8 @@
</p><p>
- The Boost Library, Python Library,
- and Python _sqlite3 module are required to enable the
- Xfrout and Xfrin support.
+ The Python Library and Python _sqlite3 module are required to
+ enable the Xfrout and Xfrin support.
</p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
The Python related libraries and modules need to be built
for Python 3.1.
@@ -178,14 +176,14 @@
the Subversion code revision control system or as a downloadable
tar file. It may also be available in pre-compiled ready-to-use
packages from operating system vendors.
- </p><div class="section" title="Download Tar File"><div class="titlepage"><div><div><h3 class="title"><a name="id1168230328405"></a>Download Tar File</h3></div></div></div><p>
+ </p><div class="section" title="Download Tar File"><div class="titlepage"><div><div><h3 class="title"><a name="id1168230328406"></a>Download Tar File</h3></div></div></div><p>
Downloading a release tar file is the recommended method to
obtain the source code.
</p><p>
The BIND 10 releases are available as tar file downloads from
<a class="ulink" href="ftp://ftp.isc.org/isc/bind10/" target="_top">ftp://ftp.isc.org/isc/bind10/</a>.
Periodic development snapshots may also be available.
- </p></div><div class="section" title="Retrieve from Subversion"><div class="titlepage"><div><div><h3 class="title"><a name="id1168230328425"></a>Retrieve from Subversion</h3></div></div></div><p>
+ </p></div><div class="section" title="Retrieve from Subversion"><div class="titlepage"><div><div><h3 class="title"><a name="id1168230328426"></a>Retrieve from Subversion</h3></div></div></div><p>
Downloading this "bleeding edge" code is recommended only for
developers or advanced users. Using development code in a production
environment is not recommended.
@@ -217,7 +215,7 @@
<span class="command"><strong>autoheader</strong></span>,
<span class="command"><strong>automake</strong></span>,
and related commands.
- </p></div><div class="section" title="Configure before the build"><div class="titlepage"><div><div><h3 class="title"><a name="id1168230328485"></a>Configure before the build</h3></div></div></div><p>
+ </p></div><div class="section" title="Configure before the build"><div class="titlepage"><div><div><h3 class="title"><a name="id1168230328486"></a>Configure before the build</h3></div></div></div><p>
BIND 10 uses the GNU Build System to discover build environment
details.
To generate the makefiles using the defaults, simply run:
@@ -229,7 +227,6 @@
</p><div class="variablelist"><dl><dt><span class="term">--prefix</span></dt><dd>Define the the installation location (the
default is <code class="filename">/usr/local/</code>).
</dd><dt><span class="term">--with-boost-include</span></dt><dd>Define the path to find the Boost headers.
- </dd><dt><span class="term">--with-boost-lib</span></dt><dd>Define the path to find the Boost library.
</dd><dt><span class="term">--with-pythonpath</span></dt><dd>Define the path to Python 3.1 if it is not in the
standard execution path.
</dd><dt><span class="term">--with-gtest</span></dt><dd>Enable building the C++ Unit Tests using the
@@ -239,31 +236,26 @@
</p><p>
For example, the following configures it to
- find the Boost headers and library, find the
+ find the Boost headers, find the
Python interpreter, and sets the installation location:
- </p><pre class="screen">$ <strong class="userinput"><code>./configure --with-boost-lib=/usr/pkg/lib \
+ </p><pre class="screen">$ <strong class="userinput"><code>./configure \
--with-boost-include=/usr/pkg/include \
--with-pythonpath=/usr/pkg/bin/python3.1 \
--prefix=/opt/bind10</code></strong></pre><p>
</p><p>
If the configure fails, it may be due to missing or old
dependencies.
- </p></div><div class="section" title="Build"><div class="titlepage"><div><div><h3 class="title"><a name="id1168230328596"></a>Build</h3></div></div></div><p>
+ </p></div><div class="section" title="Build"><div class="titlepage"><div><div><h3 class="title"><a name="id1168230328584"></a>Build</h3></div></div></div><p>
After the configure step is complete, to build the executables
from the C++ code and prepare the Python scripts, run:
</p><pre class="screen">$ <strong class="userinput"><code>make</code></strong></pre><p>
- </p></div><div class="section" title="Install"><div class="titlepage"><div><div><h3 class="title"><a name="id1168230328611"></a>Install</h3></div></div></div><p>
+ </p></div><div class="section" title="Install"><div class="titlepage"><div><div><h3 class="title"><a name="id1168230328599"></a>Install</h3></div></div></div><p>
To install the BIND 10 executables, support files,
and documentation, run:
</p><pre class="screen">$ <strong class="userinput"><code>make install</code></strong></pre><p>
- </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>The install step may require superuser privileges.</p></div><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
- Depending on your system and the location of your Boost
- Python and Python shared libraries, you may need to
- configure your run-time linker to find them (such as
- setting LD_LIBRARY_PATH).
- </p></div></div><div class="section" title="Install Hierarchy"><div class="titlepage"><div><div><h3 class="title"><a name="id1168230328642"></a>Install Hierarchy</h3></div></div></div><p>
+ </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>The install step may require superuser privileges.</p></div></div><div class="section" title="Install Hierarchy"><div class="titlepage"><div><div><h3 class="title"><a name="id1168230328622"></a>Install Hierarchy</h3></div></div></div><p>
The following is the layout of the complete BIND 10 installation:
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">
<code class="filename">bin/</code> —
@@ -475,7 +467,7 @@
the details and relays (over a <span class="command"><strong>b10-msgq</strong></span> command
channel) the configuration on to the specified module.
</p><p>
- </p></div><div class="chapter" title="Chapter 8. Authoritative Server"><div class="titlepage"><div><div><h2 class="title"><a name="authserver"></a>Chapter 8. Authoritative Server</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="section"><a href="#id1168230329208">Server Configurations</a></span></dt><dt><span class="section"><a href="#id1168230329273">Data Source Backends</a></span></dt><dt><span class="section"><a href="#id1168230329303">Loading Master Zones Files</a></span></dt></dl></div><p>
+ </p></div><div class="chapter" title="Chapter 8. Authoritative Server"><div class="titlepage"><div><div><h2 class="title"><a name="authserver"></a>Chapter 8. Authoritative Server</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="section"><a href="#id1168230329190">Server Configurations</a></span></dt><dt><span class="section"><a href="#id1168230329255">Data Source Backends</a></span></dt><dt><span class="section"><a href="#id1168230329285">Loading Master Zones Files</a></span></dt></dl></div><p>
The <span class="command"><strong>b10-auth</strong></span> is the authoritative DNS server.
It supports EDNS0 and DNSSEC. It supports IPv6.
Normally it is started by the <span class="command"><strong>bind10</strong></span> master
@@ -483,7 +475,7 @@
</p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
This development prototype release listens on all interfaces
and the non-standard port 5300.
- </p></div><div class="section" title="Server Configurations"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id1168230329208"></a>Server Configurations</h2></div></div></div><p>
+ </p></div><div class="section" title="Server Configurations"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id1168230329190"></a>Server Configurations</h2></div></div></div><p>
<span class="command"><strong>b10-auth</strong></span> is configured via the
<span class="command"><strong>b10-cfgmgr</strong></span> configuration manager.
The module name is <span class="quote">“<span class="quote">Auth</span>”</span>.
@@ -503,7 +495,7 @@
</p><div class="variablelist"><dl><dt><span class="term">shutdown</span></dt><dd>Stop the authoritative DNS server.
</dd></dl></div><p>
- </p></div><div class="section" title="Data Source Backends"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id1168230329273"></a>Data Source Backends</h2></div></div></div><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
+ </p></div><div class="section" title="Data Source Backends"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id1168230329255"></a>Data Source Backends</h2></div></div></div><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
For the development prototype release, <span class="command"><strong>b10-auth</strong></span>
only supports the SQLite3 data source backend.
Upcoming versions will be able to use multiple different
@@ -516,7 +508,7 @@
The default is <code class="filename">/usr/local/var/</code>.)
This data file location may be changed by defining the
<span class="quote">“<span class="quote">database_file</span>”</span> configuration.
- </p></div><div class="section" title="Loading Master Zones Files"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id1168230329303"></a>Loading Master Zones Files</h2></div></div></div><p>
+ </p></div><div class="section" title="Loading Master Zones Files"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id1168230329285"></a>Loading Master Zones Files</h2></div></div></div><p>
RFC 1035 style DNS master zone files may imported
into a BIND 10 data source by using the
<span class="command"><strong>b10-loadzone</strong></span> utility.
Modified: branches/trac289/doc/guide/bind10-guide.xml
==============================================================================
--- branches/trac289/doc/guide/bind10-guide.xml (original)
+++ branches/trac289/doc/guide/bind10-guide.xml Mon Aug 16 05:23:39 2010
@@ -75,9 +75,8 @@
data source backend is SQLite3. The authoritative server
requires SQLite 3.3.9 or newer.
The <command>b10-xfrin</command> and <command>b10-xfrout</command>
- modules require the libboost library,
- libpython3 library,
- and the Python _sqlite3.so module.
+ modules require the libpython3 library and the Python
+ _sqlite3.so module.
</para></note>
<!-- TODO: this will change ... -->
@@ -272,9 +271,8 @@
</para>
<para>
- The Boost Library, Python Library,
- and Python _sqlite3 module are required to enable the
- Xfrout and Xfrin support.
+ The Python Library and Python _sqlite3 module are required to
+ enable the Xfrout and Xfrin support.
</para>
<note><simpara>
@@ -487,14 +485,6 @@
</varlistentry>
<varlistentry>
- <term>--with-boost-lib</term>
- <listitem>
- <simpara>Define the path to find the Boost library.
- </simpara>
- </listitem>
- </varlistentry>
-
- <varlistentry>
<term>--with-pythonpath</term>
<listitem>
<simpara>Define the path to Python 3.1 if it is not in the
@@ -520,10 +510,10 @@
<para>
For example, the following configures it to
- find the Boost headers and library, find the
+ find the Boost headers, find the
Python interpreter, and sets the installation location:
- <screen>$ <userinput>./configure --with-boost-lib=/usr/pkg/lib \
+ <screen>$ <userinput>./configure \
--with-boost-include=/usr/pkg/include \
--with-pythonpath=/usr/pkg/bin/python3.1 \
--prefix=/opt/bind10</userinput></screen>
@@ -556,14 +546,6 @@
<note>
<para>The install step may require superuser privileges.</para>
</note>
-
-<!-- Trac #148 -->
- <note><simpara>
- Depending on your system and the location of your Boost
- Python and Python shared libraries, you may need to
- configure your run-time linker to find them (such as
- setting LD_LIBRARY_PATH).
- </simpara></note>
</section>
Modified: branches/trac289/src/bin/auth/Makefile.am
==============================================================================
--- branches/trac289/src/bin/auth/Makefile.am (original)
+++ branches/trac289/src/bin/auth/Makefile.am Mon Aug 16 05:23:39 2010
@@ -7,6 +7,10 @@
AM_CPPFLAGS += -I$(top_srcdir)/src/bin -I$(top_builddir)/src/bin
AM_CXXFLAGS = $(B10_CXXFLAGS)
+
+if USE_STATIC_LINK
+AM_LDFLAGS = -static
+endif
pkglibexecdir = $(libexecdir)/@PACKAGE@
@@ -47,15 +51,16 @@
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
-b10_auth_LDADD += $(top_builddir)/src/lib/dns/.libs/libdns++.a
-b10_auth_LDADD += $(top_builddir)/src/lib/config/.libs/libcfgclient.a
-b10_auth_LDADD += $(top_builddir)/src/lib/cc/.libs/libcc.a
-b10_auth_LDADD += $(top_builddir)/src/lib/exceptions/.libs/libexceptions.a
+b10_auth_LDADD = $(top_builddir)/src/lib/datasrc/libdatasrc.la
+b10_auth_LDADD += $(top_builddir)/src/lib/dns/libdns++.la
+b10_auth_LDADD += $(top_builddir)/src/lib/config/libcfgclient.la
+b10_auth_LDADD += $(top_builddir)/src/lib/cc/libcc.la
+b10_auth_LDADD += $(top_builddir)/src/lib/exceptions/libexceptions.la
b10_auth_LDADD += $(top_builddir)/src/bin/auth/libasio_link.a
-b10_auth_LDADD += $(top_builddir)/src/lib/xfr/.libs/libxfr.a
+b10_auth_LDADD += $(top_builddir)/src/lib/xfr/libxfr.la
b10_auth_LDADD += $(SQLITE_LIBS)
# TODO: config.h.in is wrong because doesn't honor pkgdatadir
Modified: branches/trac289/src/bin/auth/asio_link.cc
==============================================================================
--- branches/trac289/src/bin/auth/asio_link.cc (original)
+++ branches/trac289/src/bin/auth/asio_link.cc Mon Aug 16 05:23:39 2010
@@ -368,6 +368,7 @@
dns_message_(Message::PARSE),
custom_callback_(NULL)
{
+ socket_.set_option(socket_base::reuse_address(true));
// Set v6-only (we use a different instantiation for v4,
// otherwise asio will bind to both v4 and v6
if (addr.is_v6()) {
Modified: branches/trac289/src/bin/auth/auth_srv.cc
==============================================================================
--- branches/trac289/src/bin/auth/auth_srv.cc (original)
+++ branches/trac289/src/bin/auth/auth_srv.cc Mon Aug 16 05:23:39 2010
@@ -342,10 +342,8 @@
}
try {
- if (!xfrout_connected_) {
- xfrout_client_.connect();
- xfrout_connected_ = true;
- }
+ xfrout_client_.connect();
+ xfrout_connected_ = true;
xfrout_client_.sendXfroutRequestInfo(
io_message.getSocket().getNative(),
io_message.getData(),
@@ -368,6 +366,10 @@
verbose_mode_);
return (true);
}
+
+ xfrout_client_.disconnect();
+ xfrout_connected_ = false;
+
return (false);
}
Modified: branches/trac289/src/bin/auth/b10-auth.8
==============================================================================
--- branches/trac289/src/bin/auth/b10-auth.8 (original)
+++ branches/trac289/src/bin/auth/b10-auth.8 Mon Aug 16 05:23:39 2010
@@ -2,12 +2,12 @@
.\" Title: b10-auth
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
-.\" Date: March 16, 2010
+.\" Date: July 29, 2010
.\" Manual: BIND10
.\" Source: BIND10
.\" Language: English
.\"
-.TH "B10\-AUTH" "8" "March 16, 2010" "BIND10" "BIND10"
+.TH "B10\-AUTH" "8" "July 29, 2010" "BIND10" "BIND10"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
@@ -22,7 +22,7 @@
b10-auth \- Authoritative DNS server
.SH "SYNOPSIS"
.HP \w'\fBb10\-auth\fR\ 'u
-\fBb10\-auth\fR [\fB\-4\fR] [\fB\-6\fR] [\fB\-p\ \fR\fB\fInumber\fR\fR] [\fB\-v\fR]
+\fBb10\-auth\fR [\fB\-4\fR] [\fB\-6\fR] [\fB\-a\ \fR\fB\fIaddress\fR\fR] [\fB\-n\fR] [\fB\-p\ \fR\fB\fInumber\fR\fR] [\fB\-u\ \fR\fB\fIusername\fR\fR] [\fB\-v\fR]
.SH "DESCRIPTION"
.PP
The
@@ -64,13 +64,30 @@
\fB\-4\fR
.RS 4
Enables IPv4 only mode\&. This switch may not be used with
-\fB\-6\fR\&. By default, it listens on both IPv4 and IPv6 (if capable)\&.
+\fB\-6\fR
+nor
+\fB\-a\fR\&. By default, it listens on both IPv4 and IPv6 (if capable)\&.
.RE
.PP
\fB\-6\fR
.RS 4
Enables IPv6 only mode\&. This switch may not be used with
-\fB\-4\fR\&. By default, it listens on both IPv4 and IPv6 (if capable)\&.
+\fB\-4\fR
+nor
+\fB\-a\fR\&. By default, it listens on both IPv4 and IPv6 (if capable)\&.
+.RE
+.PP
+\fB\-a \fR\fB\fIaddress\fR\fR
+.RS 4
+The IPv4 or IPv6 address to listen on\&. This switch may not be used with
+\fB\-4\fR
+nor
+\fB\-6\fR\&. The default is to listen on all addresses\&. (This is a short term workaround\&. This argument may change\&.)
+.RE
+.PP
+\fB\-n\fR
+.RS 4
+Do not cache answers in memory\&. The default is to use the cache for faster responses\&. The cache keeps the most recent 30,000 answers (positive and negative) in memory for 30 seconds (instead of querying the data source, such as SQLite3 database, each time)\&.
.RE
.PP
\fB\-p \fR\fB\fInumber\fR\fR
@@ -91,6 +108,15 @@
The Y1 prototype runs on all interfaces and on this nonstandard port\&.
.sp .5v
.RE
+.RE
+.PP
+\fB\-u \fR\fB\fIusername\fR\fR
+.RS 4
+The user name of the
+\fBb10\-auth\fR
+daemon\&. If specified, the daemon changes the process owner to the specified user\&. The
+\fIusername\fR
+must be either a valid numeric user ID or a valid user name\&. By default the daemon runs as the user who invokes it\&.
.RE
.PP
\fB\-v\fR
Modified: branches/trac289/src/bin/auth/b10-auth.xml
==============================================================================
--- branches/trac289/src/bin/auth/b10-auth.xml (original)
+++ branches/trac289/src/bin/auth/b10-auth.xml Mon Aug 16 05:23:39 2010
@@ -21,7 +21,7 @@
<refentry>
<refentryinfo>
- <date>March 16, 2010</date>
+ <date>July 29, 2010</date>
</refentryinfo>
<refmeta>
@@ -47,7 +47,10 @@
<command>b10-auth</command>
<arg><option>-4</option></arg>
<arg><option>-6</option></arg>
+ <arg><option>-a <replaceable>address</replaceable></option></arg>
+ <arg><option>-n</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>
@@ -95,7 +98,8 @@
<term><option>-4</option></term>
<listitem><para>
Enables IPv4 only mode.
- This switch may not be used with <option>-6</option>.
+ This switch may not be used with <option>-6</option> nor
+ <option>-a</option>.
By default, it listens on both IPv4 and IPv6 (if capable).
</para></listitem>
</varlistentry>
@@ -104,8 +108,33 @@
<term><option>-6</option></term>
<listitem><para>
Enables IPv6 only mode.
- This switch may not be used with <option>-4</option>.
+ This switch may not be used with <option>-4</option> nor
+ <option>-a</option>.
By default, it listens on both IPv4 and IPv6 (if capable).
+ </para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-a <replaceable>address</replaceable></option></term>
+
+ <listitem>
+ <para>The IPv4 or IPv6 address to listen on.
+ This switch may not be used with <option>-4</option> nor
+ <option>-6</option>.
+ The default is to listen on all addresses.
+ (This is a short term workaround. This argument may change.)
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-n</option></term>
+ <listitem><para>
+ Do not cache answers in memory.
+ The default is to use the cache for faster responses.
+ The cache keeps the most recent 30,000 answers (positive
+ and negative) in memory for 30 seconds (instead of querying
+ the data source, such as SQLite3 database, each time).
</para></listitem>
</varlistentry>
@@ -120,6 +149,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/trac289/src/bin/auth/main.cc
==============================================================================
--- branches/trac289/src/bin/auth/main.cc (original)
+++ branches/trac289/src/bin/auth/main.cc Mon Aug 16 05:23:39 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,
@@ -121,6 +123,9 @@
case 'p':
port = optarg;
break;
+ case 'u':
+ uid = optarg;
+ break;
case 'v':
verbose_mode = true;
break;
@@ -151,7 +156,13 @@
Session* xfrin_session = NULL;
bool xfrin_session_established = false; // XXX (see Trac #287)
ModuleCCSession* config_session = NULL;
- XfroutClient xfrout_client(UNIX_SOCKET_FILE);
+ string xfrout_socket_path;
+ if (getenv("B10_FROM_BUILD") != NULL) {
+ xfrout_socket_path = string(getenv("B10_FROM_BUILD")) + "/auth_xfrout_conn";
+ } else {
+ xfrout_socket_path = UNIX_SOCKET_FILE;
+ }
+ XfroutClient xfrout_client(xfrout_socket_path);
try {
string specfile;
if (getenv("B10_FROM_BUILD")) {
@@ -188,6 +199,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/trac289/src/bin/auth/tests/Makefile.am
==============================================================================
--- branches/trac289/src/bin/auth/tests/Makefile.am (original)
+++ branches/trac289/src/bin/auth/tests/Makefile.am Mon Aug 16 05:23:39 2010
@@ -4,6 +4,10 @@
AM_CPPFLAGS += -DTEST_DATA_DIR=\"$(srcdir)/testdata\"
AM_CXXFLAGS = $(B10_CXXFLAGS)
+
+if USE_STATIC_LINK
+AM_LDFLAGS = -static
+endif
CLEANFILES = *.gcno *.gcda
@@ -13,20 +17,22 @@
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)
run_unittests_LDFLAGS = $(AM_LDFLAGS) $(GTEST_LDFLAGS)
run_unittests_LDADD = $(GTEST_LDADD)
run_unittests_LDADD += $(SQLITE_LIBS)
-run_unittests_LDADD += $(top_builddir)/src/lib/datasrc/.libs/libdatasrc.a
-run_unittests_LDADD += $(top_builddir)/src/lib/dns/.libs/libdns++.a
-run_unittests_LDADD += $(top_builddir)/src/lib/config/.libs/libcfgclient.a
-run_unittests_LDADD += $(top_builddir)/src/lib/cc/.libs/libcc.a
-run_unittests_LDADD += $(top_builddir)/src/lib/exceptions/.libs/libexceptions.a
+run_unittests_LDADD += $(top_builddir)/src/lib/datasrc/libdatasrc.la
+run_unittests_LDADD += $(top_builddir)/src/lib/dns/libdns++.la
+run_unittests_LDADD += $(top_builddir)/src/lib/config/libcfgclient.la
+run_unittests_LDADD += $(top_builddir)/src/lib/cc/libcc.la
+run_unittests_LDADD += $(top_builddir)/src/lib/exceptions/libexceptions.la
run_unittests_LDADD += $(top_builddir)/src/bin/auth/libasio_link.a
-run_unittests_LDADD += $(top_builddir)/src/lib/xfr/.libs/libxfr.a
+run_unittests_LDADD += $(top_builddir)/src/lib/xfr/libxfr.la
endif
noinst_PROGRAMS = $(TESTS)
Modified: branches/trac289/src/bin/auth/tests/asio_link_unittest.cc
==============================================================================
--- branches/trac289/src/bin/auth/tests/asio_link_unittest.cc (original)
+++ branches/trac289/src/bin/auth/tests/asio_link_unittest.cc Mon Aug 16 05:23:39 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/trac289/src/bin/auth/tests/auth_srv_unittest.cc
==============================================================================
--- branches/trac289/src/bin/auth/tests/auth_srv_unittest.cc (original)
+++ branches/trac289/src/bin/auth/tests/auth_srv_unittest.cc Mon Aug 16 05:23:39 2010
@@ -469,7 +469,7 @@
// so we shouldn't have to respond.
EXPECT_EQ(false, server.processMessage(*io_message, parse_message,
response_renderer));
- EXPECT_TRUE(xfrout.isConnected());
+ EXPECT_FALSE(xfrout.isConnected());
}
TEST_F(AuthSrvTest, AXFRConnectFail) {
@@ -481,6 +481,8 @@
response_renderer));
headerCheck(parse_message, default_qid, Rcode::SERVFAIL(),
opcode.getCode(), QR_FLAG, 1, 0, 0, 0);
+ // For a shot term workaround with xfrout we currently close the connection
+ // for each AXFR attempt
EXPECT_FALSE(xfrout.isConnected());
}
@@ -490,7 +492,7 @@
createRequestPacket(opcode, Name("example.com"), RRClass::IN(),
RRType::AXFR(), IPPROTO_TCP);
server.processMessage(*io_message, parse_message, response_renderer);
- EXPECT_TRUE(xfrout.isConnected());
+ EXPECT_FALSE(xfrout.isConnected()); // see above
xfrout.disableSend();
parse_message.clear(Message::PARSE);
Modified: branches/trac289/src/bin/bind10/bind10.8
==============================================================================
--- branches/trac289/src/bin/bind10/bind10.8 (original)
+++ branches/trac289/src/bin/bind10/bind10.8 Mon Aug 16 05:23:39 2010
@@ -2,12 +2,12 @@
.\" Title: bind10
.\" Author: [see the "AUTHORS" section]
.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
-.\" Date: April 19, 2010
+.\" Date: July 29, 2010
.\" Manual: BIND10
.\" Source: BIND10
.\" Language: English
.\"
-.TH "BIND10" "8" "April 19, 2010" "BIND10" "BIND10"
+.TH "BIND10" "8" "July 29, 2010" "BIND10" "BIND10"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
@@ -22,7 +22,7 @@
bind10 \- BIND 10 boss process
.SH "SYNOPSIS"
.HP \w'\fBbind10\fR\ 'u
-\fBbind10\fR [\fB\-m\ \fR\fB\fInumber\fR\fR] [\fB\-p\ \fR\fB\fInumber\fR\fR] [\fB\-v\fR] [\fB\-msgq\-port\ \fR\fB\fInumber\fR\fR] [\fB\-port\ \fR\fB\fInumber\fR\fR] [\fB\-verbose\fR]
+\fBbind10\fR [\fB\-a\ \fR\fB\fIaddress\fR\fR] [\fB\-m\ \fR\fB\fIfile\fR\fR] [\fB\-n\fR] [\fB\-p\ \fR\fB\fInumber\fR\fR] [\fB\-u\ \fR\fB\fIuser\fR\fR] [\fB\-v\fR] [\fB\-\-address\ \fR\fB\fIaddress\fR\fR] [\fB\-\-msgq\-socket\-file\ \fR\fB\fIfile\fR\fR] [\fB\-\-no\-cache\fR] [\fB\-\-port\ \fR\fB\fInumber\fR\fR] [\fB\-\-user\ \fR\fB\fIuser\fR\fR] [\fB\-\-verbose\fR]
.SH "DESCRIPTION"
.PP
The
@@ -32,11 +32,26 @@
.PP
The arguments are as follows:
.PP
-\fB\-m\fR \fInumber\fR, \fB\-\-msgq\-port\fR \fInumber\fR
+\fB\-a\fR \fIaddress\fR, \fB\-\-address\fR \fIaddress\fR
.RS 4
-The port number for the
+The IPv4 or IPv6 address for the
+\fBb10-auth\fR(8)
+daemon to listen on\&. The default is to listen on all addresses\&. (This is a short term workaround\&. This argument may change\&.)
+.RE
+.PP
+\fB\-m\fR \fIfile\fR, \fB\-\-msgq\-socket\-file\fR \fIfile\fR
+.RS 4
+The UNIX domain socket file for the
\fBb10-msgq\fR(8)
-daemon to listen on\&. The default is 9912\&.
+daemon to use\&. The default is
+/usr/local/var/bind10\-devel/msg_socket\&.
+.RE
+.PP
+\fB\-n\fR, \fB\-\-no\-cache\fR
+.RS 4
+Disables the hot\-spot caching used by the
+\fBb10-auth\fR(8)
+daemon\&.
.RE
.PP
\fB\-p\fR \fInumber\fR, \fB\-\-port\fR \fInumber\fR
@@ -59,6 +74,16 @@
The Y1 prototype release uses a non\-default port for domain service\&.
.sp .5v
.RE
+.RE
+.PP
+\fB\-u\fR \fIuser\fR, \fB\-\-user\fR \fIname\fR
+.RS 4
+The username for
+\fBbind10\fR
+to run as\&.
+
+\fBbind10\fR
+must be initially ran as the root user to use this option\&. The default is to run as the current user\&.
.RE
.PP
\fB\-v\fR, \fB\-\-verbose\fR
Modified: branches/trac289/src/bin/bind10/bind10.py.in
==============================================================================
--- branches/trac289/src/bin/bind10/bind10.py.in (original)
+++ branches/trac289/src/bin/bind10/bind10.py.in Mon Aug 16 05:23:39 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/trac289/src/bin/bind10/bind10.xml
==============================================================================
--- branches/trac289/src/bin/bind10/bind10.xml (original)
+++ branches/trac289/src/bin/bind10/bind10.xml Mon Aug 16 05:23:39 2010
@@ -21,7 +21,7 @@
<refentry>
<refentryinfo>
- <date>April 19, 2010</date>
+ <date>July 29, 2010</date>
</refentryinfo>
<refmeta>
@@ -45,12 +45,18 @@
<refsynopsisdiv>
<cmdsynopsis>
<command>bind10</command>
- <arg><option>-m <replaceable>number</replaceable></option></arg>
+ <arg><option>-a <replaceable>address</replaceable></option></arg>
+ <arg><option>-m <replaceable>file</replaceable></option></arg>
+ <arg><option>-n</option></arg>
<arg><option>-p <replaceable>number</replaceable></option></arg>
+ <arg><option>-u <replaceable>user</replaceable></option></arg>
<arg><option>-v</option></arg>
- <arg><option>-msgq-port <replaceable>number</replaceable></option></arg>
- <arg><option>-port <replaceable>number</replaceable></option></arg>
- <arg><option>-verbose</option></arg>
+ <arg><option>--address <replaceable>address</replaceable></option></arg>
+ <arg><option>--msgq-socket-file <replaceable>file</replaceable></option></arg>
+ <arg><option>--no-cache</option></arg>
+ <arg><option>--port <replaceable>number</replaceable></option></arg>
+ <arg><option>--user <replaceable>user</replaceable></option></arg>
+ <arg><option>--verbose</option></arg>
</cmdsynopsis>
</refsynopsisdiv>
@@ -80,14 +86,40 @@
<variablelist>
<varlistentry>
- <term><option>-m</option> <replaceable>number</replaceable>, <option>--msgq-port</option> <replaceable>number</replaceable></term>
-
- <listitem>
- <para>The port number for the
+ <term><option>-a</option> <replaceable>address</replaceable>, <option>--address</option> <replaceable>address</replaceable></term>
+
+ <listitem>
+ <para>The IPv4 or IPv6 address for the
+ <citerefentry><refentrytitle>b10-auth</refentrytitle><manvolnum>8</manvolnum></citerefentry>
+ daemon to listen on.
+ The default is to listen on all addresses.
+ (This is a short term workaround. This argument may change.)
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-m</option> <replaceable>file</replaceable>,
+ <option>--msgq-socket-file</option> <replaceable>file</replaceable></term>
+
+ <listitem>
+ <para>The UNIX domain socket file for the
<citerefentry><refentrytitle>b10-msgq</refentrytitle><manvolnum>8</manvolnum></citerefentry>
- daemon to listen on.
- The default is 9912.</para>
- </listitem>
+ daemon to use.
+ The default is
+ <filename>/usr/local/var/bind10-devel/msg_socket</filename>.
+<!-- @localstatedir@/@PACKAGE_NAME@/msg_socket -->
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-n</option>, <option>--no-cache</option></term>
+ <listitem>
+ <para>Disables the hot-spot caching used by the
+ <citerefentry><refentrytitle>b10-auth</refentrytitle><manvolnum>8</manvolnum></citerefentry>
+ daemon.</para>
+ </listitem>
</varlistentry>
<varlistentry>
@@ -105,6 +137,18 @@
</varlistentry>
<varlistentry>
+ <term><option>-u</option> <replaceable>user</replaceable>, <option>--user</option> <replaceable>name</replaceable></term>
+
+ <listitem>
+ <para>The username for <command>bind10</command> to run as.
+<!-- TODO: example more detail. -->
+ <command>bind10</command> must be initially ran as the
+ root user to use this option.
+ The default is to run as the current user.</para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
<term><option>-v</option>, <option>--verbose</option></term>
<listitem>
<para>Display more about what is going on for
@@ -112,6 +156,7 @@
<!-- TODO: not true about all children yet -->
</listitem>
</varlistentry>
+
</variablelist>
</refsect1>
Modified: branches/trac289/src/bin/bindctl/bindcmd.py
==============================================================================
--- branches/trac289/src/bin/bindctl/bindcmd.py (original)
+++ branches/trac289/src/bin/bindctl/bindcmd.py Mon Aug 16 05:23:39 2010
@@ -38,7 +38,6 @@
import json
import pwd
import getpass
-import traceback
try:
from collections import OrderedDict
@@ -123,7 +122,6 @@
except FailToLogin as err:
print(err)
print(FAIL_TO_CONNECT_WITH_CMDCTL)
- traceback.print_exc()
except KeyboardInterrupt:
print('\nExit from bindctl')
@@ -142,8 +140,8 @@
users_info = csv.reader(csvfile)
for row in users_info:
users.append([row[0], row[1]])
- except (IOError, IndexError) as e:
- pass
+ except (IOError, IndexError) as err:
+ print("Error reading saved username and password from %s%s: %s" % (dir, file_name, err))
finally:
if csvfile:
csvfile.close()
@@ -162,8 +160,9 @@
writer = csv.writer(csvfile)
writer.writerow([username, passwd])
csvfile.close()
- except Exception as e:
- print(e, "\nCannot write %s%s; default user is not stored" % (dir, file_name))
+ except IOError as err:
+ print("Error saving user information:", err)
+ print("user info file name: %s%s" % (dir, file_name))
return False
return True
@@ -183,8 +182,8 @@
try:
response = self.send_POST('/login', param)
data = response.read().decode()
- except socket.error:
- traceback.print_exc()
+ except socket.error as err:
+ print("Socket error while sending login information:", err)
raise FailToLogin()
if response.status == http.client.OK:
@@ -206,8 +205,8 @@
response = self.send_POST('/login', param)
data = response.read().decode()
print(data)
- except socket.error as e:
- traceback.print_exc()
+ except socket.error as err:
+ print("Socket error while sending login information:", err)
raise FailToLogin()
if response.status == http.client.OK:
@@ -543,6 +542,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/trac289/src/bin/bindctl/tests/bindctl_test.py
==============================================================================
--- branches/trac289/src/bin/bindctl/tests/bindctl_test.py (original)
+++ branches/trac289/src/bin/bindctl/tests/bindctl_test.py Mon Aug 16 05:23:39 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/trac289/src/bin/cfgmgr/b10-cfgmgr.py.in
==============================================================================
--- branches/trac289/src/bin/cfgmgr/b10-cfgmgr.py.in (original)
+++ branches/trac289/src/bin/cfgmgr/b10-cfgmgr.py.in Mon Aug 16 05:23:39 2010
@@ -19,7 +19,7 @@
import sys; sys.path.append ('@@PYTHONPATH@@')
-from isc.config.cfgmgr import ConfigManager
+from isc.config.cfgmgr import ConfigManager, ConfigManagerDataReadError
from isc.cc import SessionError
import signal
import os
@@ -52,10 +52,15 @@
except SessionError as se:
print("[b10-cfgmgr] Error creating config manager, "
"is the command channel daemon running?")
+ return 1
except KeyboardInterrupt as kie:
print("[b10-cfgmgr] Interrupted, exiting")
+ except ConfigManagerDataReadError as cmdre:
+ print("[b10-cfgmgr] " + str(cmdre))
+ return 2
if cm:
- cm.write_config()
+ return cm.write_config()
+ return 0
if __name__ == "__main__":
- main()
+ sys.exit(main())
Modified: branches/trac289/src/bin/host/Makefile.am
==============================================================================
--- branches/trac289/src/bin/host/Makefile.am (original)
+++ branches/trac289/src/bin/host/Makefile.am Mon Aug 16 05:23:39 2010
@@ -3,12 +3,16 @@
AM_CXXFLAGS = $(B10_CXXFLAGS)
+if USE_STATIC_LINK
+AM_LDFLAGS = -static
+endif
+
CLEANFILES = *.gcno *.gcda
bin_PROGRAMS = host
host_SOURCES = host.cc
-host_LDADD = $(top_builddir)/src/lib/dns/.libs/libdns++.a
-host_LDADD += $(top_builddir)/src/lib/exceptions/.libs/libexceptions.a
+host_LDADD = $(top_builddir)/src/lib/dns/libdns++.la
+host_LDADD += $(top_builddir)/src/lib/exceptions/libexceptions.la
#man_MANS = host.1
#EXTRA_DIST = $(man_MANS) host.xml
Modified: branches/trac289/src/bin/msgq/b10-msgq.8
==============================================================================
--- branches/trac289/src/bin/msgq/b10-msgq.8 (original)
+++ branches/trac289/src/bin/msgq/b10-msgq.8 Mon Aug 16 05:23:39 2010
@@ -2,12 +2,12 @@
.\" Title: b10-msgq
.\" Author: [see the "AUTHORS" section]
.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
-.\" Date: April 19, 2010
+.\" Date: August 4, 2010
.\" Manual: BIND10
.\" Source: BIND10
.\" Language: English
.\"
-.TH "B10\-MSGQ" "8" "April 19, 2010" "BIND10" "BIND10"
+.TH "B10\-MSGQ" "8" "August 4, 2010" "BIND10" "BIND10"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
@@ -22,7 +22,7 @@
b10-msgq \- message routing daemon for the Command Channel
.SH "SYNOPSIS"
.HP \w'\fBb10\-msgq\fR\ 'u
-\fBb10\-msgq\fR [\fB\-m\ \fR\fB\fInumber\fR\fR] [\fB\-v\fR] [\fB\-\-msgq\-port\ \fR\fB\fInumber\fR\fR] [\fB\-\-verbose\fR]
+\fBb10\-msgq\fR [\fB\-s\ \fR\fB\fIfile\fR\fR] [\fB\-v\fR] [\fB\-\-socket\-file\ \fR\fB\fIfile\fR\fR] [\fB\-\-verbose\fR]
.SH "DESCRIPTION"
.PP
The
@@ -96,11 +96,10 @@
.PP
The arguments are as follows:
.PP
-\fB\-m \fR\fB\fInumber\fR\fR, \fB\-\-msgq\-port \fR\fB\fInumber\fR\fR
+\fB\-s \fR\fB\fIfile\fR\fR, \fB\-\-socket\-file \fR\fB\fIfile\fR\fR
.RS 4
-The port number that
-\fBb10\-msgq\fR
-will listen on\&. The default is 9912\&.
+The UNIX domain socket file this daemon will use\&. The default is
+/usr/local/var/bind10\-devel/msg_socket\&.
.RE
.PP
\fB\-v\fR, \fB\-\-verbose\fR
Modified: branches/trac289/src/bin/msgq/msgq.xml
==============================================================================
--- branches/trac289/src/bin/msgq/msgq.xml (original)
+++ branches/trac289/src/bin/msgq/msgq.xml Mon Aug 16 05:23:39 2010
@@ -21,7 +21,7 @@
<refentry>
<refentryinfo>
- <date>April 19, 2010</date>
+ <date>August 4, 2010</date>
</refentryinfo>
<refmeta>
@@ -45,9 +45,9 @@
<refsynopsisdiv>
<cmdsynopsis>
<command>b10-msgq</command>
- <arg><option>-m <replaceable>number</replaceable></option></arg>
+ <arg><option>-s <replaceable>file</replaceable></option></arg>
<arg><option>-v</option></arg>
- <arg><option>--msgq-port <replaceable>number</replaceable></option></arg>
+ <arg><option>--socket-file <replaceable>file</replaceable></option></arg>
<arg><option>--verbose</option></arg>
</cmdsynopsis>
</refsynopsisdiv>
@@ -111,12 +111,14 @@
<variablelist>
<varlistentry>
- <term><option>-m <replaceable>number</replaceable></option>,
- <option>--msgq-port <replaceable>number</replaceable></option></term>
+ <term><option>-s <replaceable>file</replaceable></option>,
+ <option>--socket-file <replaceable>file</replaceable></option></term>
<listitem><para>
- The port number that <command>b10-msgq</command> will listen on.
- The default is 9912.</para>
- </listitem>
+ The UNIX domain socket file this daemon will use.
+ The default is
+ <filename>/usr/local/var/bind10-devel/msg_socket</filename>.
+<!-- @localstatedir@/@PACKAGE_NAME@/msg_socket -->
+ </para></listitem>
</varlistentry>
<varlistentry>
Modified: branches/trac289/src/bin/usermgr/b10-cmdctl-usermgr.py.in
==============================================================================
--- branches/trac289/src/bin/usermgr/b10-cmdctl-usermgr.py.in (original)
+++ branches/trac289/src/bin/usermgr/b10-cmdctl-usermgr.py.in Mon Aug 16 05:23:39 2010
@@ -69,8 +69,8 @@
def main():
filename = DEFAULT_FILE
try:
- opts, args = getopt.getopt(sys.argv[1:], 'hvf:',
- ['help', 'file=', 'version='])
+ opts, args = getopt.getopt(sys.argv[1:], 'f:hv',
+ ['file=', 'help', 'version'])
except getopt.GetoptError as err:
print(err)
usage()
Modified: branches/trac289/src/bin/xfrin/tests/Makefile.am
==============================================================================
--- branches/trac289/src/bin/xfrin/tests/Makefile.am (original)
+++ branches/trac289/src/bin/xfrin/tests/Makefile.am Mon Aug 16 05:23:39 2010
@@ -7,6 +7,6 @@
check-local:
for pytest in $(PYTESTS) ; do \
echo Running test: $$pytest ; \
- env PYTHONPATH=$(abs_top_builddir)/src/lib/dns/.libs:$(abs_top_builddir)/src/lib/dns/python/.libs:$(abs_top_builddir)/src/bin/xfrin:$(abs_top_srcdir)/src/lib/python:$(abs_top_builddir)/src/lib/python \
+ env PYTHONPATH=$(abs_top_builddir)/src/lib/dns/python/.libs:$(abs_top_builddir)/src/bin/xfrin:$(abs_top_srcdir)/src/lib/python:$(abs_top_builddir)/src/lib/python \
$(PYCOVERAGE) $(abs_srcdir)/$$pytest ; \
done
Modified: branches/trac289/src/bin/xfrout/tests/Makefile.am
==============================================================================
--- branches/trac289/src/bin/xfrout/tests/Makefile.am (original)
+++ branches/trac289/src/bin/xfrout/tests/Makefile.am Mon Aug 16 05:23:39 2010
@@ -7,6 +7,6 @@
check-local:
for pytest in $(PYTESTS) ; do \
echo Running test: $$pytest ; \
- env PYTHONPATH=$(abs_top_builddir)/src/bin/xfrout:$(abs_top_srcdir)/src/lib/python:$(abs_top_builddir)/src/lib/python:$(abs_top_builddir)/src/lib/dns/.libs:$(abs_top_builddir)/src/lib/dns/python/.libs:$(abs_top_builddir)/src/lib/xfr/.libs \
+ env PYTHONPATH=$(abs_top_builddir)/src/bin/xfrout:$(abs_top_srcdir)/src/lib/python:$(abs_top_builddir)/src/lib/python:$(abs_top_builddir)/src/lib/dns/python/.libs:$(abs_top_builddir)/src/lib/xfr/.libs \
$(PYCOVERAGE) $(abs_srcdir)/$$pytest ; \
done
Modified: branches/trac289/src/lib/Makefile.am
==============================================================================
--- branches/trac289/src/lib/Makefile.am (original)
+++ branches/trac289/src/lib/Makefile.am Mon Aug 16 05:23:39 2010
@@ -1,1 +1,1 @@
-SUBDIRS = exceptions dns cc config datasrc python xfr
+SUBDIRS = exceptions dns cc config datasrc python xfr bench
Modified: branches/trac289/src/lib/cc/Makefile.am
==============================================================================
--- branches/trac289/src/lib/cc/Makefile.am (original)
+++ branches/trac289/src/lib/cc/Makefile.am Mon Aug 16 05:23:39 2010
@@ -1,3 +1,5 @@
+SUBDIRS = . tests
+
AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib
AM_CPPFLAGS += -I$(top_srcdir)/src/lib/dns -I$(top_builddir)/src/lib/dns
@@ -19,20 +21,3 @@
$(SED) -e "s|@@LOCALSTATEDIR@@|$(localstatedir)|" session_config.h.pre >$@
BUILT_SOURCES = session_config.h
-
-TESTS =
-if HAVE_GTEST
-TESTS += run_unittests
-# (TODO: these need to be completed and moved to tests/)
-run_unittests_SOURCES = data_unittests.cc session_unittests.cc run_unittests.cc
-run_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES)
-# TODO: remove PTHREAD_LDFLAGS (and from configure too)
-run_unittests_LDFLAGS = $(AM_LDFLAGS) $(GTEST_LDFLAGS) $(PTHREAD_LDFLAGS)
-
-run_unittests_LDADD = libcc.la $(GTEST_LDADD)
-run_unittests_LDADD += $(top_builddir)/src/lib/dns/.libs/libdns++.a
-run_unittests_LDADD += $(top_builddir)/src/lib/exceptions/.libs/libexceptions.a
-
-endif
-
-noinst_PROGRAMS = $(TESTS)
Modified: branches/trac289/src/lib/cc/session.cc
==============================================================================
--- branches/trac289/src/lib/cc/session.cc (original)
+++ branches/trac289/src/lib/cc/session.cc Mon Aug 16 05:23:39 2010
@@ -134,7 +134,7 @@
try {
asio::read(socket_, asio::buffer(data, datalen));
} catch (const asio::system_error& asio_ex) {
- // to hide boost specific exceptions, we catch them explicitly
+ // to hide ASIO specific exceptions, we catch them explicitly
// and convert it to SessionError.
isc_throw(SessionError, "ASIO read failed: " << asio_ex.what());
}
Modified: branches/trac289/src/lib/config/Makefile.am
==============================================================================
--- branches/trac289/src/lib/config/Makefile.am (original)
+++ branches/trac289/src/lib/config/Makefile.am Mon Aug 16 05:23:39 2010
@@ -15,6 +15,7 @@
EXTRA_DIST = testdata/b10-config-bad1.db
EXTRA_DIST += testdata/b10-config-bad2.db
EXTRA_DIST += testdata/b10-config-bad3.db
+EXTRA_DIST += testdata/b10-config-bad4.db
EXTRA_DIST += testdata/b10-config.db
EXTRA_DIST += testdata/data22_1.data
EXTRA_DIST += testdata/data22_2.data
Modified: branches/trac289/src/lib/config/testdata/b10-config-bad1.db
==============================================================================
--- branches/trac289/src/lib/config/testdata/b10-config-bad1.db (original)
+++ branches/trac289/src/lib/config/testdata/b10-config-bad1.db Mon Aug 16 05:23:39 2010
@@ -1,1 +1,1 @@
-{'version': 0}
+{"version": 0}
Modified: branches/trac289/src/lib/config/testdata/b10-config.db
==============================================================================
--- branches/trac289/src/lib/config/testdata/b10-config.db (original)
+++ branches/trac289/src/lib/config/testdata/b10-config.db Mon Aug 16 05:23:39 2010
@@ -1,1 +1,1 @@
-{"version": 1, "TestModule": {"test": 125}}
+{"version": 2, "TestModule": {"test": 125}}
Modified: branches/trac289/src/lib/config/tests/Makefile.am
==============================================================================
--- branches/trac289/src/lib/config/tests/Makefile.am (original)
+++ branches/trac289/src/lib/config/tests/Makefile.am Mon Aug 16 05:23:39 2010
@@ -4,6 +4,10 @@
# see src/lib/cc/Makefile.am for -Wno-unused-parameter
if USE_GXX
AM_CXXFLAGS += -Wno-unused-parameter
+endif
+
+if USE_STATIC_LINK
+AM_LDFLAGS = -static
endif
CLEANFILES = *.gcno *.gcda
Modified: branches/trac289/src/lib/datasrc/static_datasrc.cc
==============================================================================
--- branches/trac289/src/lib/datasrc/static_datasrc.cc (original)
+++ branches/trac289/src/lib/datasrc/static_datasrc.cc Mon Aug 16 05:23:39 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/trac289/src/lib/datasrc/tests/Makefile.am
==============================================================================
--- branches/trac289/src/lib/datasrc/tests/Makefile.am (original)
+++ branches/trac289/src/lib/datasrc/tests/Makefile.am Mon Aug 16 05:23:39 2010
@@ -3,6 +3,10 @@
AM_CPPFLAGS += -DTEST_DATA_DIR=\"$(srcdir)/testdata\"
AM_CXXFLAGS = $(B10_CXXFLAGS)
+
+if USE_STATIC_LINK
+AM_LDFLAGS = -static
+endif
CLEANFILES = *.gcno *.gcda
@@ -22,10 +26,10 @@
run_unittests_LDFLAGS = $(AM_LDFLAGS) $(GTEST_LDFLAGS)
run_unittests_LDADD = $(GTEST_LDADD)
run_unittests_LDADD += $(SQLITE_LIBS)
-run_unittests_LDADD += $(top_builddir)/src/lib/datasrc/.libs/libdatasrc.a
-run_unittests_LDADD += $(top_builddir)/src/lib/dns/.libs/libdns++.a
-run_unittests_LDADD += $(top_builddir)/src/lib/cc/.libs/libcc.a
-run_unittests_LDADD += $(top_builddir)/src/lib/exceptions/.libs/libexceptions.a
+run_unittests_LDADD += $(top_builddir)/src/lib/datasrc/libdatasrc.la
+run_unittests_LDADD += $(top_builddir)/src/lib/dns/libdns++.la
+run_unittests_LDADD += $(top_builddir)/src/lib/cc/libcc.la
+run_unittests_LDADD += $(top_builddir)/src/lib/exceptions/libexceptions.la
endif
noinst_PROGRAMS = $(TESTS)
Modified: branches/trac289/src/lib/datasrc/tests/datasrc_unittest.cc
==============================================================================
--- branches/trac289/src/lib/datasrc/tests/datasrc_unittest.cc (original)
+++ branches/trac289/src/lib/datasrc/tests/datasrc_unittest.cc Mon Aug 16 05:23:39 2010
@@ -1056,7 +1056,6 @@
EXPECT_EQ(&datasrc1, match.getDataSource());
}
-// This test currently fails.
TEST_F(DataSrcMatchTest, initialUpdateWithNoMatch) {
DataSrcMatch match(Name("www.example.com"), RRClass::IN());
Modified: branches/trac289/src/lib/datasrc/tests/static_unittest.cc
==============================================================================
--- branches/trac289/src/lib/datasrc/tests/static_unittest.cc (original)
+++ branches/trac289/src/lib/datasrc/tests/static_unittest.cc Mon Aug 16 05:23:39 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/trac289/src/lib/dns/message.h
==============================================================================
--- branches/trac289/src/lib/dns/message.h (original)
+++ branches/trac289/src/lib/dns/message.h Mon Aug 16 05:23:39 2010
@@ -80,7 +80,7 @@
class InputBuffer;
class MessageRenderer;
class Message;
-struct MessageImpl;
+class MessageImpl;
template <typename T>
struct SectionIteratorImpl;
Modified: branches/trac289/src/lib/dns/python/libdns_python.cc
==============================================================================
--- branches/trac289/src/lib/dns/python/libdns_python.cc (original)
+++ branches/trac289/src/lib/dns/python/libdns_python.cc Mon Aug 16 05:23:39 2010
@@ -22,6 +22,8 @@
// NULL/*mod
//
// And of course care has to be taken that all identifiers be unique
+
+// $Id$
#define PY_SSIZE_T_CLEAN
#include <Python.h>
Modified: branches/trac289/src/lib/dns/python/message_python.cc
==============================================================================
--- branches/trac289/src/lib/dns/python/message_python.cc (original)
+++ branches/trac289/src/lib/dns/python/message_python.cc Mon Aug 16 05:23:39 2010
@@ -12,7 +12,7 @@
// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE.
-// $Id: message_python.cc 1711 2010-04-14 15:14:53Z jelte $
+// $Id$
#include <dns/message.h>
using namespace isc::dns;
@@ -589,7 +589,7 @@
try {
self->rcode = new Rcode(code);
self->static_code = false;
- } catch (isc::OutOfRange) {
+ } catch (const isc::OutOfRange&) {
PyErr_SetString(PyExc_OverflowError,
"rcode out of range");
return (-1);
@@ -1221,7 +1221,7 @@
try {
self->message->setHeaderFlag(*messageflag->messageflag);
Py_RETURN_NONE;
- } catch (isc::dns::InvalidMessageOperation imo) {
+ } catch (const InvalidMessageOperation& imo) {
PyErr_Clear();
PyErr_SetString(po_InvalidMessageOperation, imo.what());
return (NULL);
@@ -1238,7 +1238,7 @@
try {
self->message->clearHeaderFlag(*messageflag->messageflag);
Py_RETURN_NONE;
- } catch (isc::dns::InvalidMessageOperation imo) {
+ } catch (const InvalidMessageOperation& imo) {
PyErr_Clear();
PyErr_SetString(po_InvalidMessageOperation, imo.what());
return (NULL);
@@ -1269,7 +1269,7 @@
self->message->setDNSSECSupported(false);
}
Py_RETURN_NONE;
- } catch (isc::dns::InvalidMessageOperation imo) {
+ } catch (const InvalidMessageOperation& imo) {
PyErr_SetString(po_InvalidMessageOperation, imo.what());
return (NULL);
}
@@ -1289,10 +1289,10 @@
try {
self->message->setUDPSize(size);
Py_RETURN_NONE;
- } catch (isc::dns::InvalidMessageUDPSize imus) {
+ } catch (const InvalidMessageUDPSize& imus) {
PyErr_SetString(po_InvalidMessageUDPSize, imus.what());
return (NULL);
- } catch (isc::dns::InvalidMessageOperation imo) {
+ } catch (const InvalidMessageOperation& imo) {
PyErr_SetString(po_InvalidMessageOperation, imo.what());
return (NULL);
}
@@ -1312,7 +1312,7 @@
try {
self->message->setQid(id);
Py_RETURN_NONE;
- } catch (InvalidMessageOperation imo) {
+ } catch (const InvalidMessageOperation& imo) {
PyErr_SetString(po_InvalidMessageOperation, imo.what());
return (NULL);
}
@@ -1344,7 +1344,7 @@
try {
self->message->setRcode(*rcode->rcode);
Py_RETURN_NONE;
- } catch (InvalidMessageOperation imo) {
+ } catch (const InvalidMessageOperation& imo) {
PyErr_SetString(po_InvalidMessageOperation, imo.what());
return (NULL);
}
@@ -1379,7 +1379,7 @@
try {
self->message->setOpcode(*opcode->opcode);
Py_RETURN_NONE;
- } catch (InvalidMessageOperation imo) {
+ } catch (const InvalidMessageOperation& imo) {
PyErr_SetString(po_InvalidMessageOperation, imo.what());
return (NULL);
}
@@ -1482,7 +1482,7 @@
self->message->addRRset(*section->section, rrset->rrset, false);
}
Py_RETURN_NONE;
- } catch (InvalidMessageOperation imo) {
+ } catch (const InvalidMessageOperation& imo) {
PyErr_SetString(po_InvalidMessageOperation, imo.what());
return (NULL);
}
@@ -1541,7 +1541,7 @@
// If we return NULL it is seen as an error, so use this for
// None returns
Py_RETURN_NONE;
- } catch (isc::dns::InvalidMessageOperation imo) {
+ } catch (const InvalidMessageOperation& imo) {
PyErr_Clear();
PyErr_SetString(po_InvalidMessageOperation, imo.what());
return (NULL);
@@ -1565,16 +1565,16 @@
try {
self->message->fromWire(inbuf);
Py_RETURN_NONE;
- } catch (isc::dns::InvalidMessageOperation imo) {
+ } catch (const InvalidMessageOperation& imo) {
PyErr_SetString(po_InvalidMessageOperation, imo.what());
return (NULL);
- } catch (isc::dns::DNSMessageFORMERR dmfe) {
+ } catch (const DNSMessageFORMERR& dmfe) {
PyErr_SetString(po_DNSMessageFORMERR, dmfe.what());
return (NULL);
- } catch (isc::dns::DNSMessageBADVERS dmfe) {
+ } catch (const DNSMessageBADVERS& dmfe) {
PyErr_SetString(po_DNSMessageBADVERS, dmfe.what());
return (NULL);
- } catch (isc::dns::MessageTooShort mts) {
+ } catch (const MessageTooShort& mts) {
PyErr_SetString(po_MessageTooShort, mts.what());
return (NULL);
}
Modified: branches/trac289/src/lib/dns/python/name_python.cc
==============================================================================
--- branches/trac289/src/lib/dns/python/name_python.cc (original)
+++ branches/trac289/src/lib/dns/python/name_python.cc Mon Aug 16 05:23:39 2010
@@ -291,26 +291,26 @@
self->name = new Name(n, downcase == Py_True);
self->position = 0;
- } catch (EmptyLabel) {
+ } catch (const EmptyLabel&) {
PyErr_SetString(po_EmptyLabel, "EmptyLabel");
return (-1);
- } catch (TooLongLabel) {
+ } catch (const TooLongLabel&) {
PyErr_SetString(po_TooLongLabel, "TooLongLabel");
return (-1);
- } catch (BadLabelType) {
+ } catch (const BadLabelType&) {
PyErr_SetString(po_BadLabelType, "BadLabelType");
return (-1);
- } catch (BadEscape) {
+ } catch (const BadEscape&) {
PyErr_SetString(po_BadEscape, "BadEscape");
return (-1);
- } catch (TooLongName) {
+ } catch (const TooLongName&) {
PyErr_SetString(po_TooLongName, "TooLongName");
return (-1);
- } catch (IncompleteName) {
+ } catch (const IncompleteName&) {
PyErr_SetString(po_IncompleteName, "IncompleteName");
return (-1);
#ifdef CATCHMEMERR
- } catch (std::bad_alloc) {
+ } catch (const std::bad_alloc&) {
PyErr_NoMemory();
return (-1);
#endif
@@ -338,11 +338,11 @@
buffer.setPosition(position);
self->name = new Name(buffer, downcase == Py_True);
self->position = buffer.getPosition();
- } catch (InvalidBufferPosition) {
+ } catch (const InvalidBufferPosition&) {
PyErr_SetString(po_InvalidBufferPosition,
"InvalidBufferPosition");
return (-1);
- } catch (DNSMessageFORMERR) {
+ } catch (const DNSMessageFORMERR&) {
PyErr_SetString(po_DNSMessageFORMERR, "DNSMessageFORMERR");
return (-1);
} catch (...) {
@@ -373,7 +373,7 @@
}
try {
return (Py_BuildValue("I", self->name->at(pos)));
- } catch (isc::OutOfRange oor) {
+ } catch (const isc::OutOfRange&) {
PyErr_SetString(PyExc_IndexError,
"name index out of range");
return (NULL);
@@ -472,7 +472,7 @@
ret->name = NULL;
try {
ret->name = new Name(self->name->split(first, n));
- } catch(isc::OutOfRange oor) {
+ } catch(const isc::OutOfRange& oor) {
PyErr_SetString(PyExc_IndexError, oor.what());
ret->name = NULL;
}
@@ -487,7 +487,7 @@
ret->name = NULL;
try {
ret->name = new Name(self->name->split(n));
- } catch(isc::OutOfRange oor) {
+ } catch(const isc::OutOfRange& oor) {
PyErr_SetString(PyExc_IndexError, oor.what());
ret->name = NULL;
}
@@ -572,7 +572,7 @@
if (ret != NULL) {
try {
ret->name = new Name(self->name->concatenate(*other->name));
- } catch (isc::dns::TooLongName tln) {
+ } catch (const TooLongName& tln) {
PyErr_SetString(po_TooLongName, tln.what());
return (NULL);
}
Modified: branches/trac289/src/lib/dns/python/question_python.cc
==============================================================================
--- branches/trac289/src/lib/dns/python/question_python.cc (original)
+++ branches/trac289/src/lib/dns/python/question_python.cc Mon Aug 16 05:23:39 2010
@@ -156,15 +156,15 @@
self->question = QuestionPtr(new Question(inbuf));
return (0);
}
- } catch (isc::dns::DNSMessageFORMERR dmfe) {
+ } catch (const DNSMessageFORMERR& dmfe) {
PyErr_Clear();
PyErr_SetString(po_DNSMessageFORMERR, dmfe.what());
return (-1);
- } catch (isc::dns::IncompleteRRClass irc) {
+ } catch (const IncompleteRRClass& irc) {
PyErr_Clear();
PyErr_SetString(po_IncompleteRRClass, irc.what());
return (-1);
- } catch (isc::dns::IncompleteRRType irt) {
+ } catch (const IncompleteRRType& irt) {
PyErr_Clear();
PyErr_SetString(po_IncompleteRRType, irt.what());
return (-1);
Modified: branches/trac289/src/lib/dns/python/rrclass_python.cc
==============================================================================
--- branches/trac289/src/lib/dns/python/rrclass_python.cc (original)
+++ branches/trac289/src/lib/dns/python/rrclass_python.cc Mon Aug 16 05:23:39 2010
@@ -188,7 +188,7 @@
}
// Incomplete is never thrown, a type error would have already been raised
//when we try to read the 2 bytes above
- } catch (InvalidRRClass ic) {
+ } catch (const InvalidRRClass& ic) {
PyErr_Clear();
PyErr_SetString(po_InvalidRRClass, ic.what());
return (-1);
Modified: branches/trac289/src/lib/dns/python/rrset_python.cc
==============================================================================
--- branches/trac289/src/lib/dns/python/rrset_python.cc (original)
+++ branches/trac289/src/lib/dns/python/rrset_python.cc Mon Aug 16 05:23:39 2010
@@ -284,7 +284,7 @@
RRset_toText(s_RRset* self) {
try {
return (Py_BuildValue("s", self->rrset->toText().c_str()));
- } catch (EmptyRRset ers) {
+ } catch (const EmptyRRset& ers) {
PyErr_SetString(po_EmptyRRset, ers.what());
return (NULL);
}
@@ -321,7 +321,7 @@
// None returns
Py_RETURN_NONE;
}
- } catch (EmptyRRset ers) {
+ } catch (const EmptyRRset& ers) {
PyErr_Clear();
PyErr_SetString(po_EmptyRRset, ers.what());
return (NULL);
@@ -341,7 +341,7 @@
try {
self->rrset->addRdata(*rdata->rdata);
Py_RETURN_NONE;
- } catch (std::bad_cast) {
+ } catch (const std::bad_cast&) {
PyErr_Clear();
PyErr_SetString(PyExc_TypeError,
"Rdata type to add must match type of RRset");
Modified: branches/trac289/src/lib/dns/python/rrttl_python.cc
==============================================================================
--- branches/trac289/src/lib/dns/python/rrttl_python.cc (original)
+++ branches/trac289/src/lib/dns/python/rrttl_python.cc Mon Aug 16 05:23:39 2010
@@ -177,7 +177,7 @@
PyErr_Clear();
return (0);
}
- } catch (IncompleteRRTTL icc) {
+ } catch (const IncompleteRRTTL& icc) {
// Ok so one of our functions has thrown a C++ exception.
// We need to translate that to a Python Exception
// First clear any existing error that was set
@@ -186,7 +186,7 @@
PyErr_SetString(po_IncompleteRRTTL, icc.what());
// And return negative
return (-1);
- } catch (InvalidRRTTL ic) {
+ } catch (const InvalidRRTTL& ic) {
PyErr_Clear();
PyErr_SetString(po_InvalidRRTTL, ic.what());
return (-1);
Modified: branches/trac289/src/lib/dns/python/rrtype_python.cc
==============================================================================
--- branches/trac289/src/lib/dns/python/rrtype_python.cc (original)
+++ branches/trac289/src/lib/dns/python/rrtype_python.cc Mon Aug 16 05:23:39 2010
@@ -217,7 +217,7 @@
PyErr_Clear();
return (0);
}
- } catch (IncompleteRRType icc) {
+ } catch (const IncompleteRRType& icc) {
// Ok so one of our functions has thrown a C++ exception.
// We need to translate that to a Python Exception
// First clear any existing error that was set
@@ -226,7 +226,7 @@
PyErr_SetString(po_IncompleteRRType, icc.what());
// And return negative
return (-1);
- } catch (InvalidRRType ic) {
+ } catch (const InvalidRRType& ic) {
PyErr_Clear();
PyErr_SetString(po_InvalidRRType, ic.what());
return (-1);
Modified: branches/trac289/src/lib/dns/rdata/generic/txt_16.cc
==============================================================================
--- branches/trac289/src/lib/dns/rdata/generic/txt_16.cc (original)
+++ branches/trac289/src/lib/dns/rdata/generic/txt_16.cc Mon Aug 16 05:23:39 2010
@@ -21,6 +21,7 @@
#include <vector>
#include <dns/buffer.h>
+#include <dns/exceptions.h>
#include <dns/messagerenderer.h>
#include <dns/rdata.h>
#include <dns/rdataclass.h>
Modified: branches/trac289/src/lib/dns/tests/Makefile.am
==============================================================================
--- branches/trac289/src/lib/dns/tests/Makefile.am (original)
+++ branches/trac289/src/lib/dns/tests/Makefile.am Mon Aug 16 05:23:39 2010
@@ -2,6 +2,10 @@
AM_CPPFLAGS += -I$(top_srcdir)/src/lib/dns -I$(top_builddir)/src/lib/dns
AM_CPPFLAGS += -DTEST_DATA_DIR=\"$(srcdir)/testdata\"
AM_CXXFLAGS = $(B10_CXXFLAGS)
+
+if USE_STATIC_LINK
+AM_LDFLAGS = -static
+endif
CLEANFILES = *.gcno *.gcda
@@ -40,8 +44,8 @@
run_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES)
run_unittests_LDFLAGS = $(AM_LDFLAGS) $(GTEST_LDFLAGS)
run_unittests_LDADD = $(GTEST_LDADD)
-run_unittests_LDADD += $(top_builddir)/src/lib/dns/.libs/libdns++.a
-run_unittests_LDADD += $(top_builddir)/src/lib/exceptions/.libs/libexceptions.a
+run_unittests_LDADD += $(top_builddir)/src/lib/dns/libdns++.la
+run_unittests_LDADD += $(top_builddir)/src/lib/exceptions/libexceptions.la
endif
noinst_PROGRAMS = $(TESTS)
Modified: branches/trac289/src/lib/exceptions/Makefile.am
==============================================================================
--- branches/trac289/src/lib/exceptions/Makefile.am (original)
+++ branches/trac289/src/lib/exceptions/Makefile.am Mon Aug 16 05:23:39 2010
@@ -1,3 +1,5 @@
+SUBDIRS = . tests
+
AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib
AM_CXXFLAGS=$(B10_CXXFLAGS)
@@ -6,17 +8,5 @@
CLEANFILES = *.gcno *.gcda
-TESTS =
-if HAVE_GTEST
-TESTS += run_unittests
-run_unittests_SOURCES = run_unittests.cc
-run_unittests_SOURCES += exceptions_unittest.cc
-run_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES)
-run_unittests_LDFLAGS = $(GTEST_LDFLAGS)
-run_unittests_LDADD = .libs/libexceptions.a $(GTEST_LDADD)
-endif
-
-noinst_PROGRAMS = $(TESTS)
-
libexceptions_includedir = $(includedir)/exceptions
libexceptions_include_HEADERS = exceptions.h
Modified: branches/trac289/src/lib/python/isc/config/ccsession.py
==============================================================================
--- branches/trac289/src/lib/python/isc/config/ccsession.py (original)
+++ branches/trac289/src/lib/python/isc/config/ccsession.py Mon Aug 16 05:23:39 2010
@@ -37,7 +37,7 @@
"""
from isc.cc import Session
-from isc.config.config_data import ConfigData, MultiConfigData
+from isc.config.config_data import ConfigData, MultiConfigData, BIND10_CONFIG_DATA_VERSION
import isc
class ModuleCCSessionError(Exception): pass
@@ -333,7 +333,7 @@
"""Requests the current configuration from the configuration
manager through b10-cmdctl, and stores those as CURRENT"""
config = self._conn.send_GET('/config_data')
- if 'version' not in config or config['version'] != 1:
+ if 'version' not in config or config['version'] != BIND10_CONFIG_DATA_VERSION:
raise ModuleCCSessionError("Bad config version")
self._set_current_config(config)
Modified: branches/trac289/src/lib/python/isc/config/cfgmgr.py
==============================================================================
--- branches/trac289/src/lib/python/isc/config/cfgmgr.py (original)
+++ branches/trac289/src/lib/python/isc/config/cfgmgr.py Mon Aug 16 05:23:39 2010
@@ -27,7 +27,7 @@
import tempfile
import json
from isc.cc import data
-from isc.config import ccsession
+from isc.config import ccsession, config_data
class ConfigManagerDataReadError(Exception):
"""This exception is thrown when there is an error while reading
@@ -42,8 +42,6 @@
class ConfigManagerData:
"""This class hold the actual configuration information, and
reads it from and writes it to persistent storage"""
-
- CONFIG_VERSION = 1
def __init__(self, data_path, file_name = "b10-config.db"):
"""Initialize the data for the configuration manager, and
@@ -51,7 +49,7 @@
this does not yet read the database, a call to
read_from_file is needed for that."""
self.data = {}
- self.data['version'] = ConfigManagerData.CONFIG_VERSION
+ self.data['version'] = config_data.BIND10_CONFIG_DATA_VERSION
self.data_path = data_path
self.db_filename = data_path + os.sep + file_name
@@ -65,21 +63,36 @@
the second exception, the best way is probably to report the
error and stop loading the system."""
config = ConfigManagerData(data_path, file_name)
+ file = None
try:
file = open(config.db_filename, 'r')
file_config = json.loads(file.read())
- if 'version' in file_config and \
- file_config['version'] == ConfigManagerData.CONFIG_VERSION:
- config.data = file_config
- else:
- # We can put in a migration path here for old data
- raise ConfigManagerDataReadError("[b10-cfgmgr] Old version of data found")
- file.close()
+ # handle different versions here
+ # If possible, we automatically convert to the new
+ # scheme and update the configuration
+ # If not, we raise an exception
+ if 'version' in file_config:
+ if file_config['version'] == config_data.BIND10_CONFIG_DATA_VERSION:
+ config.data = file_config
+ elif file_config['version'] == 1:
+ # only format change, no other changes necessary
+ file_config['version'] = 2
+ print("[b10-cfgmgr] Updating configuration database version from 1 to 2")
+ config.data = file_config
+ else:
+ if config_data.BIND10_CONFIG_DATA_VERSION > file_config['version']:
+ raise ConfigManagerDataReadError("Cannot load configuration file: version %d no longer supported" % file_config['version'])
+ else:
+ raise ConfigManagerDataReadError("Cannot load configuration file: version %d not yet supported" % file_config['version'])
+ else:
+ raise ConfigManagerDataReadError("No version information in configuration file " + config.db_filename)
except IOError as ioe:
- raise ConfigManagerDataEmpty("No config file found")
- except:
- raise ConfigManagerDataReadError("Config file unreadable")
-
+ raise ConfigManagerDataEmpty("No configuration file found")
+ except ValueError:
+ raise ConfigManagerDataReadError("Configuration file out of date or corrupt, please update or remove " + config.db_filename)
+ finally:
+ if file:
+ file.close();
return config
def write_to_file(self, output_file_name = None):
@@ -102,11 +115,11 @@
os.rename(filename, self.db_filename)
except IOError as ioe:
# TODO: log this (level critical)
- print("[b10-cfgmgr] Unable to write config file; configuration not stored: " + str(ioe))
+ print("[b10-cfgmgr] Unable to write configuration file; configuration not stored: " + str(ioe))
# TODO: debug option to keep file?
except OSError as ose:
# TODO: log this (level critical)
- print("[b10-cfgmgr] Unable to write config file; configuration not stored: " + str(ose))
+ print("[b10-cfgmgr] Unable to write configuration file; configuration not stored: " + str(ose))
try:
if filename and os.path.exists(filename):
os.remove(filename)
@@ -243,7 +256,7 @@
except data.DataNotFoundError as dnfe:
# no data is ok, that means we have nothing that
# deviates from default values
- return ccsession.create_answer(0, { 'version': self.config.CONFIG_VERSION })
+ return ccsession.create_answer(0, { 'version': config_data.BIND10_CONFIG_DATA_VERSION })
else:
return ccsession.create_answer(1, "Bad module_name in get_config command")
Modified: branches/trac289/src/lib/python/isc/config/config_data.py
==============================================================================
--- branches/trac289/src/lib/python/isc/config/config_data.py (original)
+++ branches/trac289/src/lib/python/isc/config/config_data.py Mon Aug 16 05:23:39 2010
@@ -24,6 +24,8 @@
import isc.config.module_spec
class ConfigDataError(Exception): pass
+
+BIND10_CONFIG_DATA_VERSION = 2
def check_type(spec_part, value):
"""Does nothing if the value is of the correct type given the
@@ -250,6 +252,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/trac289/src/lib/python/isc/config/tests/ccsession_test.py
==============================================================================
--- branches/trac289/src/lib/python/isc/config/tests/ccsession_test.py (original)
+++ branches/trac289/src/lib/python/isc/config/tests/ccsession_test.py Mon Aug 16 05:23:39 2010
@@ -22,6 +22,7 @@
import unittest
import os
from isc.config.ccsession import *
+from isc.config.config_data import BIND10_CONFIG_DATA_VERSION
from unittest_fakesession import FakeModuleCCSession
class TestHelperFunctions(unittest.TestCase):
@@ -442,20 +443,20 @@
def create_uccs2(self, fake_conn):
module_spec = isc.config.module_spec_from_file(self.spec_file("spec2.spec"))
fake_conn.set_get_answer('/module_spec', { module_spec.get_module_name(): module_spec.get_full_spec()})
- fake_conn.set_get_answer('/config_data', { 'version': 1 })
+ fake_conn.set_get_answer('/config_data', { 'version': BIND10_CONFIG_DATA_VERSION })
return UIModuleCCSession(fake_conn)
def test_init(self):
fake_conn = fakeUIConn()
fake_conn.set_get_answer('/module_spec', {})
- fake_conn.set_get_answer('/config_data', { 'version': 1 })
+ fake_conn.set_get_answer('/config_data', { 'version': BIND10_CONFIG_DATA_VERSION })
uccs = UIModuleCCSession(fake_conn)
self.assertEqual({}, uccs._specifications)
- self.assertEqual({ 'version': 1}, uccs._current_config)
+ self.assertEqual({ 'version': BIND10_CONFIG_DATA_VERSION}, uccs._current_config)
module_spec = isc.config.module_spec_from_file(self.spec_file("spec2.spec"))
fake_conn.set_get_answer('/module_spec', { module_spec.get_module_name(): module_spec.get_full_spec()})
- fake_conn.set_get_answer('/config_data', { 'version': 1 })
+ fake_conn.set_get_answer('/config_data', { 'version': BIND10_CONFIG_DATA_VERSION })
uccs = UIModuleCCSession(fake_conn)
self.assertEqual(module_spec._module_spec, uccs._specifications['Spec2']._module_spec)
Modified: branches/trac289/src/lib/python/isc/config/tests/cfgmgr_test.py
==============================================================================
--- branches/trac289/src/lib/python/isc/config/tests/cfgmgr_test.py (original)
+++ branches/trac289/src/lib/python/isc/config/tests/cfgmgr_test.py Mon Aug 16 05:23:39 2010
@@ -22,6 +22,7 @@
import unittest
import os
from isc.config.cfgmgr import *
+from isc.config import config_data
from unittest_fakesession import FakeModuleCCSession
class TestConfigManagerData(unittest.TestCase):
@@ -32,7 +33,7 @@
def test_init(self):
self.assertEqual(self.config_manager_data.data['version'],
- ConfigManagerData.CONFIG_VERSION)
+ config_data.BIND10_CONFIG_DATA_VERSION)
self.assertEqual(self.config_manager_data.data_path,
self.data_path)
self.assertEqual(self.config_manager_data.db_filename,
@@ -52,6 +53,9 @@
self.assertRaises(ConfigManagerDataReadError,
ConfigManagerData.read_from_file,
self.data_path, "b10-config-bad3.db")
+ self.assertRaises(ConfigManagerDataReadError,
+ ConfigManagerData.read_from_file,
+ self.data_path, "b10-config-bad4.db")
def test_write_to_file(self):
output_file_name = "b10-config-write-test";
@@ -161,13 +165,13 @@
self.assertEqual(commands_spec['Spec2'], module_spec.get_commands_spec())
def test_read_config(self):
- self.assertEqual(self.cm.config.data, {'version': 1})
+ self.assertEqual(self.cm.config.data, {'version': config_data.BIND10_CONFIG_DATA_VERSION})
self.cm.read_config()
# due to what get written, the value here is what the last set_config command in test_handle_msg does
- self.assertEqual(self.cm.config.data, {'TestModule': {'test': 125}, 'version': 1})
+ self.assertEqual(self.cm.config.data, {'TestModule': {'test': 125}, 'version': config_data.BIND10_CONFIG_DATA_VERSION})
self.cm.data_path = "/no_such_path"
self.cm.read_config()
- self.assertEqual(self.cm.config.data, {'version': 1})
+ self.assertEqual(self.cm.config.data, {'version': config_data.BIND10_CONFIG_DATA_VERSION})
def test_write_config(self):
# tested in ConfigManagerData tests
@@ -190,9 +194,9 @@
{'result': [1, 'Bad get_module_spec command, argument not a dict']})
self._handle_msg_helper({ "command": [ "get_module_spec", { } ] },
{'result': [1, 'Bad module_name in get_module_spec command']})
- self._handle_msg_helper({ "command": [ "get_config" ] }, { 'result': [ 0, { 'version': 1} ]})
+ self._handle_msg_helper({ "command": [ "get_config" ] }, { 'result': [ 0, { 'version': config_data.BIND10_CONFIG_DATA_VERSION } ]})
self._handle_msg_helper({ "command": [ "get_config", { "module_name": "nosuchmodule" } ] },
- {'result': [0, { 'version': 1 }]})
+ {'result': [0, { 'version': config_data.BIND10_CONFIG_DATA_VERSION }]})
self._handle_msg_helper({ "command": [ "get_config", 1 ] },
{'result': [1, 'Bad get_config command, argument not a dict']})
self._handle_msg_helper({ "command": [ "get_config", { } ] },
Modified: branches/trac289/src/lib/python/isc/config/tests/config_data_test.py
==============================================================================
--- branches/trac289/src/lib/python/isc/config/tests/config_data_test.py (original)
+++ branches/trac289/src/lib/python/isc/config/tests/config_data_test.py Mon Aug 16 05:23:39 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")
Modified: branches/trac289/src/lib/xfr/xfrout_client.cc
==============================================================================
--- branches/trac289/src/lib/xfr/xfrout_client.cc (original)
+++ branches/trac289/src/lib/xfr/xfrout_client.cc Mon Aug 16 05:23:39 2010
@@ -77,7 +77,8 @@
{
if (-1 == send_fd(impl_->socket_.native(), tcp_sock)) {
isc_throw(XfroutError,
- "Fail to send the socket file descriptor to xfrout module");
+ "Failed to send the socket file descriptor "
+ "to xfrout module");
}
// XXX: this shouldn't be blocking send, even though it's unlikely to
More information about the bind10-changes
mailing list