bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#17103: regression: cp -al doesn't copy symlinks, but tries to link t


From: Paul Eggert
Subject: bug#17103: regression: cp -al doesn't copy symlinks, but tries to link to them (fail)
Date: Wed, 26 Mar 2014 16:58:36 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0

I've managed to reproduce the problem on Fedora 20. It indeed is a kernel thing having to do with security. Not only can 'cp' not create hardlinks to symlinks; it also can't create hardlinks to regular files. The problem affects all applications, e.g., 'ln'.

Not much that coreutils can do about it, as far as I can see, as it's a kernel issue.

You can work around the problem by running 'cp' (or 'ln' etc.) as root.

Here's an example, where I am running as a regular (non-root) user that is not in the 'root' group:

$ find dir/a -ls
5300828    0 drwxrwxr-x   2 root     root           80 Mar 26 16:50 dir/a
5338695 4 -rw-r--r-- 1 root root 5 Mar 26 16:50 dir/a/data 5300831 0 lrwxrwxrwx 1 root root 9 Mar 26 11:20 dir/a/symfile -> ../b/file
$ mkdir d
$ ln dir/a/data d
ln: failed to create hard link ‘d/data’ => ‘dir/a/data’: Operation not permitted
$ ln dir/a/symfile d
ln: failed to create hard link ‘d/symfile’ => ‘dir/a/symfile’: Operation not permitted






reply via email to

[Prev in Thread] Current Thread [Next in Thread]