* Writing policy: default_contexts etc.
@ 2012-07-23 12:49 Ole Kliemann
0 siblings, 0 replies; only message in thread
From: Ole Kliemann @ 2012-07-23 12:49 UTC (permalink / raw)
To: selinux
[-- Attachment #1: Type: text/plain, Size: 1733 bytes --]
I'm in the process of writing a simple policy from scratch.
Everything works as expected, except for logins.
I have a user named tfm on my system.
/etc/selinux/mypolicy/seusers looks like:
tfm:tfm_u
root:system_u
In my policy I have a user tfm_u with roles tfm_r. tfm_r has
several types, for example xserver_tfm_t. I also have a user
system_u with role unconfined_r and type unconfined_t.
Using runcon I can transition from
system_u:unconfined_r:unconfined_t to tfm_u:tfm_r:xserver_tfm_t.
I figured I have to tell the login programs which context to
choose per default. My login programs run as
system_u:unconfined_r:unconfined_t, so I added to
/etc/selinux/mypolicy/contexts/default_contexts the line
unconfined_r:unconfined_t tfm_r:xserver_tfm_t
I also have in /etc/selinux/mypolicy/contexts/default_type
unconfined_r:unconfined_t
tfm_r:xserver_tfm_t
I can login as root and have context
system_u:unconfined_r:unconfined_t.
I cannot login as tfm, because:
pam_selinux(login:session): Unable to get valid context for tfm
Apparently I am missing something, just can't find what.
In general I find it difficult to find comprehensive
documentation about the userland tools' interaction with the
policy conifguration. On top of that error messages are often
uninformative. (Random example: when the file
/etc/selinux/mypolicy/contexts/files/file_contexts is missing,
useradd without any output exits with return code 12. Which says
'cannot create homedir' but contains no clue about the reason for
the failure.)
So any hint on the above problem or hints on good places I could
read up on the topic would be highly appreciated!
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2012-07-23 12:50 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-23 12:49 Writing policy: default_contexts etc Ole Kliemann
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.