Traversing symlinks

Martin Geisler mg at aragost.com
Thu May 19 12:42:52 CDT 2011


Isaac Jurado <diptongo at gmail.com> writes:

> On Thu, May 19, 2011 at 3:00 PM, Dominik Psenner <dpsenner at gmail.com> wrote:
>>
>>> You'll be disappointed to learn that Unix has been playing nanny and
>>> preventing users from hardlinking directories since at least 1976.
>>> See line 5921 in Lions' if you have a copy handy. And you know
>>> something is a -seriously- bad idea if Unix won't let you do it.
>>
>> I'm aware that the unix world prevents normal users from hardlinking,
>> but still: superusers can do and there are usecases where it makes
>> sense.
>
> Superusers can hard-link a directory? Excuse me, but I'm lost at this
> point:
>
>     root at findus:~# mkdir testdir
>     root at findus:~# ln testdir link_to_testdir
>     ln: `testdir': hard link not allowed for directory

My manpage has

        -d, -F, --directory
              allow  the  superuser  to attempt to hard link directories (note:
              will probably fail due to system restrictions, even for the supe-
              ruser)

It failed for me when I tried it:

  $ ln foo bar -d
  ln: creating hard link `bar' => `foo': Operation not permitted

-- 
Martin Geisler

aragost Trifork
Professional Mercurial support
http://mercurial.aragost.com/kick-start/


More information about the Mercurial-devel mailing list