[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
syslogd.c patch
- To: tech_(_at_)_openbsd_(_dot_)_org
- Subject: syslogd.c patch
- From: Pierre-Yves Ritschard <pierre-yves_(_dot_)_ritschard_(_at_)_oxalide_(_dot_)_com>
- Date: Mon, 07 Mar 2005 15:12:12 +0100
Here's a *really* simple patch that makes syslogd not bind a udp socket
if -u isn't specified.
Tested on i386 and sparc64 though when looking at it it seems pretty
clear it will work everywhere.
--- syslogd.c.orig Mon Mar 7 14:29:19 2005
+++ syslogd.c Mon Mar 7 14:47:35 2005
@@ -355,6 +355,7 @@
pfd[i].events = 0;
}
+ if (!SecureMode) {
if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) != -1) {
struct servent *sp;
@@ -369,7 +370,8 @@
s_in.sin_len = sizeof(s_in);
s_in.sin_family = AF_INET;
s_in.sin_port = LogPort = sp->s_port;
- if (bind(fd, (struct sockaddr *)&s_in, sizeof(s_in)) < 0) {
+ if (bind(fd, (struct sockaddr *)&s_in,
+ sizeof(s_in)) < 0) {
logerror("bind");
if (!Debug)
die(0);
@@ -378,6 +380,7 @@
double_rbuf(fd);
pfd[PFD_INET].fd = fd;
pfd[PFD_INET].events = POLLIN;
+ }
}
}
Visit your host, monkey.org