Bug 306901

Summary: pam_namespace does not work when SELinux is not available
Product: [Fedora] Fedora Reporter: Jan "Yenya" Kasprzak <kas>
Component: pamAssignee: Tomas Mraz <tmraz>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: 9   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Fedora 9 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-06-03 09:55:04 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:
Attachments:
Description Flags
Do not fail when SELinux is not available
none
Updated patch
none
Correct patch none

Description Jan "Yenya" Kasprzak 2007-09-26 13:17:09 UTC
Description of problem:
pam_namespace does not work when SELinux is not available.

Version-Release number of selected component (if applicable):
pam-0.99.7.1-5.1.fc7

How reproducible:
100%

Steps to Reproduce:
1. Boot your kernel with selinux=0 (or use a vanilla kernel w/o SELinux configured)
2. echo "/tmp /tmp-inst user root" >> /etc/security/namespace.conf
3. echo "session required pam_namespace.so debug" >> /etc/pam.d/su
4. mkdir /tmp-inst; chmod 000 /tmp-inst
5. su <some existing login name>
  
Actual results:
Su fails in session initialization with the following message in /var/log/secure:
Sep 26 14:48:19 calypso su: pam_namespace(su-l:session): Error getting poly dir
context, Operation not supported

Expected results:
When no SELinux features (such as "context" or "level" method) are requested in
namespace.conf, pam_namespace should not fail.

Additional info:
I will attach a patch to fix this problem. I am also posting it to pam-devel
list for further discussion.

Comment 1 Jan "Yenya" Kasprzak 2007-09-26 13:17:09 UTC
Created attachment 207051 [details]
Do not fail when SELinux is not available

Comment 2 Jan "Yenya" Kasprzak 2007-09-26 13:22:45 UTC
Created attachment 207091 [details]
Updated patch

Oops, the patch file had the differences included twice. Fixed patch attached.

Comment 3 Tomas Mraz 2007-09-26 14:31:21 UTC
Created attachment 207161 [details]
Correct patch

We need the orig context set even for USER polyinstatiation when SELinux is
enabled. So the original patch is not correct.

Comment 4 Jan "Yenya" Kasprzak 2007-09-26 15:51:58 UTC
Works for me (and it is simpler than my version), thanks!


Comment 5 Bug Zapper 2008-05-14 03:17:06 UTC
Changing version to '9' as part of upcoming Fedora 9 GA.
More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping