summaryrefslogtreecommitdiff
path: root/usr.sbin/syslogd
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1996-07-30 16:28:28 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1996-07-30 16:28:28 +0000
commite9c384ee87ff97ae157b9b34678e68d9959b7bca (patch)
treed9730e52acb80ce73810d10dbc01c53bf3c8df2a /usr.sbin/syslogd
parent08f857a0f80b60f207fb960261355645878cc369 (diff)
bzzt, need finet for outgoing as well
Diffstat (limited to 'usr.sbin/syslogd')
-rw-r--r--usr.sbin/syslogd/syslogd.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/usr.sbin/syslogd/syslogd.c b/usr.sbin/syslogd/syslogd.c
index d4b5bd341f2..4cd3c9bd095 100644
--- a/usr.sbin/syslogd/syslogd.c
+++ b/usr.sbin/syslogd/syslogd.c
@@ -276,12 +276,7 @@ main(argc, argv)
dprintf("cannot create %s (%d)\n", LogName, errno);
die(0);
}
- if (!SecureMode)
- finet = socket(AF_INET, SOCK_DGRAM, 0);
- else {
- finet = -1;
- inetm = 0;
- }
+ finet = socket(AF_INET, SOCK_DGRAM, 0);
if (finet >= 0) {
struct servent *sp;
@@ -361,11 +356,15 @@ main(argc, argv)
len = sizeof(frominet);
i = recvfrom(finet, line, MAXLINE, 0,
(struct sockaddr *)&frominet, &len);
- if (i > 0) {
- line[i] = '\0';
- printline(cvthname(&frominet), line);
- } else if (i < 0 && errno != EINTR)
- logerror("recvfrom inet");
+ if (SecureMode) {
+ /* silently drop it */
+ } else {
+ if (i > 0) {
+ line[i] = '\0';
+ printline(cvthname(&frominet), line);
+ } else if (i < 0 && errno != EINTR)
+ logerror("recvfrom inet");
+ }
}
}
}