Bug 835934

Summary: staff_u cannot use mock
Product: [Fedora] Fedora Reporter: Konstantin Ryabitsev <icon>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 17CC: dominick.grift, dwalsh, mgrepl, plautrba
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-03-21 08:49:49 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
AVCs obtained on fedora 17
none
AVCs obtained on RHEL6
none
mock -r fedora-rawhide-x86_64 -v --rebuild awstats-7.1.1-1.fc20.src.rpm none

Description Konstantin Ryabitsev 2012-06-27 14:57:21 UTC
If a user has their role set to staff_u, the selinux policy prevents them from using mock to build packages.

mricon@nikko:[~]$ mock -r fedora-17-x86_64 rpmbuild/SRPMS/totpcgi-0.5.0-2.fc17.src.rpm 
INFO: mock.py version 1.1.22 starting...
State Changed: init plugins
INFO: selinux enabled
State Changed: start
ERROR: Cannot find/open srpm: rpmbuild/SRPMS/totpcgi-0.5.0-2.fc17.src.rpm. Error: Unable to open file

mricon@nikko:[~]$ id -Z
staff_u:staff_r:staff_t:s0

mricon@nikko:[~]$ sestatus
SELinux status:                 enabled
SELinuxfs mount:                /sys/fs/selinux
SELinux root directory:         /etc/selinux
Loaded policy name:             targeted
Current mode:                   enforcing
Mode from config file:          enforcing
Policy MLS status:              enabled
Policy deny_unknown status:     allowed
Max kernel policy version:      26

The AVCs are too numerous to list and are mostly for staff_consolehelper_t.

Comment 1 Miroslav Grepl 2012-06-28 11:49:15 UTC
Could you compress these AVC msgs and attach them? Thank you.

Comment 2 Konstantin Ryabitsev 2012-06-28 13:51:36 UTC
Created attachment 595024 [details]
AVCs obtained on fedora 17

Comment 3 Konstantin Ryabitsev 2012-06-28 13:52:03 UTC
Created attachment 595025 [details]
AVCs obtained on RHEL6

Comment 4 Petr Lautrbach 2013-03-18 14:17:54 UTC
Created attachment 711990 [details]
mock -r fedora-rawhide-x86_64 -v --rebuild awstats-7.1.1-1.fc20.src.rpm

staff_u can't use mock also in Rawhide 

selinux-policy-3.12.1-20.fc19.noarch
mock-1.1.29-1.fc19.noarch

Comment 5 Miroslav Grepl 2013-03-19 08:58:51 UTC
Petr,
did it work with a local policy?

Comment 6 Miroslav Grepl 2013-03-21 08:49:49 UTC

*** This bug has been marked as a duplicate of bug 923927 ***