tags 147471 + patch
thanks

We at Maths.USyd have been using the following patch for this; sorry,
no patch for the man page.
(Should have been passed on to Debian years ago; my excuse is that I
took over management of the machine that uses this a short time ago.)

Cheers,

Paul Szabo   [EMAIL PROTECTED]   http://www.maths.usyd.edu.au/u/psz/
School of Mathematics and Statistics   University of Sydney    Australia


--- sysklogd-1.4.1/syslogd.c.orig       2006-12-06 12:52:56.696107504 +1100
+++ sysklogd-1.4.1/syslogd.c    2006-12-06 12:59:54.430625240 +1100
@@ -731,6 +731,7 @@
 int    MarkSeq = 0;            /* mark sequence number */
 int    NoFork = 0;             /* don't fork - don't run in daemon mode */
 int    AcceptRemote = 0;       /* receive messages that come via UDP */
+char   *UDPinterface = NULL;   /* dotted quad giving interface to listen for 
UDP on */
 char   **StripDomains = NULL;  /* these domains may be stripped before writing 
logs */
 char   **LocalHosts = NULL;    /* these hosts are logged with their hostname */
 int    NoHops = 1;             /* Can we bounce syslog messages through an
@@ -829,7 +830,7 @@
                funix[i]  = -1;
        }
 
-       while ((ch = getopt(argc, argv, "a:dhf:l:m:np:rs:v")) != EOF)
+       while ((ch = getopt(argc, argv, "a:dhf:l:m:np:r::s:v")) != EOF)
                switch((char)ch) {
                case 'a':
                        if (nfunix < MAXFUNIX)
@@ -865,6 +866,7 @@
                        break;
                case 'r':               /* accept remote messages */
                        AcceptRemote = 1;
+                       UDPinterface = optarg;
                        break;
                case 's':
                        if (StripDomains) {
@@ -1174,7 +1176,7 @@
 
 int usage()
 {
-       fprintf(stderr, "usage: syslogd [-drvh] [-l hostlist] [-m markinterval] 
[-n] [-p path]\n" \
+       fprintf(stderr, "usage: syslogd [-dvh] [-r[interface]] [-l hostlist] 
[-m markinterval] [-n] [-p path]\n" \
                " [-s domainlist] [-f conffile]\n");
        exit(1);
 }
@@ -1227,6 +1229,14 @@
        memset(&sin, 0, sizeof(sin));
        sin.sin_family = AF_INET;
        sin.sin_port = LogPort;
+
+       if (UDPinterface) {
+               if (inet_aton(UDPinterface, &sin.sin_addr) == 0) {
+                       logerror("syslog: bad UDP interface, suspending inet 
service.");
+                       return -1;
+               }
+       }
+
        if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, \
                       (char *) &on, sizeof(on)) < 0 ) {
                logerror("setsockopt(REUSEADDR), suspending inet");
--- sysklogd-1.4.1/debian/changelog.orig        2006-12-06 12:52:56.739109001 
+1100
+++ sysklogd-1.4.1/debian/changelog     2006-12-06 13:00:43.507329872 +1100
@@ -1,3 +1,10 @@
+sysklogd (1.4.1-20.psz) unstable; urgency=low
+
+  * Allow -r option to take an argument specifying IP interface to listen on
+    (following Jim's sysklogd_1.4.1-10.diff)
+
+ -- Paul Szabo <[EMAIL PROTECTED]>  Wed,  6 Dec 2006 12:57:02 +1100
+
 sysklogd (1.4.1-20) unstable; urgency=low
 
   * Added a missing whitespace to the rc file (Closes: Bug#388787,


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to