Skip to contentSkip to conversation

allow users of tmp_domain to read /usr/tmp

PATCH In review Colin Walters 2 participants 3 messages Jan 12, 2005 SELinux security module

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 allow users of tmp_domain to read /usr/tmp

Hi,

On Fedora at least, /usr/tmp is a symlink to /var/tmp. Users of tmp_domain get write access to tmp_t:dir, so I think it makes sense to automatically grant access to tmp_t:lnk_file as well, so that programs which refer to /usr/tmp work. This should be safe since as discussed earlier no non-unconfined domain can create tmp_t:lnk_file.

This came up on the #fedora-selinux channel where a user was trying to get their CGI script to work.

macros/global_macros.te renamed from macros/global_macros.te~ +1 -0
@@ -409,6 +409,7 @@
 ifelse($3, `',
 `file_type_auto_trans($1_t, tmp_t, $1_tmp_t, `{ file dir }')',
 `file_type_auto_trans($1_t, tmp_t, $1_tmp_t, `$3')')
+allow $1_t tmp_t:lnk_file { getattr read };
 ')
 
 define(`tmpfs_domain', `
#1 lore raw
Quoted 10 lines · Colin Walters

Hi,

On Fedora at least, /usr/tmp is a symlink to /var/tmp. Users of tmp_domain get write access to tmp_t:dir, so I think it makes sense to automatically grant access to tmp_t:lnk_file as well, so that programs which refer to /usr/tmp work. This should be safe since as discussed earlier no non-unconfined domain can create tmp_t:lnk_file.

This came up on the #fedora-selinux channel where a user was trying to get their CGI script to work.

Hmm...I had thought that we had agreed that /usr/tmp should be dropped from types.fc and left in usr_t, then just allow read to usr_t:lnk_file as a safer approach. In fact, the current types.fc file only assigns tmp_t if /usr/tmp is a directory (via the -d flag), and it is labeled usr_t on my FC3 systems (strict).

Signature · 8 lines
Stephen Smalley <[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.
#2 lore raw
Quoted 9 lines · Stephen Smalley
Quoted 8 lines · Colin Walters

Hi,

On Fedora at least, /usr/tmp is a symlink to /var/tmp. Users of tmp_domain get write access to tmp_t:dir, so I think it makes sense to automatically grant access to tmp_t:lnk_file as well, so that programs which refer to /usr/tmp work. This should be safe since as discussed earlier no non-unconfined domain can create tmp_t:lnk_file.

Quoted 8 lines
Quoted 2 lines

This came up on the #fedora-selinux channel where a user was trying to get their CGI script to work.

Hmm...I had thought that we had agreed that /usr/tmp should be dropped from types.fc and left in usr_t, then just allow read to usr_t:lnk_file as a safer approach. In fact, the current types.fc file only assigns tmp_t if /usr/tmp is a directory (via the -d flag), and it is labeled usr_t on my FC3 systems (strict).

Ok, sounds reasonable. So I just needed to relabel then with the latest policy. Another reason we need automatic relabeling :)