Rename bug?

Chris Torek chris at mimsy.UUCP
Wed May 25 08:10:16 AEST 1988


In article <9312 at eddie.MIT.EDU> nathan at eddie.MIT.EDU (Nathan Glasser) writes:
>On my vax running 4.3bsd ... rename("foo","foo"); ...
>will remove the file foo.

Sounds like you have a hacked 4.3BSD.  From /sys/sys/ufs_syscalls.c:

                /*
                 * Short circuit rename(foo, foo).
                 */
                if (xp->i_number == ip->i_number)
                        goto bad;

This is, of course, not quite right:

    link("foo", "bar"); rename("foo", "bar");

leaves both foo and bar around, where one would expect it to remove
file foo.
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain:	chris at mimsy.umd.edu	Path:	uunet!mimsy!chris



More information about the Comp.unix.questions mailing list