Subject: bug#17103: regression: cp -al doesn't copy symlinks, but tries to link to them (fail)

From: Paul Eggert <[email-masked]>
Date: Wed, 26 Mar 2014 15:48:08 -0700

Linda Walsh wrote:
> Any idea how this managed to be broken?

My guess is that it's SELinux.  Try doing the following:

1.  Create 'dir' as before.
2.  As the user, run the following shell commands:

LC_ALL=C
export LC_ALL
ln dir/a/symfile dir/b

Assuming this fails, look at the output of:

strace ln dir/a/symfile dir/b

My guess is that you'll see something like this:

linkat(AT_FDCWD, "dir/a/symfile", AT_FDCWD, "dir/b/symfile", 0) = -1 
EPERM (Operation not permitted)

If so, the problem would appear to be in SELinux itself.