Skip to contentSkip to conversation

get_ordered_sid_list

DISCUSSION Stephen D. Smalley 2 participants 2 messages Dec 3, 2002 SELinux security module

lore
Share & tools
lore
#0 lore raw
Quoted 4 lines
  num_sids = get_ordered_sid_list (login, 0, sidlist, &sidlistlen);
Quoted 8 lines

the call returns 1 and the sid is
505 root:user_r:user_t

actual sids
504 root:sysadm_r:sysadm_t
505 root:user_r:user_t

Am I missing something obvious ?

get_ordered_sid_list only returns legal SIDs for the user that are reachable from the specified from_sid (or the current SID by default when from_sid is 0). In the example policy, xdm_t can only transition to unpriv_userdomain, so it can reach user_t but not sysadm_t.

Note that there is a test program in libsecure (libsecure/test/get_user_sids) that you can use to exercise these functions with a particular from SID and username, e.g. 'get_user_sids system_u:system_r:xdm_t root' displays root:user_r:user_t.

--
Stephen Smalley, NSA
[email protected]

--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.

#1 lore raw
Quoted 5 lines · Stephen D. Smalley

get_ordered_sid_list only returns legal SIDs for the user that are reachable from the specified from_sid (or the current SID by default when from_sid is 0). In the example policy, xdm_t can only transition to unpriv_userdomain, so it can reach user_t but not sysadm_t.

Before anyone asks, this was done for a reason. An xdm login runs all sorts of scripts that you probably don't want to have running with full administrative privs. Also after looking through the xdm/kdm source it's not something I'd trust as much as /bin/login...

Signature · 10 lines
http://www.coker.com.au/selinux/   My NSA Security Enhanced Linux packages
http://www.coker.com.au/bonnie++/  Bonnie++ hard drive benchmark
http://www.coker.com.au/postal/    Postal SMTP/POP benchmark
http://www.coker.com.au/~russell/  My home page


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.