All of lore.kernel.org
 help / color / mirror / Atom feed
* next try at refpolicy-gentoo patches
@ 2006-01-19 20:33 Serge E. Hallyn
  2006-01-19 21:11 ` Serge E. Hallyn
  2006-01-19 22:48 ` Christopher J. PeBenito
  0 siblings, 2 replies; 4+ messages in thread
From: Serge E. Hallyn @ 2006-01-19 20:33 UTC (permalink / raw)
  To: SELinux

The following set of patches lets me log in locally on a
gentoo system in enforcing mode.

First, label the serial ports as tty devices:

Index: refpolicy/policy/modules/kernel/terminal.fc
===================================================================
--- refpolicy.orig/policy/modules/kernel/terminal.fc
+++ refpolicy/policy/modules/kernel/terminal.fc
@@ -24,3 +24,6 @@
 /dev/vcs[^/]*		-c	gen_context(system_u:object_r:tty_device_t,s0)
 
 /dev/usb/tty.*		-c	gen_context(system_u:object_r:usbtty_device_t,s0)
+ifdef(`distro_gentoo', `
+/dev/tts/[0-9]*		-c	gen_context(system_u:object_r:tty_device_t,s0)
+')

Second, unix_chkpwd is under /usr/sbin/ under gentoo:

Index: refpolicy/policy/modules/system/authlogin.fc
===================================================================
--- refpolicy.orig/policy/modules/system/authlogin.fc
+++ refpolicy/policy/modules/system/authlogin.fc
@@ -12,6 +12,11 @@
 /sbin/pam_console_apply	 --	gen_context(system_u:object_r:pam_console_exec_t,s0)
 /sbin/pam_timestamp_check --	gen_context(system_u:object_r:pam_exec_t,s0)
 /sbin/unix_chkpwd	--	gen_context(system_u:object_r:chkpwd_exec_t,s0)
+
+ifdef(`distro_gentoo', `
+/usr/sbin/unix_chkpwd	--	gen_context(system_u:object_r:chkpwd_exec_t,s0)
+')
+
 /sbin/unix_verify	--	gen_context(system_u:object_r:chkpwd_exec_t,s0)
 ifdef(`distro_suse', `
 /sbin/unix2_chkpwd	--	gen_context(system_u:object_r:chkpwd_exec_t,s0)

Third, I need to send sighld from user_t to local_login_t on login,
else I get an endless series of error messages on console
(login: waitpid (6328, NULL, 0) failed: No child processes)
Is this really gentoo-specific?

Index: refpolicy/policy/modules/system/userdomain.if
===================================================================
--- refpolicy.orig/policy/modules/system/userdomain.if
+++ refpolicy/policy/modules/system/userdomain.if
@@ -33,6 +33,10 @@ template(`base_user_template',`
 	role $1_r types $1_t;
 	allow system_r $1_r;
 
+	ifdef(`distro_gentoo',`
+		allow $1_t local_login_t:process { sigchld };
+	')
+
 	# user pseudoterminal
 	type $1_devpts_t;
 	term_user_pty($1_t,$1_devpts_t)

Lastly, like with redhat, /dev is tmpfs, so user terminals need to be
able to associate with tmpfs.

Index: refpolicy/policy/modules/kernel/terminal.if
===================================================================
--- refpolicy.orig/policy/modules/kernel/terminal.if
+++ refpolicy/policy/modules/kernel/terminal.if
@@ -88,6 +88,9 @@ interface(`term_tty',`
 		type_change $1 ttynode:chr_file $2;
 	')
 
+	ifdef(`distro_gentoo',`
+		fs_associate_tmpfs($2)
+	')
 	ifdef(`distro_redhat',`
 		fs_associate_tmpfs($2)
 	')

thanks,
-serge

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-01-19 22:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-01-19 20:33 next try at refpolicy-gentoo patches Serge E. Hallyn
2006-01-19 21:11 ` Serge E. Hallyn
2006-01-19 22:48   ` Christopher J. PeBenito
2006-01-19 22:48 ` Christopher J. PeBenito

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.