Bug 754924

Summary: SELinux prevents invoking groupadd in %pre script
Product: [Fedora] Fedora Reporter: Akira TAGOH <tagoh>
Component: selinux-policy-targetedAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED NOTABUG QA Contact: Ben Levenson <benl>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: dwalsh
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: 2011-11-21 23:12:19 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Akira TAGOH 2011-11-18 09:11:22 UTC
Description of problem:
Installing Canna package fails to create a group and a user in %pre script.

Version-Release number of selected component (if applicable):
selinux-policy-3.10.0-54.fc17.noarch
selinux-policy-targeted-3.10.0-54.fc17.noarch

How reproducible:
always

Steps to Reproduce:
1.yum install Canna
2.
3.
  
Actual results:
warnings appears like:
warning: user canna does not exist - using root

Expected results:
no warnings

Additional info:
scriptlet itself doesn't fail because it has "exit 0" at the end according to https://fedoraproject.org/wiki/Packaging/UsersAndGroups. I built the testing package got rid of it; http://koji.fedoraproject.org/koji/taskinfo?taskID=3523256

Installing it with rpm gives me an error like:
groupadd: cannot open /etc/group
useradd: group 'canna' does not exist
error: %pre(Canna-3.7p3-33.fc17.x86_64 scriptlet failed, exit status 6
error: Canna-3.7p3-33.fc17.x86_64: install failed

It works fine on Permissive mode.

Comment 1 Daniel Walsh 2011-11-18 14:52:57 UTC
restorecon -R -v /etc

Was this a freshly installed rawhide or upgraded from F16?

Comment 2 Akira TAGOH 2011-11-21 02:23:35 UTC
Ah, thanks. working back.

I think it was installed at f16 development timeframe as rawhide and upgraded.