From: Giorgos Keramidas <[EMAIL PROTECTED]>
Subject: Re: syslogd: Too many '/' in "/dev//console"
Date: Tue, Sep 04, 2001 at 06:39:36AM +0300

> I'm looking at the diffs from Aug 25, so if I come up with sth by
> running syslogd with -d, by tomorrow I'll have spotted this in more
> detail - probably replying with the patch to fix it too.  Off to
> buildworld and bed, 'nite all.

Running "syslogd -d -s -s" and checking out my usr.sbin/syslogd
sources from various dates, I tracked this bug down to changes made
between Aug 31 2001 and Sep 1 2001.

In my /etc/syslog.conf I changed /dev/console to /dev/ttyvb so that
all messages are redirected to /dev/ttyvb (where I would easily spot
them, and do not clutter my active console).

Here's the output of two builds of syslogd with sources from the dates
mentioned:

    hades!root:[/usr/src/usr.sbin/syslogd]# cvs up -A -P -d -q -D 'Aug 31 2001'
    hades!root:[/usr/src/usr.sbin/syslogd]# make
    hades!root:[/usr/src/usr.sbin/syslogd]# make install
    hades!root:[/usr/src/usr.sbin/syslogd]# syslogd -d -s -s
    off & running....
    init
    cfline("*.*                                             /var/log/messages", f, 
"*", "*")
    cfline("*.*                                             /dev/ttyvb", f, "*", "*")
    8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 X FILE: /var/log/messages
    8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 X TTY: /dev/ttyvb
    logmsg: pri 56, flags 4, from hades, msg syslogd: restart
    Logging to FILE /var/log/messages
    Logging to TTY /dev/ttyvb
    syslogd: restarted
    ^Csyslogd: exiting on signal 2
    syslogd: exiting on signal 2
    logmsg: pri 53, flags 4, from hades, msg syslogd: exiting on signal 2
    Logging to FILE /var/log/messages
    Logging to TTY /dev/ttyvb

So, the sources of Aug 31 seem to run perfectly fine.  Trying the same
with the sources of Sep 1, I get the interesting output shown below:

    hades!root:[/usr/src/usr.sbin/syslogd]# cvs up -A -P -d -q -D 'Sep 1 2001'
    hades!root:[/usr/src/usr.sbin/syslogd]# make
    hades!root:[/usr/src/usr.sbin/syslogd]# make install
    hades!root:[/usr/src/usr.sbin/syslogd]# syslogd -d -s -s
    off & running....
    init
    cfline("*.*                                             /var/log/messages", f, 
"*", "*")
    cfline("*.*                                             /dev/ttyvb", f, "*", "*")
    8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 X FILE: /var/log/messages
    8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 X TTY: /dev//ttyvb
    logmsg: pri 56, flags 4, from hades, msg syslogd: restart
    Logging to FILE /var/log/messages
    Logging to TTY /dev//ttyvb
    syslogd: Too many '/' in "/dev//ttyvb"
    logmsg: pri 53, flags 4, from hades, msg syslogd: Too many '/' in "/dev//ttyvb"
    Logging to FILE /var/log/messages
    Logging to UNUSED
    syslogd: restarted

The following patch seems to have fixed the bug for me.

-giorgos

[-- start of patch --]
Index: syslogd.c
===================================================================
RCS file: /home/ncvs/src/usr.sbin/syslogd/syslogd.c,v
retrieving revision 1.84
diff -u -r1.84 syslogd.c
--- syslogd.c   1 Sep 2001 08:42:49 -0000       1.84
+++ syslogd.c   4 Sep 2001 19:04:25 -0000
@@ -1664,7 +1664,7 @@
                                f->f_type = F_CONSOLE;
                        else
                                f->f_type = F_TTY;
-                       (void)strlcpy(f->f_un.f_fname, p + sizeof(_PATH_DEV - 1),
+                       (void)strlcpy(f->f_un.f_fname, p + sizeof _PATH_DEV - 1,
                            sizeof(f->f_un.f_fname));
                } else {
                        (void)strlcpy(f->f_un.f_fname, p, sizeof(f->f_un.f_fname));
[-- end of patch --]

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to