Module Name:    src
Committed By:   christos
Date:           Mon Sep 26 19:43:43 UTC 2016

Modified Files:
        src/external/bsd/blacklist/bin: blacklistd.c state.c

Log Message:
restore rules after the database is open, add error message to prevent
silent failure in the future. (Kurt Lidl)


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/external/bsd/blacklist/bin/blacklistd.c
cvs rdiff -u -r1.18 -r1.19 src/external/bsd/blacklist/bin/state.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/blacklist/bin/blacklistd.c
diff -u src/external/bsd/blacklist/bin/blacklistd.c:1.34 src/external/bsd/blacklist/bin/blacklistd.c:1.35
--- src/external/bsd/blacklist/bin/blacklistd.c:1.34	Mon Apr  4 11:52:56 2016
+++ src/external/bsd/blacklist/bin/blacklistd.c	Mon Sep 26 15:43:43 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: blacklistd.c,v 1.34 2016/04/04 15:52:56 christos Exp $	*/
+/*	$NetBSD: blacklistd.c,v 1.35 2016/09/26 19:43:43 christos Exp $	*/
 
 /*-
  * Copyright (c) 2015 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 #include "config.h"
 #endif
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: blacklistd.c,v 1.34 2016/04/04 15:52:56 christos Exp $");
+__RCSID("$NetBSD: blacklistd.c,v 1.35 2016/09/26 19:43:43 christos Exp $");
 
 #include <sys/types.h>
 #include <sys/socket.h>
@@ -473,9 +473,6 @@ main(int argc, char *argv[])
 		flags |= O_TRUNC;
 	}
 
-	if (restore)
-		rules_restore();
-
 	struct pollfd *pfd = NULL;
 	bl_t *bl = NULL;
 	size_t nfd = 0;
@@ -500,6 +497,9 @@ main(int argc, char *argv[])
 	if (state == NULL)
 		return EXIT_FAILURE;
 
+	if (restore)
+		rules_restore();
+
 	if (!debug) {
 		if (daemon(0, 0) == -1)
 			err(EXIT_FAILURE, "daemon failed");

Index: src/external/bsd/blacklist/bin/state.c
diff -u src/external/bsd/blacklist/bin/state.c:1.18 src/external/bsd/blacklist/bin/state.c:1.19
--- src/external/bsd/blacklist/bin/state.c:1.18	Mon Apr  4 11:52:56 2016
+++ src/external/bsd/blacklist/bin/state.c	Mon Sep 26 15:43:43 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: state.c,v 1.18 2016/04/04 15:52:56 christos Exp $	*/
+/*	$NetBSD: state.c,v 1.19 2016/09/26 19:43:43 christos Exp $	*/
 
 /*-
  * Copyright (c) 2015 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
 #endif
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: state.c,v 1.18 2016/04/04 15:52:56 christos Exp $");
+__RCSID("$NetBSD: state.c,v 1.19 2016/09/26 19:43:43 christos Exp $");
 
 #include <sys/types.h>
 #include <sys/socket.h>
@@ -200,8 +200,10 @@ state_iterate(DB *db, struct conf *c, st
 	int rv;
 	DBT k, v;
 
-	if (db == NULL)
+	if (db == NULL) {
+		(*lfun)(LOG_ERR, "%s: called with no database file", __func__);
 		return -1;
+	}
 
 	first = first ? R_FIRST : R_NEXT;
 

Reply via email to