Research Menu

.
Skip Search Box

SELinux Mailing List

Re: Symlinks with wrong context after copy

From: Stephen Smalley <sds_at_epoch.ncsc.mil>
Date: 17 Oct 2003 10:09:58 -0400


On Fri, 2003-10-17 at 09:32, Thorsten Kukuk wrote:
> Hi,
>
> I don't know if this is a libattr or a selinux bug:
>
> Symlinks have wrong attributes after copying:
>
> dilbert:~ # ls --context /lib/ld-*
> -rwxr-xr-x root root system_u:object_r:ld_so_t /lib/ld-2.3.2.so
> lrwxrwxrwx root root system_u:object_r:ld_so_t /lib/ld-linux.so.2 -> ld-2.3.2.so
>
> dilbert:~ # cp -dp /lib/ld-* .
> dilbert:~ # ls --context ld-*
> -rwxr-xr-x root root system_u:object_r:ld_so_t ld-2.3.2.so
> lrwxrwxrwx root root system_u:object_r:sysadm_home_dir_t ld-linux.so.2 -> ld-2.3.2.so
>
> any ideas what goes wrong?

The implication is that the attributes on the copied symlink weren't explicitly set, so they were instead left with the default (inheriting from the parent directory, unless otherwise configured by policy). Are you using the SELinux coreutils patch or the EA coreutils patch? Also, IIRC, there was a specific decision in the SELinux coreutils patch to not include the SELinux attributes as part of -p; you have to explicitly specify -c or --preserve=all or --preserve=context. Otherwise, a number of programs that use -p will break because they aren't authorized to preserve the MAC security label.

-- 
Stephen Smalley <sds@epoch.ncsc.mil>
National Security Agency


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.
Received on Fri 17 Oct 2003 - 10:10:15 EDT
 

Date Posted: Jan 15, 2009 | Last Modified: Jan 15, 2009 | Last Reviewed: Jan 15, 2009

 
bottom

National Security Agency / Central Security Service