[net.bugs.v7] Bug in move

rascal (04/05/83)

Boy, am I ticked off.  I can't use "mv" from a suid'ed shell script.
You see, "mv" needs to be suid root in case someone wants to move a
directory (because joe-user isn't allowed to fool with directory links).
So, whenever "mv" decides not to move directories, it does a:
	setuid(getuid())
and (sometimes) execls "cp" to just copy the file.  Well, cp is running
with the real uid now since the old effective uid was lost when "mv"
started up as a suid program.

Seems to me that "mv" should start out regular and call "mvdir" when
it figures out that it is moving a directory.  After all, it's already
calling "cp" sometimes, so it's not such a big deal.  Of course, "mvdir"
doesn't exist yet....

Oh well. I'm gonna change that "mv" to a "cp" and an "rm" and keep on codin'