The following implements my suggestions from the prevoius message:
--- server/upsd.c 2009-07-26 19:19:22.000000000 +0300
+++ server/upsd.c.new 2009-07-27 01:16:34.000000000 +0300
@@ -69,6 +69,7 @@
/* default is to listen on all local interfaces */
static stype_t *firstaddr = NULL;
+ /* At this point, if no LISTEN address has been seen */
+static int firstaddrFromConf = 0;
#ifdef HAVE_IPV6
static int opt_af = AF_UNSPEC;
@@ -472,8 +474,13 @@
if (!hosts_access(&req)) {
/* tcp-wrappers says access should be denied */
- send_err(client, NUT_ERR_ACCESS_DENIED);
- return;
+ upslogx(LOG_WARNING, "tcpd denied %s",
client->addr);
+ if (!firstaddrFromConf)
+ upslogx(LOG_WARNING, "override tcpd. %s
was set by %s", client->addr, progname);
+ else {
+ send_err(client,
NUT_ERR_ACCESS_DENIED);
+ return;
+ }
}
#endif /* HAVE_WRAP */
}
@@ -621,7 +628,10 @@
#else
listen_add("127.0.0.1", string_const(PORT));
#endif
+ upslogx(LOG_NOTICE, "no LISTEN addres has been
specified. localhost was set by %s", progname);
}
+ else
+ firstaddrFromConf = 1;
for (server = firstaddr; server; server = server->next) {
setuptcp(server);
--
[email protected]
SDF Public Access UNIX System - http://sdf.lonestar.org
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]