Re: Symlinks vs. hardlinks
Hi,
tomas@tuxteam.de wrote:
> > > tomas@rasputin:~$ ln /home/test/.profile test-profile
> > > ln: failed to create hard link `test-profile' =>
> > > `/home/test/.profile': Operation not permitted
Seems to be a new security feature.
In "man 5 proc" i read
"/proc/sys/fs/protected_hardlinks (since Linux 3.6)
...
When the value in this file is 1, a hard
link can be created to a target file only if one of the follow‐
ing conditions is true:
...
* The caller has the CAP_FOWNER capability.
* The filesystem UID of the process creating the link matches
the owner (UID) of the target file [...]
* All of the following conditions are true:
...
· the caller has permission to read and write the target
file
"
So it is not enough to have w-permission of the directory where
the new link shall emerge. Ownership or rw-permission of the target
file is needed, too.
The described behavior is in effect here:
$ cat /proc/sys/fs/protected_hardlinks
1
Have a nice day :)
Thomas
Reply to: