Module Name: src
Committed By: snj
Date: Mon Feb 12 18:30:22 UTC 2018
Modified Files:
src/external/bsd/blacklist/bin [netbsd-7]: blacklistd.c state.c
Log Message:
Pull up following revision(s) (requested by christos in ticket #1548):
external/bsd/blacklist/bin/blacklistd.c: 1.35
external/bsd/blacklist/bin/state.c: 1.19
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.32.2.3 -r1.32.2.4 \
src/external/bsd/blacklist/bin/blacklistd.c
cvs rdiff -u -r1.15.2.3 -r1.15.2.4 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.32.2.3 src/external/bsd/blacklist/bin/blacklistd.c:1.32.2.4
--- src/external/bsd/blacklist/bin/blacklistd.c:1.32.2.3 Fri Aug 7 04:10:23 2015
+++ src/external/bsd/blacklist/bin/blacklistd.c Mon Feb 12 18:30:22 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: blacklistd.c,v 1.32.2.3 2015/08/07 04:10:23 snj Exp $ */
+/* $NetBSD: blacklistd.c,v 1.32.2.4 2018/02/12 18:30:22 snj 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.32.2.3 2015/08/07 04:10:23 snj Exp $");
+__RCSID("$NetBSD: blacklistd.c,v 1.32.2.4 2018/02/12 18:30:22 snj Exp $");
#include <sys/types.h>
#include <sys/socket.h>
@@ -470,9 +470,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;
@@ -497,6 +494,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.15.2.3 src/external/bsd/blacklist/bin/state.c:1.15.2.4
--- src/external/bsd/blacklist/bin/state.c:1.15.2.3 Fri Aug 7 04:10:23 2015
+++ src/external/bsd/blacklist/bin/state.c Mon Feb 12 18:30:22 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: state.c,v 1.15.2.3 2015/08/07 04:10:23 snj Exp $ */
+/* $NetBSD: state.c,v 1.15.2.4 2018/02/12 18:30:22 snj Exp $ */
/*-
* Copyright (c) 2015 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
#endif
#include <sys/cdefs.h>
-__RCSID("$NetBSD: state.c,v 1.15.2.3 2015/08/07 04:10:23 snj Exp $");
+__RCSID("$NetBSD: state.c,v 1.15.2.4 2018/02/12 18:30:22 snj 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;