From: Wouter Wijngaards Date: Wed, 31 Oct 2007 14:46:05 +0000 (+0000) Subject: - fix horrible oversight in sorting rrset references in a message, X-Git-Tag: release-0.6~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f79c387f3f9e093bd9c8e07a1f332fee7b8c5682;p=thirdparty%2Funbound.git - fix horrible oversight in sorting rrset references in a message, sort per reference key pointer, not on referencepointer itself. - pidfile: "/etc/unbound/unbound.pid" is now the default. - tests changed to reflect the updated default. git-svn-id: file:///svn/unbound/trunk@724 be551aaa-1e26-0410-a405-d3ace91eadb9 --- diff --git a/checkconf/unbound-checkconf.c b/checkconf/unbound-checkconf.c index ba4e20a92..3a58aa759 100644 --- a/checkconf/unbound-checkconf.c +++ b/checkconf/unbound-checkconf.c @@ -173,6 +173,7 @@ int main(int argc, char* argv[]) int c; log_ident_set("unbound-checkconf"); log_init(NULL, 0, NULL); + checklock_start(); /* parse the options */ while( (c=getopt(argc, argv, "h")) != -1) { switch(c) { @@ -187,5 +188,6 @@ int main(int argc, char* argv[]) if(argc != 1) usage(); checkconf(argv[0]); + checklock_stop(); return 0; } diff --git a/doc/Changelog b/doc/Changelog index d024105ce..55b646a98 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -5,6 +5,10 @@ username: "unbound" chroot: "/etc/unbound" The operator can override them to be less secure ("") if necessary. + - fix horrible oversight in sorting rrset references in a message, + sort per reference key pointer, not on referencepointer itself. + - pidfile: "/etc/unbound/unbound.pid" is now the default. + - tests changed to reflect the updated default. 30 October 2007: Wouter - fixup assertion failure that relied on compressed names to be diff --git a/doc/example.conf b/doc/example.conf index a96670758..378f987f8 100644 --- a/doc/example.conf +++ b/doc/example.conf @@ -134,7 +134,7 @@ server: # use-syslog: yes # the pid file. - # pidfile: "unbound.pid" + # pidfile: "/etc/unbound/unbound.pid" # file to read root hints from. # get one from ftp://FTP.INTERNIC.NET/domain/named.cache diff --git a/doc/unbound.conf.5 b/doc/unbound.conf.5 index a3603339b..f05b3011a 100644 --- a/doc/unbound.conf.5 +++ b/doc/unbound.conf.5 @@ -181,9 +181,16 @@ The log facility LOG_DAEMON is used, with identity "unbound". The logfile setting is overridden when use-syslog is turned on. The default is to log to syslog. .It \fBpidfile:\fR -The process id is written to the file. Default is "unbound.pid". So, -kill -HUP `cat /etc/unbound/unbound.pid` will trigger a reload, -kill -QUIT `cat /etc/unbound/unbound.pid` will gracefully terminate. +The process id is written to the file. Default is "/etc/unbound/unbound.pid". +So, +.nf +kill -HUP `cat /etc/unbound/unbound.pid` +.fi +triggers a reload, +.nf +kill -QUIT `cat /etc/unbound/unbound.pid` +.fi +gracefully terminates. .It \fBroot-hints:\fR Read the root hints from this file. Default is nothing, using builtin hints for the IN class. The file has the format of zone files, with root diff --git a/testcode/checklocks.c b/testcode/checklocks.c index 3c56fe5cc..405a406ec 100644 --- a/testcode/checklocks.c +++ b/testcode/checklocks.c @@ -63,7 +63,7 @@ static ub_thread_key_t thr_debug_key; /** the list of threads, so all threads can be examined. NULL if unused. */ static struct thr_check* thread_infos[THRDEBUG_MAX_THREADS]; /** do we check locking order */ -int check_locking_order = 0; +int check_locking_order = 1; /** the pid of this runset, reasonably unique. */ static pid_t check_lock_pid; diff --git a/testcode/testbound.c b/testcode/testbound.c index c7de18150..78b14aafb 100644 --- a/testcode/testbound.c +++ b/testcode/testbound.c @@ -140,6 +140,7 @@ setup_config(FILE* in, char* configfile, int* lineno, fprintf(cfg, " directory: \"\"\n"); fprintf(cfg, " chroot: \"\"\n"); fprintf(cfg, " username: \"\"\n"); + fprintf(cfg, " pidfile: \"\"\n"); while(fgets(line, MAX_LINE_LEN-1, in)) { parse = line; (*lineno)++; diff --git a/testdata/04-checkconf.tpkg b/testdata/04-checkconf.tpkg index 66d5589a5..ad37e0925 100644 Binary files a/testdata/04-checkconf.tpkg and b/testdata/04-checkconf.tpkg differ diff --git a/testdata/fwd_compress_c00c.tpkg b/testdata/fwd_compress_c00c.tpkg index 627cf92d4..905bb1b3c 100644 Binary files a/testdata/fwd_compress_c00c.tpkg and b/testdata/fwd_compress_c00c.tpkg differ diff --git a/testdata/fwd_no_edns.tpkg b/testdata/fwd_no_edns.tpkg index 34962337e..a12aaf906 100644 Binary files a/testdata/fwd_no_edns.tpkg and b/testdata/fwd_no_edns.tpkg differ diff --git a/testdata/fwd_tcp.tpkg b/testdata/fwd_tcp.tpkg index bef8747bc..953ea18d7 100644 Binary files a/testdata/fwd_tcp.tpkg and b/testdata/fwd_tcp.tpkg differ diff --git a/testdata/fwd_tcp_tc.tpkg b/testdata/fwd_tcp_tc.tpkg index 1487a253a..91f2977b3 100644 Binary files a/testdata/fwd_tcp_tc.tpkg and b/testdata/fwd_tcp_tc.tpkg differ diff --git a/testdata/fwd_tcp_tc6.tpkg b/testdata/fwd_tcp_tc6.tpkg index df45e9e5b..b25b94e4d 100644 Binary files a/testdata/fwd_tcp_tc6.tpkg and b/testdata/fwd_tcp_tc6.tpkg differ diff --git a/testdata/fwd_three.tpkg b/testdata/fwd_three.tpkg index 860b17a77..09c84617a 100644 Binary files a/testdata/fwd_three.tpkg and b/testdata/fwd_three.tpkg differ diff --git a/testdata/fwd_three_service.tpkg b/testdata/fwd_three_service.tpkg index 983e47b75..b85d291b1 100644 Binary files a/testdata/fwd_three_service.tpkg and b/testdata/fwd_three_service.tpkg differ diff --git a/testdata/fwd_ttlexpire.tpkg b/testdata/fwd_ttlexpire.tpkg index 98e3f21d4..d478e5a97 100644 Binary files a/testdata/fwd_ttlexpire.tpkg and b/testdata/fwd_ttlexpire.tpkg differ diff --git a/testdata/fwd_udp.tpkg b/testdata/fwd_udp.tpkg index d3c398666..4dde7181d 100644 Binary files a/testdata/fwd_udp.tpkg and b/testdata/fwd_udp.tpkg differ diff --git a/util/config_file.c b/util/config_file.c index 76d42968c..99397d4e5 100644 --- a/util/config_file.c +++ b/util/config_file.c @@ -97,7 +97,8 @@ config_create() if(!(cfg->chrootdir = strdup("/etc/unbound"))) goto error_exit; if(!(cfg->directory = strdup("/etc/unbound"))) goto error_exit; if(!(cfg->logfile = strdup(""))) goto error_exit; - if(!(cfg->pidfile = strdup("unbound.pid"))) goto error_exit; + if(!(cfg->pidfile = strdup("/etc/unbound/unbound.pid"))) + goto error_exit; if(!(cfg->target_fetch_policy = strdup("3 2 1 0 0"))) goto error_exit; cfg->donotqueryaddrs = NULL; cfg->donotquery_localhost = 1; diff --git a/util/data/msgreply.c b/util/data/msgreply.c index ea524e924..14196837b 100644 --- a/util/data/msgreply.c +++ b/util/data/msgreply.c @@ -421,8 +421,10 @@ int reply_info_parse(ldns_buffer* pkt, struct alloc_cache* alloc, static int reply_info_sortref_cmp(const void* a, const void* b) { - if(a < b) return -1; - if(a > b) return 1; + struct rrset_ref* x = (struct rrset_ref*)a; + struct rrset_ref* y = (struct rrset_ref*)b; + if(x->key < y->key) return -1; + if(x->key > y->key) return 1; return 0; }