Skip to contentSkip to conversation

How to install CVS wine

DISCUSSION Ivan Gyurdiev 2 participants 8 messages Feb 4, 2005 – Feb 10, 2005

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

See, I used to have it under /src, but SElinux didn't like that, and kept complaining. I moved it under ~/src and relabeled to user_home_t. Now I do cvs update, build it as a regular user, and try to do:
su -c "make install". However, that doesn't work, because the sysadmin can't run user_home_t scripts. Should the sysadmin be able to run user_home_t scripts, or am I doing this the wrong way?

audit(1107498685.995:0): avc: denied { execute } for pid=29007 exe=/usr/bin/make name=mkinstalldirs dev=dm-2 ino=16332 scontext=root:sysadm_r:sysadm_t tcontext=root:object_r:user_home_t tclass=file

P.S. tools/wineinstall actually requires that wine be built as a regular user, and installed as root.

Signature · 8 lines
Ivan Gyurdiev <[email protected]>
Cornell University


--
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.
#1 lore raw
Quoted 7 lines · Ivan Gyurdiev

See, I used to have it under /src, but SElinux didn't like that, and kept complaining. I moved it under ~/src and relabeled to user_home_t. Now I do cvs update, build it as a regular user, and try to do:
su -c "make install". However, that doesn't work, because the sysadmin can't run user_home_t scripts. Should the sysadmin be able to run user_home_t scripts, or am I doing this the wrong way?

Quoted 7 lines

audit(1107498685.995:0): avc: denied { execute } for pid=29007 exe=/usr/bin/make name=mkinstalldirs dev=dm-2 ino=16332 scontext=root:sysadm_r:sysadm_t tcontext=root:object_r:user_home_t tclass=file

P.S. tools/wineinstall actually requires that wine be built as a regular user, and installed as root.

We'd prefer to avoid having sysadm_t be able to execute anything potentially untrustworthy. So I think getting it to work from src_t would be preferable, but doing your build as staff_t (so that we don't have to allow arbitrary user_t access).

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 4 lines · Stephen Smalley

We'd prefer to avoid having sysadm_t be able to execute anything potentially untrustworthy. So I think getting it to work from src_t would be preferable, but doing your build as staff_t (so that we don't have to allow arbitrary user_t access).

Other alternative would be to get it to work in a home directory labeled staff_home_dir_t/staff_home_t. If you define a separate user entry for all users authorized for sysadm_r, and authorize them for staff_r sysadm_r, then this should be generated in file_contexts automatically upon building the policy. At that point, you can disable user_canbe_sysadm in your tunables. That is the preferred security setup; then only users authorized for staff_r can reach sysadm_r.

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.
#3 lore raw
Quoted 6 lines · Stephen Smalley
Quoted 4 lines · Stephen Smalley

We'd prefer to avoid having sysadm_t be able to execute anything potentially untrustworthy. So I think getting it to work from src_t would be preferable, but doing your build as staff_t (so that we don't have to allow arbitrary user_t access).

Quoted 7 lines

Other alternative would be to get it to work in a home directory labeled staff_home_dir_t/staff_home_t. If you define a separate user entry for all users authorized for sysadm_r, and authorize them for staff_r sysadm_r, then this should be generated in file_contexts automatically upon building the policy. At that point, you can disable user_canbe_sysadm in your tunables. That is the preferred security setup; then only users authorized for staff_r can reach sysadm_r.

I haven't done anything with roles so far, but I will investigate :) Speaking of roles, is the jadmin user in local.users supposed to be uncommented? It's been that way for a while.

Signature · 8 lines
Ivan Gyurdiev <[email protected]>
Cornell University


--
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.
#4 lore raw
Quoted 3 lines · Ivan Gyurdiev

I haven't done anything with roles so far, but I will investigate :) Speaking of roles, is the jadmin user in local.users supposed to be uncommented? It's been that way for a while.

Looks like an oversight to me. Dan? Jim?

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.
#5 lore raw
Quoted 6 lines · Stephen Smalley
Quoted 3 lines · Ivan Gyurdiev

I haven't done anything with roles so far, but I will investigate :) Speaking of roles, is the jadmin user in local.users supposed to be uncommented? It's been that way for a while.

Looks like an oversight to me. Dan? Jim?

.. and why is it that when I change it nothing happens? Is this the wrong file?

I'm editing /etc/selinux/strict/src/policy/local.users

Signature · 8 lines
Ivan Gyurdiev <[email protected]>
Cornell University


--
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.
#6 lore raw
Quoted 4 lines · Ivan Gyurdiev

.. and why is it that when I change it nothing happens? Is this the wrong file?

I'm editing /etc/selinux/strict/src/policy/local.users

I think Dan introduced it in preparation for creating infrastructure for updating users on the end system without the policy sources via genpolusers. Looks like it is getting installed via make install, but not incorporated into a policy build from source. See the earlier discussions on the list.

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.
#7 lore raw
Quoted 11 lines · Stephen Smalley
Quoted 4 lines · Ivan Gyurdiev

.. and why is it that when I change it nothing happens? Is this the wrong file?

I'm editing /etc/selinux/strict/src/policy/local.users

I think Dan introduced it in preparation for creating infrastructure for updating users on the end system without the policy sources via genpolusers. Looks like it is getting installed via make install, but not incorporated into a policy build from source. See the earlier discussions on the list.

I think we want the below patch so that:
1) On a policy source build, any locally installed local.users file will be included from /etc/selinux/$SELINUXTYPE/users/, and
2) The initial installed version of local.users will be readable (i.e. no m4 processing with tunables and flags) and only contain a comment header describing the format.

Note that even with this change, local.users in the policy source directory is not used except for initial install of the file. So you would edit the installed one under /etc/selinux/$SELINUXTYPE/users, not the one in the policy source directory. Seem reasonable?

Index: policy/Makefile
===================================================================
RCS file: /cvsroot/selinux/nsa/selinux-usr/policy/Makefile,v retrieving revision 1.54
retrieving revision 1.55

Makefile +2 -2
diff -u -r1.54 -r1.55
@@ -52,6 +52,7 @@
 endif
 POLICYFILES += $(ALL_TUNABLES) $(TE_RBAC_FILES)
 POLICYFILES += $(USER_FILES)
+POLICYFILES += $(wildcard $(USERPATH)/local.users)
 POLICYFILES += constraints
 POLICYFILES += initial_sid_contexts fs_use genfs_contexts net_contexts
 CONTEXTFILES = initial_sid_contexts fs_use genfs_contexts net_contexts
@@ -89,8 +90,7 @@
 
 $(USERPATH)/local.users: local.users
 	@mkdir -p $(USERPATH)
-	m4 $(ALL_TUNABLES) tmp/program_used_flags.te local.users | sed 's/^user/#user/g' > tmp/local.users
-	install -m 644 tmp/local.users $@
+	install -m 644 $< $@
 
 $(CONTEXTPATH)/files/media: appconfig/media
 	mkdir -p $(CONTEXTPATH)/files/

Index: policy/local.users
===================================================================
RCS file: /cvsroot/selinux/nsa/selinux-usr/policy/local.users,v retrieving revision 1.1
retrieving revision 1.2

local.users +4 -8
diff -u -r1.1 -r1.2
@@ -3,19 +3,15 @@
 # User configuration.
 #
 # This file defines additional users recognized by the system security policy.
-# Only the user identities defined in this file and the users.system file
+# Only the user identities defined in this file and the system.users file
 # may be used as the user attribute in a security context.
 #
 # Each user has a set of roles that may be entered by processes
 # with the users identity.  The syntax of a user declaration is:
 #
-# 	user username roles role_set [ ranges MLS_range_set ];
+# 	user username roles role_set [ level default_level range allowed_range ];
 #
-# The MLS range set should only be specified if MLS was enabled
-# for the module and checkpolicy.
+# The MLS default level and allowed range should only be specified if 
+# MLS was enabled in the policy.
 
-# sample for administrative user
-user jadmin roles { staff_r sysadm_r ifdef(`direct_sysadm_daemon', `system_r') };
 
-# sample for regular user
-#user jdoe roles { user_r }; 
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.