Subject: admin/12665: /etc/rc.d/sysdb needs quotes for long filenames with spaces
To: None <gnats-bugs@gnats.netbsd.org>
From: None <adam@algroup.co.uk>
List: netbsd-bugs
Date: 04/15/2001 06:47:53
>Number:         12665
>Category:       admin
>Synopsis:       /etc/rc.d/sysdb needs quotes for long filenames with spaces
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    netbsd-admin
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Apr 15 06:48:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Adam Laurie
>Release:        NetBSD 1.5U
>Organization:
A.L. Digital Ltd.
>Environment:
NetBSD gnugget 1.5U NetBSD 1.5U (GNUGGET) #2: Mon Apr  9 04:04:30 PDT 2001     root@gnugget:/usr/src/sys/arch/hpcmips/compile/GNUGGET hpcmips

>Description:
startup script sysdb gets boot name from sysctl (sysctl -n machdep.booted_kernel) - 
platforms with spaces in device names such hpcmips may produce something like:

  gnugget-root# sysctl -n machdep.booted_kernel
  \Storage Card2\netbsd

which will cause kvm_mkdb to fail with a usage error.

>How-To-Repeat:

>Fix:
apply the following patch...

diff -u  /usr/src/etc/rc.d/sysdb sysdb
--- /usr/src/etc/rc.d/sysdb     Sat Oct 14 00:33:39 2000
+++ sysdb       Sun Apr 15 02:29:33 2001
@@ -20,7 +20,7 @@
        #
        echo "Building databases..."
        booted_kernel=`sysctl -n machdep.booted_kernel 2>/dev/null`
-       kvm_mkdb ${booted_kernel:-/netbsd}
+       kvm_mkdb "${booted_kernel:-/netbsd}"
        dev_mkdb
 
        #       Re-create /var/run/utmp, which is deleted by mountcritlocal

>Release-Note:
>Audit-Trail:
>Unformatted: