Subject: Re: while we're looking at old bugs
To: Jim Wise <jimw@numenor.turner.com>
From: John F. Woods <jfw@jfwhome.funhouse.com>
List: current-users
Date: 10/06/1997 08:25:15
> Given that we can assume _POSIX_RESTRICTED_CHOWN, should we be
> trying this call to fchown(2)?  i.e., should NetBSD mv(1) have different
> semantics in superuser state?

I don't know how to objectively answer "should", but:

tar(1) does (and specifically tests for running as root before trying).

cpio(1) does (it tries the chown and is silent if the failure is EPERM).

cp(1) does if you ask for it (with -p), but is silent if it can't give you
what you asked for.

pax(1) "doesn't", in the sense that you have to ask for preserving uid/gid
and you get warning messages if that fails for any reason.

ls(1) does, too, though it's not quite of the same class of program.  (How
is it different?  ls assumes the -A flag for superuser.)

I'd say there's substantial precedent for having additional semantics when
run by superuser.