Commit d096cf54 authored by JINMEI Tatuya's avatar JINMEI Tatuya
Browse files

sync with trunk


git-svn-id: svn://bind10.isc.org/svn/bind10/branches/trac381@3621 e5f2f494-b856-4b98-b285-d166d9295462
parents c5f3332c faa0af46
119. [bug] jinmei
The master file parser of the python datasrc module incorrectly
regarded a domain name beginning with a decimal number as a TTL
specification. This confused b10-loadzone and had it reject to
load a zone file that contains such a name.
Note: this fix is incomplete and the loadzone would still be
confused if the owner name is a syntactically indistinguishable
from a TTL specification. This is part of a more general issue
and will be addressed in Trac #413. (Trac #411, svn r3599)
118. [func] jinmei
src/lib/dns: changed the interface of AbstractRRset::getRdataIterator()
so that the internal cursor would point to the first RDATA
automatically. This will be a more intuitive and less error prone
behavior. This is a backward compatible change. (Trac #410, r3595)
117. [func] jinmei
src/lib/datasrc: added new zone and zone table classes for the
support of in memory data source. This is an intermediate step to
the bigger feature, and is not yet actually usable in practice.
(Trac #399, svn r3590)
116. [bug] jerry
src/bin/xfrout: Xfrout and Auth will communicate by long tcp
connection, Auth needs to make a new connection only on the first
time or if an error occurred.
(Trac #299, svn r3482)
115. [func]* jinmei
src/lib/dns: Changed DNS message flags and section names from
separate classes to simpler enums, considering the balance between
type safety and usability. API has been changed accordingly.
More documentation and tests were provided with these changes.
(Trac #358, r3439)
114. [build] jinmei
Supported clang++. Note: Boost >= 1.44 is required.
(Trac #365, svn r3383)
113. [func]* zhanglikun
Folder name 'utils'(the folder in /src/lib/python/isc/) has been
renamed to 'util'. Programs that used 'import isc.utils.process'
now need to use 'import isc.util.process'. The folder
/src/lib/python/isc/Util is removed since it isn't used by any
program. (Trac #364, r3382)
112. [func] zhang likun
Add one mixin class to override the naive serve_forever() provided
in python library socketserver. Instead of polling for shutdwon
every poll_interval seconds, one socketpair is used to wake up
the waiting server.(Trac #352, svn r3366)
111. [bug]* zhanglikun, Michal Vaner
Make sure process xfrin/xfrout/zonemgr/cmdctl can be stoped
properly when user enter "ctrl+c" or 'Boss shutdown' command
through bindctl.
The ZonemgrRefresh.run_timer and NotifyOut.dispatcher spawn
a thread themself.
a thread themselves.
(Trac #335, svn r3273)
110. [func] Michal Vaner
Added isc.net.check module to check ip addresses and ports for correctness
and isc.net.addr to hold IP address. The bind10, xfrin and cmdctl programs
are modified to use it.
Added isc.net.check module to check ip addresses and ports for
correctness and isc.net.addr to hold IP address. The bind10, xfrin
and cmdctl programs are modified to use it.
(Trac #353, svn r3240)
109. [func] naokikambe
......@@ -20,10 +72,10 @@
Added the document of the stats module, which is about how stats
module collects the data (Trac #170, [wiki:StatsModule])
108. [func] jerry
108. [func] jerry
src/bin/zonemgr: Provide customizable configurations for
lowerbound_refresh, lowerbound_retry, max_transfer_timeout and
jitter_scope. (Trac #340, r3205)
jitter_scope. (Trac #340, r3205)
107. [func] zhang likun
Remove the parameter 'db_file' for command 'retransfer' of
......@@ -38,7 +90,7 @@
105. [bug] Michal Vaner
Python processes: they no longer take 100% CPU while idle
due to a busy loop in reading command session in a nonblocking way.
(Trac #349, svn r3153)
(Trac #349, svn r3153), (Trac #382, svn r3294)
104. [bug] jerry
bin/zonemgr: zonemgr should be attempting to refresh expired zones.
......
......@@ -17,6 +17,8 @@ AC_LANG([C++])
# Identify the compiler: this check must be after AC_PROG_CXX and AC_LANG.
AM_CONDITIONAL(USE_GXX, test "X${GXX}" = "Xyes")
AC_CHECK_DECL([__SUNPRO_CC], [SUNCXX="yes"], [SUNCXX="no"])
AC_CHECK_DECL([__clang__], [CLANGPP="yes"], [CLANGPP="no"])
AM_CONDITIONAL(USE_CLANGPP, test "X${CLANGPP}" = "Xyes")
# Linker options
......@@ -204,7 +206,6 @@ fi
# gcc specific settings:
if test "X$GXX" = "Xyes"; then
B10_CXXFLAGS="-Wall -Wextra -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare"
UNUSED_PARAM_ATTRIBUTE='__attribute__((unused))'
# Certain versions of gcc (g++) have a bug that incorrectly warns about
# the use of anonymous name spaces even if they're closed in a single
......@@ -223,7 +224,6 @@ CXXFLAGS="$CXXFLAGS_SAVED"
fi dnl GXX = yes
AM_CONDITIONAL(GCC_WERROR_OK, test $werror_ok = 1)
AC_DEFINE_UNQUOTED(UNUSED_PARAM, $UNUSED_PARAM_ATTRIBUTE, Define to compiler keyword indicating a function argument is intentionally unused)
# produce PIC unless we disable shared libraries. need this for python bindings.
if test $enable_shared != "no" -a "X$GXX" = "Xyes"; then
......@@ -313,12 +313,14 @@ if test -z "$with_boost_include"; then
fi
done
fi
CPPFLAGS_SAVES="$CPPFLAGS"
if test "${boost_include_path}" ; then
BOOST_INCLUDES="-I${boost_include_path}"
CPPFLAGS="$CPPFLAGS $BOOST_INCLUDES"
fi
AC_CHECK_HEADERS([boost/shared_ptr.hpp boost/foreach.hpp],,
AC_MSG_ERROR([Missing required header files.]))
CPPFLAGS="$CPPFLAGS_SAVES"
AC_SUBST(BOOST_INCLUDES)
#
......@@ -476,7 +478,7 @@ AC_CONFIG_FILES([Makefile
src/bin/stats/tests/isc/Makefile
src/bin/stats/tests/isc/cc/Makefile
src/bin/stats/tests/isc/config/Makefile
src/bin/stats/tests/isc/utils/Makefile
src/bin/stats/tests/isc/util/Makefile
src/bin/stats/tests/testdata/Makefile
src/bin/usermgr/Makefile
src/bin/tests/Makefile
......@@ -488,9 +490,10 @@ AC_CONFIG_FILES([Makefile
src/lib/cc/tests/Makefile
src/lib/python/Makefile
src/lib/python/isc/Makefile
src/lib/python/isc/utils/Makefile
src/lib/python/isc/utils/tests/Makefile
src/lib/python/isc/util/Makefile
src/lib/python/isc/util/tests/Makefile
src/lib/python/isc/datasrc/Makefile
src/lib/python/isc/datasrc/tests/Makefile
src/lib/python/isc/cc/Makefile
src/lib/python/isc/cc/tests/Makefile
src/lib/python/isc/config/Makefile
......@@ -604,6 +607,8 @@ Package:
Name: $PACKAGE_NAME
Version: $PACKAGE_VERSION
C++ Compiler: $CXX
Flags:
DEFS: $DEFS
CPPFLAGS: $CPPFLAGS
......@@ -613,6 +618,7 @@ dnl includes too
Python: ${PYTHON_INCLUDES}
${PYTHON_LDFLAGS}
${PYTHON_LIB}
Boost: ${BOOST_INCLUDES}
SQLite: $SQLITE_CFLAGS
$SQLITE_LIBS
......@@ -632,4 +638,3 @@ cat <<EOF
Now you can type "make" to build BIND 10
EOF
......@@ -5,6 +5,7 @@ AM_CPPFLAGS += -I$(top_srcdir)/src/bin -I$(top_builddir)/src/bin
AM_CPPFLAGS += -I$(top_srcdir)/src/lib/dns -I$(top_builddir)/src/lib/dns
AM_CPPFLAGS += -I$(top_builddir)/src/lib/cc
AM_CPPFLAGS += -I$(top_srcdir)/src/bin -I$(top_builddir)/src/bin
AM_CPPFLAGS += $(BOOST_INCLUDES)
AM_CXXFLAGS = $(B10_CXXFLAGS)
......@@ -46,6 +47,10 @@ libasio_link_a_CXXFLAGS = $(AM_CXXFLAGS)
if USE_GXX
libasio_link_a_CXXFLAGS += -Wno-unused-parameter
endif
if USE_CLANGPP
# Same for clang++, but we need to turn off -Werror completely.
libasio_link_a_CXXFLAGS += -Wno-error
endif
libasio_link_a_CPPFLAGS = $(AM_CPPFLAGS)
BUILT_SOURCES = spec_config.h
......
......@@ -505,9 +505,7 @@ public:
}
}
void sendCompleted(const asio::error_code& error UNUSED_PARAM,
size_t bytes_sent UNUSED_PARAM)
{
void sendCompleted(const asio::error_code&, size_t) {
// Even if error occurred there's nothing to do. Simply handle
// the next request.
startReceive();
......
......@@ -88,7 +88,7 @@ class AuthSrv;
/// http://think-async.com/Asio/asio-1.3.1/doc/asio/reference/asio_handler_allocate.html
namespace asio_link {
struct IOServiceImpl;
class IOServiceImpl;
/// \brief An exception that is thrown if an error occurs within the IO
/// module. This is mainly intended to be a wrapper exception class for
......@@ -132,7 +132,7 @@ public:
/// This constructor never throws an exception.
///
/// \param asio_address The ASIO \c ip::address to be converted.
IOAddress(const asio::ip::address& asio_adress);
IOAddress(const asio::ip::address& asio_address);
//@}
/// \brief Convert the address to a string.
......
......@@ -77,7 +77,7 @@ public:
MessageRenderer& response_renderer);
bool processAxfrQuery(const IOMessage& io_message, Message& message,
MessageRenderer& response_renderer);
bool processNotify(const IOMessage& io_message, Message& message,
bool processNotify(const IOMessage& io_message, Message& message,
MessageRenderer& response_renderer);
std::string db_file_;
ModuleCCSession* config_session_;
......@@ -152,8 +152,8 @@ makeErrorMessage(Message& message, MessageRenderer& renderer,
// XXX: with the current implementation, it's not easy to set EDNS0
// depending on whether the query had it. So we'll simply omit it.
const qid_t qid = message.getQid();
const bool rd = message.getHeaderFlag(MessageFlag::RD());
const bool cd = message.getHeaderFlag(MessageFlag::CD());
const bool rd = message.getHeaderFlag(Message::HEADERFLAG_RD);
const bool cd = message.getHeaderFlag(Message::HEADERFLAG_CD);
const Opcode& opcode = message.getOpcode();
vector<QuestionPtr> questions;
......@@ -166,12 +166,12 @@ makeErrorMessage(Message& message, MessageRenderer& renderer,
message.clear(Message::RENDER);
message.setQid(qid);
message.setOpcode(opcode);
message.setHeaderFlag(MessageFlag::QR());
message.setHeaderFlag(Message::HEADERFLAG_QR);
if (rd) {
message.setHeaderFlag(MessageFlag::RD());
message.setHeaderFlag(Message::HEADERFLAG_RD);
}
if (cd) {
message.setHeaderFlag(MessageFlag::CD());
message.setHeaderFlag(Message::HEADERFLAG_CD);
}
for_each(questions.begin(), questions.end(), QuestionInserter(&message));
message.setRcode(rcode);
......@@ -231,7 +231,7 @@ AuthSrv::processMessage(const IOMessage& io_message, Message& message,
message.parseHeader(request_buffer);
// Ignore all responses.
if (message.getHeaderFlag(MessageFlag::QR())) {
if (message.getHeaderFlag(Message::HEADERFLAG_QR)) {
if (impl_->verbose_mode_) {
cerr << "[b10-auth] received unexpected response, ignoring"
<< endl;
......@@ -279,7 +279,7 @@ AuthSrv::processMessage(const IOMessage& io_message, Message& message,
return (true);
}
if (message.getRRCount(Section::QUESTION()) != 1) {
if (message.getRRCount(Message::SECTION_QUESTION) != 1) {
makeErrorMessage(message, response_renderer, Rcode::FORMERR(),
impl_->verbose_mode_);
return (true);
......@@ -307,10 +307,10 @@ AuthSrvImpl::processNormalQuery(const IOMessage& io_message, Message& message,
ConstEDNSPtr remote_edns = message.getEDNS();
const bool dnssec_ok = remote_edns && remote_edns->getDNSSECAwareness();
const uint16_t remote_bufsize = remote_edns ? remote_edns->getUDPSize() :
Message::DEFAULT_MAX_UDPSIZE;
Message::DEFAULT_MAX_UDPSIZE;
message.makeResponse();
message.setHeaderFlag(MessageFlag::AA());
message.setHeaderFlag(Message::HEADERFLAG_AA);
message.setRcode(Rcode::NOERROR());
if (remote_edns) {
......@@ -360,8 +360,10 @@ AuthSrvImpl::processAxfrQuery(const IOMessage& io_message, Message& message,
}
try {
xfrout_client_.connect();
xfrout_connected_ = true;
if (!xfrout_connected_) {
xfrout_client_.connect();
xfrout_connected_ = true;
}
xfrout_client_.sendXfroutRequestInfo(
io_message.getSocket().getNative(),
io_message.getData(),
......@@ -375,7 +377,7 @@ AuthSrvImpl::processAxfrQuery(const IOMessage& io_message, Message& message,
xfrout_client_.disconnect();
xfrout_connected_ = false;
}
if (verbose_mode_) {
cerr << "[b10-auth] Error in handling XFR request: " << err.what()
<< endl;
......@@ -385,22 +387,19 @@ AuthSrvImpl::processAxfrQuery(const IOMessage& io_message, Message& message,
return (true);
}
xfrout_client_.disconnect();
xfrout_connected_ = false;
return (false);
}
bool
AuthSrvImpl::processNotify(const IOMessage& io_message, Message& message,
MessageRenderer& response_renderer)
AuthSrvImpl::processNotify(const IOMessage& io_message, Message& message,
MessageRenderer& response_renderer)
{
// The incoming notify must contain exactly one question for SOA of the
// zone name.
if (message.getRRCount(Section::QUESTION()) != 1) {
if (message.getRRCount(Message::SECTION_QUESTION) != 1) {
if (verbose_mode_) {
cerr << "[b10-auth] invalid number of questions in notify: "
<< message.getRRCount(Section::QUESTION()) << endl;
<< message.getRRCount(Message::SECTION_QUESTION) << endl;
}
makeErrorMessage(message, response_renderer, Rcode::FORMERR(),
verbose_mode_);
......@@ -435,7 +434,7 @@ AuthSrvImpl::processNotify(const IOMessage& io_message, Message& message,
}
return (false);
}
const string remote_ip_address =
io_message.getRemoteEndpoint().getAddress().toText();
static const string command_template_start =
......@@ -446,7 +445,7 @@ AuthSrvImpl::processNotify(const IOMessage& io_message, Message& message,
try {
ConstElementPtr notify_command = Element::fromJSON(
command_template_start + question->getName().toText() +
command_template_start + question->getName().toText() +
command_template_master + remote_ip_address +
command_template_rrclass + question->getClass().toText() +
command_template_end);
......@@ -460,7 +459,7 @@ AuthSrvImpl::processNotify(const IOMessage& io_message, Message& message,
if (rcode != 0) {
if (verbose_mode_) {
cerr << "[b10-auth] failed to notify Zonemgr: "
<< parsed_answer->str() << endl;
<< parsed_answer->str() << endl;
}
return (false);
}
......@@ -472,7 +471,7 @@ AuthSrvImpl::processNotify(const IOMessage& io_message, Message& message,
}
message.makeResponse();
message.setHeaderFlag(MessageFlag::AA());
message.setHeaderFlag(Message::HEADERFLAG_AA);
message.setRcode(Rcode::NOERROR());
message.toWire(response_renderer);
return (true);
......
......@@ -84,7 +84,7 @@ public:
isc::xfr::AbstractXfroutClient& xfrout_client);
~AuthSrv();
//@}
/// \return \c true if the \message contains a response to be returned;
/// \return \c true if the \a message contains a response to be returned;
/// otherwise \c false.
bool processMessage(const asio_link::IOMessage& io_message,
isc::dns::Message& message,
......@@ -138,7 +138,7 @@ public:
/// containing the result of the update operation.
isc::data::ConstElementPtr updateConfig(isc::data::ConstElementPtr config);
/// \param Returns the command and configuration session for the
/// \brief Returns the command and configuration session for the
/// \c AuthSrv.
///
/// This method never throws an exception.
......
AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib
AM_CPPFLAGS += -I$(top_srcdir)/src/bin -I$(top_builddir)/src/bin
AM_CPPFLAGS += $(BOOST_INCLUDES)
AM_CXXFLAGS = $(B10_CXXFLAGS)
......
......@@ -3,6 +3,7 @@ SUBDIRS = testdata .
AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib
AM_CPPFLAGS += -I$(top_builddir)/src/lib/dns -I$(top_srcdir)/src/bin
AM_CPPFLAGS += -I$(top_builddir)/src/lib/cc
AM_CPPFLAGS += $(BOOST_INCLUDES)
AM_CPPFLAGS += -DTEST_DATA_DIR=\"$(srcdir)/testdata\"
AM_CPPFLAGS += -DTEST_DATA_BUILDDIR=\"$(abs_top_builddir)/src/bin/auth/tests/testdata\"
......
This diff is collapsed.
......@@ -63,11 +63,11 @@ import pwd
import posix
import isc.cc
import isc.util.process
import isc.net.parse
import isc.utils.process
# Assign this process some longer name
isc.utils.process.rename(sys.argv[0])
isc.util.process.rename(sys.argv[0])
# This is the version that gets displayed to the user.
# The VERSION string consists of the module name, the module version
......@@ -141,9 +141,14 @@ class ProcessInfo:
self.username = username
self._spawn()
def _setuid(self):
def _preexec_work(self):
"""Function used before running a program that needs to run as a
different user."""
# First, put us into a separate process group so we don't get
# SIGINT signals on Ctrl-C (the boss will shut everthing down by
# other means).
os.setpgrp()
# Second, set the user ID if one has been specified
if self.uid is not None:
try:
posix.setuid(self.uid)
......@@ -177,7 +182,7 @@ class ProcessInfo:
stderr=spawn_stderr,
close_fds=True,
env=spawn_env,
preexec_fn=self._setuid)
preexec_fn=self._preexec_work)
self.pid = self.process.pid
self.restart_schedule.set_run_start_time()
......@@ -629,7 +634,7 @@ def check_addr(option, opt_str, value, parser):
def process_rename(option, opt_str, value, parser):
"""Function that renames the process if it is requested by a option."""
isc.utils.process.rename(value)
isc.util.process.rename(value)
def main():
global options
......
......@@ -24,9 +24,9 @@ from bindctl.moduleinfo import *
from bindctl.bindcmd import *
import pprint
from optparse import OptionParser, OptionValueError
import isc.utils.process
import isc.util.process
isc.utils.process.rename()
isc.util.process.rename()
__version__ = 'Bindctl'
......
......@@ -21,11 +21,11 @@ import sys; sys.path.append ('@@PYTHONPATH@@')
from isc.config.cfgmgr import ConfigManager, ConfigManagerDataReadError
from isc.cc import SessionError
import isc.utils.process
import isc.util.process
import signal
import os
isc.utils.process.rename()
isc.util.process.rename()
# If B10_FROM_SOURCE is set in the environment, we use data files
# from a directory relative to that, otherwise we use the ones
......
......@@ -43,16 +43,18 @@ import random
import time
import signal
from isc.config import ccsession
import isc.util.process
import isc.net.parse
import isc.utils.process
from optparse import OptionParser, OptionValueError
from hashlib import sha1
from isc.util import socketserver_mixin
try:
import threading
except ImportError:
import dummy_threading as threading
isc.utils.process.rename()
isc.util.process.rename()
__version__ = 'BIND10'
URL_PATTERN = re.compile('/([\w]+)(?:/([\w]+))?/?')
......@@ -441,7 +443,9 @@ class CommandControl():
return (keyfile, certfile, accountsfile)
class SecureHTTPServer(socketserver.ThreadingMixIn, http.server.HTTPServer):
class SecureHTTPServer(socketserver_mixin.NoPollMixIn,
socketserver.ThreadingMixIn,
http.server.HTTPServer):
'''Make the server address can be reused.'''
allow_reuse_address = True
......@@ -449,6 +453,7 @@ class SecureHTTPServer(socketserver.ThreadingMixIn, http.server.HTTPServer):
CommandControlClass,
idle_timeout = 1200, verbose = False):
'''idle_timeout: the max idle time for login'''
socketserver_mixin.NoPollMixIn.__init__(self)
try:
http.server.HTTPServer.__init__(self, server_address, RequestHandlerClass)
except socket.error as err:
......
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
AM_CPPFLAGS += $(BOOST_INCLUDES)
AM_CXXFLAGS = $(B10_CXXFLAGS)
......
......@@ -58,7 +58,7 @@ host_lookup(const char* const name, const char* const type) {
msg.setOpcode(Opcode::QUERY());
msg.setRcode(Rcode::NOERROR());
if (recursive_bit) {
msg.setHeaderFlag(MessageFlag::RD()); // set recursive bit
msg.setHeaderFlag(Message::HEADERFLAG_RD); // set recursive bit
}
msg.addQuestion(Question(Name(name),
......@@ -122,15 +122,16 @@ host_lookup(const char* const name, const char* const type) {
rmsg.fromWire(ibuffer);
if (!verbose) {
for (RRsetIterator it = rmsg.beginSection(Section::ANSWER());
it != rmsg.endSection(Section::ANSWER());
++it) {
for (RRsetIterator it =
rmsg.beginSection(Message::SECTION_ANSWER);
it != rmsg.endSection(Message::SECTION_ANSWER);
++it) {
if ((*it)->getType() != RRType::A()) {
continue;
}
RdataIteratorPtr rit = (*it)->getRdataIterator();
for (rit->first(); !rit->isLast(); rit->next()) {
for (; !rit->isLast(); rit->next()) {
// instead of using my name, maybe use returned label?
cout << name << " has address " <<
(*rit).getCurrent().toText() << endl;
......
......@@ -18,12 +18,12 @@
import sys; sys.path.append ('@@PYTHONPATH@@')
import re, getopt
import isc.datasrc
import isc.utils.process
import isc.util.process
from isc.datasrc.master import MasterFile
import time
import os
isc.utils.process.rename()
isc.util.process.rename()
#########################################################################
# usage: print usage note and exit
......
Error reading zone file: Cannot parse RR, No $ORIGIN: @ IN SOA ns hostmaster 1 3600 1800 1814400 3600
Error reading zone file: $ORIGIN is not absolute in record:$ORIGIN com
Error reading zone file: $ORIGIN is not absolute in record: $ORIGIN com
Error reading zone file: Cannot parse RR: $TL 300
Error reading zone file: Cannot parse RR: $OIGIN com.
Error loading database: Error while loading com.: Cannot parse RR: $INLUDE file.txt
......
......@@ -31,11 +31,11 @@ import select
import pprint
import random
from optparse import OptionParser, OptionValueError
import isc.utils.process
import isc.util.process
import isc.cc
isc.utils.process.rename()
isc.util.process.rename()
# This is the version that gets displayed to the user.
__version__ = "v20091030 (Paving the DNS Parking Lot)"
......
......@@ -8,6 +8,7 @@ check-local:
for pytest in $(PYTESTS) ; do \
echo Running test: $$pytest ; \
env PYTHONPATH=$(abs_top_builddir)/src/bin/msgq:$(abs_top_srcdir)/src/lib/python:$(abs_top_builddir)/src/lib/python \
BIND10_TEST_SOCKET_FILE=$(builddir)/test_msgq_socket.sock \
$(PYCOVERAGE) $(abs_srcdir)/$$pytest || exit ; \
done
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment