2009/387 [Pathname Reparse Points]
Hugh McIntyre
lists at mcintyreweb.com
Sun Jul 12 19:48:27 PDT 2009
Joerg Schilling wrote:
> "Alan.M.Wright" <amw at sun.com> wrote:
>
>>> How will you prevent prople from removing these "reparse points" because they
>>> assume that this are symlinks that point to nowhere?
>>> Note that the official POSIX method for removing symlinks that do not point
>>> to a target is:
>>>
>>> find -L . -type l -exec rm {} +
>>>
>> Symlinks containing reparse data can be removed in the same way as
>> any other symlink. There are no special rules, conditions or restrictions.
>
> So you admit that people who intend to remove garbage symlinks will accidentally
> also remove these objects?
To be fair, if you have a symlink to an automounted file or directory
and the server is temporarily not accessible or automounter not running,
I suspect you'll similarly think the link is dangling. So you'd better
hope the automounter is in good shape and you have no network glitches
before using the "find" command above.
But this raises the point that if these special reparse symlinks were
implemented such that the reparsing also happened when the filesystem is
mounted locally via mount_zfs or mount_lofs, not just remotely over CIFS
or NFSv4, then most of the issues would go away.
In other words if open(), stat(), nftw(), and similar system calls
locally on the server hosting the files (including LOFS) access the
linked-to file, most code will think the link is OK. Since in this
case, "find -L" should point to the target of the reparse point (which
hopefully exists).
Assuming that most code does not call readlink() and do the pathname
traversal itself.
I think there was some question about this earlier in the thread, but
not necessarily a definitive answer.
Hugh.
[*] Even if some sysadmin setup is needed here.
More information about the opensolaris-arc
mailing list