Merge pull request #20 from westermo/wmo/2.4

inetd reload fixes

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson
2016-02-19 15:11:20 +01:00
4 changed files with 17 additions and 1 deletions
+2 -1
View File
@@ -125,7 +125,8 @@ void conf_parse_cond(svc_t *svc, char *cond)
}
/* By default we assume UNIX daemons support SIGHUP */
svc->sighup = 1;
if (svc_is_daemon(svc))
svc->sighup = 1;
if (!cond)
return;
+12
View File
@@ -351,6 +351,18 @@ inetd_filter_t *inetd_filter_match(inetd_t *inetd, char *ifname)
return NULL;
}
int inetd_flush(inetd_t *inetd)
{
inetd_filter_t *filter, *next;
TAILQ_FOREACH_SAFE(filter, &inetd->filters, link, next) {
TAILQ_REMOVE(&inetd->filters, filter, link);
free(filter);
}
return 0;
}
/* Poor man's tcpwrappers filtering */
int inetd_allow(inetd_t *inetd, char *ifname)
{
+1
View File
@@ -64,6 +64,7 @@ int inetd_del (inetd_t *inetd);
int inetd_match (inetd_t *inetd, char *service, char *proto);
int inetd_filter_str (inetd_t *inetd, char *str, size_t len);
int inetd_flush (inetd_t *inetd);
int inetd_allow (inetd_t *inetd, char *ifname);
int inetd_deny (inetd_t *inetd, char *ifname);
int inetd_is_allowed (inetd_t *inetd, char *ifname);
+2
View File
@@ -671,6 +671,8 @@ int service_register(int type, char *line, time_t mtime, char *username)
}
inetd_setup:
inetd_flush(&svc->inetd);
if (!ifaces) {
_d("No specific iface listed for %s, allowing ANY.", service);
inetd_allow(&svc->inetd, NULL);