NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

misc/42300: name space confusion in /etc/rc.d/syslogd

>Number:         42300
>Category:       misc
>Synopsis:       /etc/rc.d/syslogd assumes file names always match a variable 
>in the file instead of reading the variable
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    misc-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Nov 10 13:15:01 +0000 2009
>Originator:     T. M. Pederson
>Release:        NetBSD 5.0_STABLE
T. M. Pederson <>
GPG key fingerprint = FFAF D056 F12B E03F 7084  1288 EF8B E1FE 1693 21EB
+Accept: text/plain; charset=ISO-8859-*,UTF-*
System: NetBSD 5.0_STABLE NetBSD 5.0_STABLE (ECHO) #5: Wed 
Oct 28 08:00:06 CDT 2009 sparc64
Architecture: sparc64
Machine: sparc64
        When /etc/rc.d/syslogd checks for chroot daemons, it assumes that
        their files in /etc/rc.d/ have names that exactly match the name
        variable inside the file. Locally maintained daemons sometimes lack
        synchronization between the two name spaces, and syslogd then works
        poorly with the chroot'd daemon.
        Add a chroot'd daemon whose file in /etc/rc.d/ has a name that differs
        from the name variable inside the file.
        Patch /etc/rc.d/syslogd to read the variable instead of the file name.
        The patch below is in use locally. I expect awk would be more typical
        here, but I'm better with sed.
--- /etc/rc.d/syslogd.orig      2004-10-11 08:29:52.000000000 -0500
+++ /etc/rc.d/syslogd   2009-11-10 06:24:21.000000000 -0600
@@ -37,7 +37,7 @@
        for _lr in $(rcorder -k chrootdir /etc/rc.d/*); do
-               _l=${_lr##*/}
+               eval $(sed -n -e '/^name=/s/name/_l/' -e '/^_l=/p' ${_lr})
                load_rc_config ${_l}
                eval _ldir=\$${_l}_chrootdir
                if checkyesno $_l && [ -n "$_ldir" ]; then

Home | Main Index | Thread Index | Old Index