Skip to contentSkip to conversation

quickie additions to allow kde desktop to mount cdrom

DISCUSSION Luke Kenneth Casson Leighton 1 participant 1 message Jun 12, 2004 SELinux security module

lore
Share & tools
lore
#0 lore raw

in macros/user_macros.te, i added the section ifdef (`xdm.te' ...) this is a quick hack which enables me to do the mount of a cdrom desktop icon under KDE 3.2.2.

i have had to enable the /etc/selinux/tunable.te "user_can_mount" thing under which this hack becomes relevant.

the write to user_home_t is to allow mount write access to ~/.xsession-errors (and probably isn't needed) but the write to user_tmp_t is to be able to write to /tmp/kde-<username> which IS needed.

i am sure that there are other ways to do this, i am sure that that there are experts who forsee a problem with this approach:
all i can say is "It Works For Me (tm)".

feedback appreciated.

l.

	#
	#  Allow users to mount file systems like floppies and cdrom
	#
	mount_domain($1, $1_mount, `, fs_domain')
	role $1_r types $1_mount_t;
	r_dir_file($1_t, mnt_t)

	ifdef(`xdm.te', `
	domain_auto_trans(xdm_t, mount_exec_t, user_mount_t)
	#allow user_mount_t xdm_t:fd { use };
	#allow user_mount_t xdm_t:fifo_file { read };
	allow user_mount_t user_home_t:file { write };
	allow user_mount_t user_tmp_t:file { write };

	')

	')
Signature · 14 lines
-- 
Information I post is with honesty, integrity, and the expectation that
you will take full responsibility for acting on the information contained,
and that, should you find it to be flawed or even mildly useful, you
will act with both honesty and integrity in return - and tell me.
--
<a href="http://lkcl.net">      lkcl.net      </a> <br />
<a href="mailto:[email protected]"> [email protected] </a> <br />


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