Re: syslogd: Too many '/' in /dev//console
On Wed, Sep 05, 2001 at 09:52:34AM +0300, Giorgos Keramidas wrote: I have it fixed now in my local CVS tree. Hopefully Kris will commit something to fix it soon :-) I fixed this a couple of hours ago. Kris PGP signature
Re: syslogd: Too many '/' in /dev//console
From: Mike Heffner [EMAIL PROTECTED] Subject: Re: syslogd: Too many '/' in /dev//console Date: Tue, Sep 04, 2001 at 07:55:33PM -0400 On 04-Sep-2001 Giorgos Keramidas wrote: | | The following patch seems to have fixed the bug for me. | Yea, Kris said he was going to fix it. This must be some undefined behavior because I tested the change in a test program and the two sizeofs were giving me the same result..strange ;) I want to test this without leaving sizeof _PATH_DEV surrounded by spaces, with sizeof() explicitly using parentheses. I'm not sure where the undefined behavior is triggered, but this is a very likely point, and the source of syslogd.c is just full of this. I have it fixed now in my local CVS tree. Hopefully Kris will commit something to fix it soon :-) -giorgos To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-current in the body of the message
Re: syslogd: Too many '/' in /dev//console
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 - 1.84 +++ syslogd.c 4 Sep 2001 19:04:25 - @@ -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
Re: syslogd: Too many '/' in /dev//console
On 04-Sep-2001 Giorgos Keramidas wrote: | | The following patch seems to have fixed the bug for me. | Yea, Kris said he was going to fix it. This must be some undefined behavior because I tested the change in a test program and the two sizeofs were giving me the same result..strange ;) Mike -- Mike Heffner mheffner@[acm.]vt.edu Blacksburg, VA [EMAIL PROTECTED] PGP signature
syslogd: Too many '/' in /dev//console
Between last weekend and this weekend, something changed in syslogd seems to have resulted in this boot-time error. The syslogd.c deltas from 1.82 - 1.83 look suspect since the handling of relevant variables has changed. To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-current in the body of the message
Re: syslogd: Too many '/' in /dev//console
On Monday, September 3, 2001, at 03:42 PM, [EMAIL PROTECTED] wrote: Between last weekend and this weekend, something changed in syslogd seems to have resulted in this boot-time error. The syslogd.c deltas from 1.82 - 1.83 look suspect since the handling of relevant variables has changed. To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-current in the body of the message Sorry for the double post -- to reproduce this problem it's necessary to run syslogd with the -s switch -- either no -s or -s -s fails to generate this error. To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-current in the body of the message
RE: syslogd: Too many '/' in /dev//console
On 03-Sep-2001 [EMAIL PROTECTED] wrote: | Between last weekend and this weekend, something changed in syslogd | seems to have resulted in this boot-time error. The syslogd.c deltas | from 1.82 - 1.83 look suspect since the handling of relevant variables | has changed. This change looks wrong: @@ -1679,16 +1659,17 @@ cfline(line, f, prog, host) f-f_type = F_CONSOLE; else f-f_type = F_TTY; -(void)strcpy(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 { Mike -- Mike Heffner mheffner@[acm.]vt.edu Blacksburg, VA [EMAIL PROTECTED] PGP signature
RE: syslogd: Too many '/' in /dev//console
On 04-Sep-2001 Mike Heffner wrote: | | On 03-Sep-2001 [EMAIL PROTECTED] wrote: || Between last weekend and this weekend, something changed in syslogd || seems to have resulted in this boot-time error. The syslogd.c deltas || from 1.82 - 1.83 look suspect since the handling of relevant variables || has changed. | | This change looks wrong: | Argh, nevermind. It doesn't appear to make any difference. Mike -- Mike Heffner mheffner@[acm.]vt.edu Blacksburg, VA [EMAIL PROTECTED] PGP signature
Re: syslogd: Too many '/' in /dev//console
On Tue, Sep 04, 2001 at 12:28:28AM -0400, Mike Heffner wrote: On 03-Sep-2001 [EMAIL PROTECTED] wrote: | Between last weekend and this weekend, something changed in syslogd | seems to have resulted in this boot-time error. The syslogd.c deltas | from 1.82 - 1.83 look suspect since the handling of relevant variables | has changed. This change looks wrong: @@ -1679,16 +1659,17 @@ cfline(line, f, prog, host) f-f_type = F_CONSOLE; else f-f_type = F_TTY; -(void)strcpy(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 { Oops, that was a last minute change to try and impose some style consistency on my changes (if not the entire file). I'll fix it. Kris PGP signature