From owner-freebsd-rc@FreeBSD.ORG Wed Jun 15 16:30:18 2005 Return-Path: X-Original-To: freebsd-rc@hub.freebsd.org Delivered-To: freebsd-rc@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8E77F16A41C for ; Wed, 15 Jun 2005 16:30:18 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 73D5543D1F for ; Wed, 15 Jun 2005 16:30:18 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j5FGUIXB071755 for ; Wed, 15 Jun 2005 16:30:18 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j5FGUI4L071754; Wed, 15 Jun 2005 16:30:18 GMT (envelope-from gnats) Date: Wed, 15 Jun 2005 16:30:18 GMT Message-Id: <200506151630.j5FGUI4L071754@freefall.freebsd.org> To: freebsd-rc@FreeBSD.org From: Matteo Riondato Cc: Subject: Re: kern/63954: devfs loses permissions X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Matteo Riondato List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jun 2005 16:30:18 -0000 The following reply was made to PR kern/63954; it has been noted by GNATS. From: Matteo Riondato To: bug-followup@FreeBSD.org, edwin@mavetju.org, mmolteni@cisco.com, freebsd-rc@freebsd.org Cc: Subject: Re: kern/63954: devfs loses permissions Date: Wed, 15 Jun 2005 18:27:44 +0200 Patch for this against /etc/rc.d/devfs follows and can be found at http://www.riondabsd.net/diff/devfs.diff. Please note that this patch includes fix for PR bin/65693 (wildcarded device names in devfs.conf ). I hope someone will pick this up and commit the patch. --- devfs.old Wed Jun 8 22:50:32 2005 +++ devfs Wed Jun 15 14:50:37 2005 @@ -37,25 +37,44 @@ read_devfs_conf } + +do_action() +{ + case "$1" in + l*) if [ -c $2 -a ! -e $3 ]; then + ln -fs $2 $3 + fi + ;; + o*) if [ -c $2 ]; then + chown $3 $2 + fi + if echo $3 | grep -q : ; then + uid=${3%%:*} + gid=${3##*:} + devfs rule add path $2 user $uid group $gid + devfs rule apply path $2 user $uid group $gid + else + devfs rule add path $2 user $3 + devfs rule apply path $2 user $3 + fi + ;; + p*) if [ -c $2 ]; then + chmod $3 $2 + fi + devfs rule add path $2 mode $3 + devfs rule apply path $2 + ;; + esac +} + read_devfs_conf() { if [ -r /etc/devfs.conf ]; then cd /dev while read action device parameter; do - case "${action}" in - l*) if [ -c ${device} -a ! -e ${parameter} ]; then - ln -fs ${device} ${parameter} - fi - ;; - o*) if [ -c ${device} ]; then - chown ${parameter} ${device} - fi - ;; - p*) if [ -c ${device} ]; then - chmod ${parameter} ${device} - fi - ;; - esac + for dev_name in ${device}; do + do_action ${action} ${dev_name} ${parameter} + done done < /etc/devfs.conf fi } Best Regards -- Rionda aka Matteo Riondato G.U.F.I. Staff Member (http://www.gufi.org) FreeSBIE Developer (http://www.freesbie.org)