From: Stephen Smalley <sds@tycho.nsa.gov>
To: Sam Gandhi <samgandhi9@gmail.com>
Cc: Daniel J Walsh <dwalsh@redhat.com>, selinux@tycho.nsa.gov
Subject: Re: Is it possible to assign different labels to symbolic links and actual files?
Date: Wed, 25 May 2011 08:41:02 -0400 [thread overview]
Message-ID: <1306327263.26019.1.camel@moss-pluto> (raw)
In-Reply-To: <BANLkTi=eLtqov9i0pXpXJkwNK74cc4mUAw@mail.gmail.com>
On Tue, 2011-05-24 at 14:46 -0700, Sam Gandhi wrote:
> On Tue, May 24, 2011 at 2:07 PM, Daniel J Walsh <dwalsh@redhat.com> wrote:
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA1
> >
> > On 05/24/2011 04:46 PM, Sam Gandhi wrote:
> >> Hello,
> >>
> >> I am working on a embedded platform and we have busybox on this device.
> >>
> >> What we would like to do do is assign diffrent labels to various
> >> busybox links. What we have seen when running things on JFFS2 when I
> >> label a symbolic link, the actual file gets the label, but the link
> >> itself doesn't (according to ls -lZ output). We have seen similar
> >> behaviour with files on tmpfs as well.
> >>
> >> ls -lZ
> >> -rw-r--r-- 1 0 Jan 1 00:12 system_u:object_r:myfile_t X
> >> lrwxrwxrwx 1 1 Jan 1 00:13 user_u:object_r:tmpfs_t Y -> X
> >>
> >> Is there no way to assign different label to symlink and actual files?
> >> Is this file-system specific issue? Are there any file-system that
> >> support assigning seperate labels to symlink and actual file?
> >>
> >> -Sam
> >>
> >> --
>
> >>
> >>
> > Yes you can label symbolic links differently then their targets, how are
> > you assiging the labels?
> >
>
> I am using setfilecon program found in package
> On tmpfs file I did :
>
> cd /tmp/
> touch X
> ln -s X Y
> setfilecon system_u:object_r:myfile_t Y
>
> And I see ls -lZ output as I shown above which shows /tmp/X has the
> myfile_t label and not Y
>
> I can't really use tools like semanage 'cause I can't install python
> on this system. I will try to "reverse" engineer what semanage does
> and how it handles symlink v/s regular files.
Just change setfilecon to call lsetfilecon() instead of setfilecon().
Or use setfiles or chcon instead.
--
Stephen Smalley
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.
next prev parent reply other threads:[~2011-05-25 12:41 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-24 20:46 Is it possible to assign different labels to symbolic links and actual files? Sam Gandhi
2011-05-24 21:07 ` Daniel J Walsh
2011-05-24 21:46 ` Sam Gandhi
2011-05-25 11:58 ` Daniel J Walsh
2011-05-25 12:15 ` Russell Coker
2011-05-25 12:41 ` Stephen Smalley [this message]
2011-05-24 21:15 ` Dominick Grift
2011-05-24 21:21 ` Guido Trentalancia
2011-05-24 22:53 ` Russell Coker
2011-05-25 2:27 ` Sam Gandhi
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=1306327263.26019.1.camel@moss-pluto \
--to=sds@tycho.nsa.gov \
--cc=dwalsh@redhat.com \
--cc=samgandhi9@gmail.com \
--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.