GNU bug report logs -
#8831
[Ubuntu10.10] Impossible to create an hardlink without write access
Previous Next
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your bug report
#8831: [Ubuntu10.10] Impossible to create an hardlink without write access
which was filed against the coreutils package, has been closed.
The explanation is attached below, along with your original report.
If you require more details, please reply to 8831 <at> debbugs.gnu.org.
--
8831: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8831
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
On 2011-06-09 22:59 +0200, Bob Proulx wrote:
> Johan Oudinet wrote:
>> GNU coreutils 8.5
>> Ubuntu 10.10 32bits Ext4
>>
>> $ sudo touch f; ln f g
>> ln: creating hard link `g' => `f': Operation not permitted
>
> Thank you for the bug report. However I am unable to recreate this
> problem using 8.5 on my Debian system using ext3.
>
> $ sudo touch f
> $ ln f g
> $ ls -ldog f g
> -rw-r--r-- 2 0 Jun 9 14:55 f
> -rw-r--r-- 2 0 Jun 9 14:55 g
>
> Perhaps this is a problem with ext4? Can you run your test using
> strace so that we can see what the system is saying? Something like
> this following command.
>
> $ strace -e trace=file -o /tmp/ln.strace.out ln f g
>
> On my system I see this output:
>
> ...
> stat("g", 0x7fffa6430f10) = -1 ENOENT (No such file or directory)
> lstat("f", {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
> linkat(AT_FDCWD, "f", AT_FDCWD, "g", 0) = 0
>
>> However, the following commands work:
>> $ sudo touch f2; sudo chmod a+w f2; ln f2 g
>>
>> The first call to ln should be permitted too.
>
> As far as I can tell it is permitted. If it isn't then it would be a
> kernel limitation.
This is indeed due to an Ubuntu kernel patch that is present since
10.10. The rationale is given in
https://wiki.ubuntu.com/SecurityTeam/Roadmap/KernelHardening#Hardlink%20Protection.
I'm taking the liberty to close the bug.
Cheers,
Sven
[Message part 3 (message/rfc822, inline)]
*** System information ***
GNU coreutils 8.5
Ubuntu 10.10 32bits Ext4
*** Error description ***
$ sudo touch f; ln f g
ln: creating hard link `g' => `f': Operation not permitted
However, the following commands work:
$ sudo touch f2; sudo chmod a+w f2; ln f2 g
The first call to ln should be permitted too.
Regards,
--
Johan
This bug report was last modified 14 years and 44 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.