Skip to contentSkip to conversation

screen patch

PATCH Thomas Bleher 3 participants 3 messages Oct 26, 2004 – Oct 29, 2004 SELinux security module

lore
Share & tools
lore
#0 lore raw

The following patch allows users to start screen with some other program than the shell, e.g. "screen vim /some/file". The given command forms the first session inside of screen.

Please apply.

Thomas

Signature · 2 lines
http://www.cip.ifi.lmu.de/~bleher/selinux/ - my SELinux pages
GPG-Fingerprint: BC4F BB16 30D6 F253 E3EA  D09E C562 2BAE B2F4 ABE7
macros/program/screen_macros.te +5 -2
@@ -42,7 +42,11 @@
 allow $1_screen_t urandom_device_t:chr_file read;
 
 # Revert to the user domain when a shell is executed.
-domain_auto_trans($1_screen_t, shell_exec_t, $1_t)
+domain_auto_trans($1_screen_t, { shell_exec_t bin_t }, $1_t)
+domain_auto_trans($1_screen_t, $1_home_t, $1_t)
+ifdef(`nfs_home_dirs', `
+domain_auto_trans($1_screen_t, nfs_t, $1_t)
+')
 
 # Inherit and use descriptors from gnome-pty-helper.
 ifdef(`gnome-pty-helper.te', `allow $1_screen_t $1_gph_t:fd use;')
@@ -106,7 +110,6 @@
 allow $1_screen_t self:unix_stream_socket create_socket_perms;
 allow $1_screen_t self:unix_dgram_socket create_socket_perms;
 
-can_exec($1_screen_t, shell_exec_t)
 allow $1_screen_t bin_t:dir search;
 allow $1_screen_t bin_t:lnk_file read;
 read_locale($1_screen_t)
#1 lore raw
Quoted 3 lines · Thomas Bleher

The following patch allows users to start screen with some other program than the shell, e.g. "screen vim /some/file". The given command forms the first session inside of screen.

Looks OK. But it still won't capture every case. Someone who uses screen to run a text mode irc client wouldn't get the result that they probably expect (irc running in user_irc_t).

We could define an attribute $1_launcher_domain and then have something like this in irc_macros.te:
domain_auto_trans($1_launcher_domain, { irc_exec_t $1_irc_exec_t }, $1_irc_t)

Then have something like this in x_client_macros.te:

domain_auto_trans($1_launcher_domain, $2_exec_t, $1_$2_t)

Signature · 9 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.
#2 lore raw
In reply to Thomas Bleher

Merged.

Quoted 7 lines · Thomas Bleher

The following patch allows users to start screen with some other program than the shell, e.g. "screen vim /some/file". The given command forms the first session inside of screen.

Please apply.

Thomas

Signature · 7 lines
James Carter <[email protected]>
National Security Agency

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