All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thorsten Kukuk <kukuk@suse.de>
To: selinux@tycho.nsa.gov
Subject: Re: Symlinks with wrong context after copy
Date: Fri, 17 Oct 2003 16:17:01 +0200	[thread overview]
Message-ID: <20031017141701.GA2002@suse.de> (raw)
In-Reply-To: <1066399798.31764.132.camel@moss-spartans.epoch.ncsc.mil>

On Fri, Oct 17, Stephen Smalley wrote:

> 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).

Yes, and the problem is, that somebody follows symlinks instead of
using the attributes of the symlinks itself. 

> Are you using the SELinux coreutils patch or the EA coreutils patch?  

I tried the SELinux coreutils patch on our own coreutils and the
RH binaries.

> 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.

But this doesn't matter: the binary itself is copied correct with
SElinux attributes, the symlink is not.

  Thorsten

-- 
Thorsten Kukuk       http://www.suse.de/~kukuk/        kukuk@suse.de
SuSE Linux AG        Deutschherrnstr. 15-19        D-90429 Nuernberg
--------------------------------------------------------------------    
Key fingerprint = A368 676B 5E1B 3E46 CFCE  2D97 F8FD 4E23 56C6 FB4B

--
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.

  reply	other threads:[~2003-10-17 14:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-17 13:32 Symlinks with wrong context after copy Thorsten Kukuk
2003-10-17 14:09 ` Stephen Smalley
2003-10-17 14:17   ` Thorsten Kukuk [this message]
2003-10-17 15:05     ` Stephen Smalley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20031017141701.GA2002@suse.de \
    --to=kukuk@suse.de \
    --cc=selinux@tycho.nsa.gov \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.