Subject: misc/19125: etc.default can only be a relative path
To: None <>
From: None <>
List: netbsd-bugs
Date: 11/21/2002 18:29:00
>Number:         19125
>Category:       misc
>Synopsis:       etc.default can only be a relative path
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    misc-bug-people
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Thu Nov 21 10:26:01 PST 2002
>Originator:     Thomas Klausner
>Release:        NetBSD 1.6K
System: NetBSD 1.6K NetBSD 1.6K (KRAFTLACKEL) #0: Tue Nov 5 23:44:03 CET 2002 macppc
Architecture: powerpc
Machine: macppc
If /etc/etc.default points to an absolute path (like /etc/,
then the prompt during boot displays the whole output of
`ls -ld /etc/etc.default` instead of only the part after the dot, which
makes a very awkward prompt:
Which configuration [lrwxr-xr-x  1 root  wheel  9 Nov 20 00:33 /etc/etc.default ->]?

Use newbtconf to create symlink'ed /etc files, if you haven't done
so already.
rm /etc/etc.default
ln -s /etc/ /etc/etc.default

The problem lies in /etc/rc.d/

	if [ -h /etc/etc.default ]; then
		def=`ls -ld /etc/etc.default 2>&1`
		default="${def##*-> etc.}"

The pattern in the {} only matches on symlinks.
On the other hand, has the following code later on:
		rm -f /etc/etc.current
		ln -s /etc/etc.$conf /etc/etc.current
which makes /etc/etc.current an absolute path.

`ls -ld /etc/etc.current` is "parsed" in the same way but not
displayed, except if you have no etc.default symlink.

Fix the shell construct above to accept absolute paths; or
change the code later on to only create relative paths, like
		rm -f /etc/etc.current
		ln -s etc.$conf /etc/etc.current
Don't know which one is preferred.