Bug 13156

Summary: /usr/src/usr.bin/chown should be /usr/src/bin/chown
Product: Base System Reporter: papowell
Component: binAssignee: Sheldon Hearn <sheldonh>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Unspecified   
Hardware: Any   
OS: Any   

Description papowell 1999-08-15 19:20:01 UTC
chown is used by /dev/MAKEDEV, and is needed to create
devices.  If you are trying to recover from a failed disk or
install a new disk and chown is not available in /bin or /sbin
you cannot create the necessary device nodes.

Note that mknod is in /sbin, chmod is in /bin,  but chown is in /usr/bin
which is a very odd place for it.  It should probably be in /sbin or /bin

Patrick Powell

(Note:  I am surprised this has not become more visible)

Fix: 

mv /usr/src/usr.bin/chown /usr/src/sbin/
Update Distribution, fling it to the winds,  update change log.
How-To-Repeat: Ummm... crash your system,  and have only root available,
do:
mount -u /
cd /dev
MAKEDEV sd0
and see the error messages
Comment 1 Sheldon Hearn freebsd_committer freebsd_triage 1999-08-16 17:54:06 UTC
State Changed
From-To: open->feedback

I'm waiting for the originator to let me know whether he's happy with me 
closing the PR. 


Comment 2 Sheldon Hearn freebsd_committer freebsd_triage 1999-08-16 17:54:06 UTC
Responsible Changed
From-To: freebsd-bugs->sheldonh

I'll wait for feedback. :-) 

Comment 3 Sheldon Hearn 1999-08-16 17:55:20 UTC
> >How-To-Repeat:
> Ummm... crash your system,  and have only root available,
> do:
> mount -u /
> cd /dev
> MAKEDEV sd0
> and see the error messages

Indeed, they're ugly, but they're not fatal and don't stop you getting
your system far enough for you to be able to mount /usr .

While this _is_ annoying, it's all but cosmetic. Both OpenBSD nor
NetBSD have their chown in /usr/sbin . Personally, I'm not wild about
having any more statically linked programs in the base system than are
absolutely necessary.

So, given that you don't actually _need_ chown to get the system back up
on its feet, do you still think chown should be /sbin ? :-)

Later,
Sheldon.
Comment 4 Sheldon Hearn 1999-08-17 06:27:00 UTC
On Mon, 16 Aug 1999 14:54:50 MST, papowell@astart.com wrote:

> Ummm... yes... you do.  If you need to use /dev/MAKEDEV to do so
> you are in deep trouble.

Did you actually read my comments? I tried to explain that chown failure
in MAKEDEV is non-fatal. So whatever it creates is owned by the uid
under which MAKEDEV is run. Since that should be the super-user's uid,
the fact that MAKEDEV's progeny have incorrect ownership doesn't matter
while you're "bringing the system back from the dead".

Once you've created device special files for your slices, you can mount
the appropriate partition containing the chown command and re-run
MAKEDEV for the appropriate devices.

If you still don't agree with me, a real How-To-Repeat with
step-by-step instructions would help. Obviously, I'd want to see that
the absence of chown makes it _impossible_ to bring a broken system up
in the case where the existance of chown would make it possible.

Let me know what you think. Basically, I think your latter PR was valid
and I've actioned that one. This one I'd like to close. :-)

Ciao,
Sheldon.
Comment 5 Sheldon Hearn freebsd_committer freebsd_triage 1999-08-18 14:35:23 UTC
State Changed
From-To: feedback->closed

The originator and I have agreed in private mail that error 
messages about a missing chown when /usr isn't mounted, while  
annoying, probably aren't a strong enough motivation to move 
chown into /sbin.