rename strangeness, a possible bug

Glenn Zazulia glenn at greenber.austin.ibm.com
Tue Aug 29 09:58:31 AEST 1989


In article <24612 at santra.UUCP> jkp at cs.HUT.FI (Jyrki Kuoppala) writes:
>drwxrwxr-x  4 root     staff         512 Aug 25 01:04 ./
>drwxr-xr-x  6 nobody   wheel         512 Aug 23 23:33 ../
>drwxr-xr-x  2 haa      staff         512 Aug 24 16:32 OS-hd-fix/
>drwxrwxr-x  4 jkp      staff         512 Aug 25 01:04 local/
>
> ...
>
>According to the documentation (rename(2) and mv(1)) there's no reason
>the `mv OS-hd-fix local' shouldn't work.  This seems like a bug.
>

When rename()ing a directory to a different parent directory, it is necessary
to have write permission of the directory that is being moved.  The reason is
that the ".." entry in the directory being renamed needs to be modified to
point to the new parent directory.

This is one of the few instances when the process needs write access to the
file being renamed, and I have never seen this fact documented.

Glenn Zazulia

>> This .signature intentionally left blank <<



More information about the Comp.unix.wizards mailing list