NetBSD Problem Report #42300

From  Tue Nov 10 13:12:18 2009
Return-Path: <>
Received: from ( [])
	by (Postfix) with ESMTP id BEFDC63B8CD
	for <>; Tue, 10 Nov 2009 13:12:17 +0000 (UTC)
Message-Id: <>
Date: Tue, 10 Nov 2009 07:12:14 -0600 (CST)
From: (T. M. Pederson)
Reply-To: (T. M. Pederson)
Subject: name space confusion in /etc/rc.d/syslogd
X-Send-Pr-Version: 3.95

>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

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD:,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.