[ET Trac] [Einstein Toolkit] #453: Formaline deletes files if lib and src are symlinks
Einstein Toolkit
trac-noreply at einsteintoolkit.org
Tue Jun 21 04:43:04 CDT 2011
#453: Formaline deletes files if lib and src are symlinks
----------------------------+-----------------------------------------------
Reporter: barry.wardell | Owner:
Type: defect | Status: new
Priority: major | Milestone:
Component: Cactus | Version:
Resolution: | Keywords:
----------------------------+-----------------------------------------------
Comment (by hinder):
It looks like the "link" command is first resolving the symlink to the
original directory, and it appears from the description here
http://pubs.opengroup.org/onlinepubs/009695399/functions/link.html
that this is the POSIX behaviour (this is not said explicitly, but it is
implied in the discussion of resolving symlinks). On Mac OS, where hard
links to directories are allowed, this leads to a directory hard link dir4
which should have the same inode as dir3. Hence when you do a recursive
delete on dir4, the contents of dir3 are deleted as well. This is
probably one of the reasons that hard links to directories are not
generally supported in Unix, and as far as I can tell, cannot be created
using the "ln" command, only by the underlying "link" system call. On
Linux, where hard links to directories are not allowed, it looks like the
Perl "link" command is either not resolving the symlink, and hence
creating a hard link to the symlink, or it is creating a new symlink to
the dir2 resolved symlink. You could check the inode of the symlink to
find out which.
--
Ticket URL: <https://trac.einsteintoolkit.org/ticket/453#comment:5>
Einstein Toolkit <http://einsteintoolkit.org>
The Einstein Toolkit
More information about the Trac
mailing list