Bug in mv command of SunOS 4?

Jonathan Sweedler nsc!taux01!tasu70.taux01.UUCP!cjosta at hplabs.hp.com
Thu Mar 2 10:26:49 AEST 1989


I tried to change the name of a file that belongs to someone else in a
directory that is writable by everyone.  In most Unix systems, this is
possible.  It seems that SunOS4 has added another 'security feature' and
disallowed this.  But... after I try to 'mv' such a file, and I am told
that I can't, a copy of the file exists.  For example:

1> mv file1 file2
mv: cdddta: rename: Not owner

2> ls -l file1 file2
-rw-------  2 cdddta          1 Feb 13 10:26 file1
-rw-------  2 cdddta          1 Feb 13 10:26 file2

It seems that this 'security check' is done after the link is created,
but before the original file is deleted.  Has anyone else seen this 
behavior?

Jonathan Sweedler  ===  National Semiconductor Israel
UUCP:    ...!{amdahl,hplabs,decwrl}!nsc!taux01!cjosta
Domain:  cjosta at taux01.nsc.com

[[ Yes.  This is not a bug.  This is a new feature that is also found in
4.3BSD.  See v7n108, v7n124 and v7n128.  The directory you were doing this
in must have had the "sticky" bit set.  Read the manual page "sticky(8)"
and "chmod(2)".  --wnl ]]



More information about the Comp.sys.sun mailing list