Only play with the network when the syslog port can be determined.
Ignore networking otherwise, but continue working. (Debian Bug#226611)
This commit is contained in:
parent
05e52e218e
commit
62ec1253ee
14
syslogd.c
14
syslogd.c
@ -2288,11 +2288,15 @@ void init()
|
|||||||
|
|
||||||
sp = getservbyname("syslog", "udp");
|
sp = getservbyname("syslog", "udp");
|
||||||
if (sp == NULL) {
|
if (sp == NULL) {
|
||||||
|
if (errno == ENOENT) {
|
||||||
|
errno = 0;
|
||||||
|
logerror("The file /etc/services does not seem exist.");
|
||||||
|
}
|
||||||
errno = 0;
|
errno = 0;
|
||||||
logerror("network logging disabled (syslog/udp service unknown).");
|
logerror("network logging disabled (syslog/udp service unknown).");
|
||||||
logerror("see syslogd(8) for details of whether and how to enable it.");
|
logerror("see syslogd(8) for details of whether and how to enable it.");
|
||||||
return;
|
LogPort = 0;
|
||||||
}
|
} else
|
||||||
LogPort = sp->s_port;
|
LogPort = sp->s_port;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -2686,6 +2690,12 @@ void cfline(line, f)
|
|||||||
{
|
{
|
||||||
case '@':
|
case '@':
|
||||||
#ifdef SYSLOG_INET
|
#ifdef SYSLOG_INET
|
||||||
|
if (!LogPort) {
|
||||||
|
f->f_type = F_UNUSED;
|
||||||
|
logerror("Forward rule without networking enabled");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
(void) strcpy(f->f_un.f_forw.f_hname, ++p);
|
(void) strcpy(f->f_un.f_forw.f_hname, ++p);
|
||||||
dprintf("forwarding host: %s\n", p); /*ASP*/
|
dprintf("forwarding host: %s\n", p); /*ASP*/
|
||||||
if ( (hp = gethostbyname(p)) == NULL ) {
|
if ( (hp = gethostbyname(p)) == NULL ) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user