Bug 198617

Summary: selinux is stopping apt from upgrading packages with scripts
Product: [Fedora] Fedora Reporter: Leszek Matok <lam>
Component: selinux-policy-targetedAssignee: Daniel Walsh <dwalsh>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 5   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-07-31 21:36:28 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Leszek Matok 2006-07-12 11:34:05 UTC
I thought I have to wait for new selinux-policy to be able to use apt, but no -
new version didn't fix it, so here it goes:
apt (from Extras) is constantly failing to dist-upgrade, leaving two installed
packages of one name in the system (only for packages containing %post scripts).
It looks like this:
Preparing...                ########################################### [100%]
   1:gimp                   ########################################### [100%]
error: %post(gimp-2.2.12-1.fc5.i386) scriptlet failed, exit status 255
W: Some errors occurred while running transaction
and the relevant selinux-policy part is this:
audit(1152697722.877:5): avc:  denied  { transition } for  pid=3682
comm="apt-get" name="bash" dev=hda1 ino=1116367
scontext=user_u:system_r:unconfined_t:s0
tcontext=user_u:system_r:rpm_script_t:s0 tclass=process

Comment 1 Daniel Walsh 2006-07-12 13:39:51 UTC
If you label apt rpm_exec_t does it work?

chcon -t rpm_exec_t /usr/bin/apt

Comment 2 Leszek Matok 2006-07-12 14:09:43 UTC
Actually it's /usr/bin/apt-get or /usr/bin/apt-shell. chcon -t rpm_exec_t fixes
each of them. Other programs in the apt suite can't install packages, AFAIK.

Comment 3 Leszek Matok 2006-07-31 21:36:28 UTC
Looks fixed in selinux-policy-targeted-2.3.3-8.fc5, I'll try to close it as
resolved :)