Bug 229755 - pam_succeed_if fails when it should succeed
pam_succeed_if fails when it should succeed
Status: CLOSED DUPLICATE of bug 173926
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: pam (Show other bugs)
4.4
All Linux
medium Severity medium
: ---
: ---
Assigned To: Tomas Mraz
Jay Turner
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-02-23 02:12 EST by John Robinson
Modified: 2015-01-07 19:15 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-02-23 06:21:32 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Add upstream "in" and "notin" list matching feature (1.79 KB, patch)
2007-02-23 03:03 EST, John Robinson
no flags Details | Diff
Patch to pam spec to (i) build cleanly and (ii) add list match feature (1.60 KB, patch)
2007-02-23 03:11 EST, John Robinson
no flags Details | Diff

  None (edit)
Description John Robinson 2007-02-23 02:12:10 EST
Description of problem:
I'm trying to get vsftpd only to let people who DON'T have valid shells log in.
To do this, in /etc/pam.d/vsftpd I've changed the line
auth required pam_shells.so
to
auth required pam_succeed_if.so debug shell notin /bin/bash:/bin/sh
And in my logs I get:
Feb 23 06:41:48 cat vsftpd[17824]: pam_succeed_if: 'shell' resolves to
'/usr/libexec/openssh/sftp-server'
Feb 23 06:41:48 cat vsftpd[17824]: pam_succeed_if: requirement "shell notin
/bin/bash:/bin/sh" not met by user "john"
Obviously /usr/libexec/openssh/sftp-server is neither /bin/bash nor /bin/sh, so
I think it ought to have succeeded.

Version-Release number of selected component (if applicable):
pam-0.77-66.17.i386.rpm

How reproducible:
100%

Steps to Reproduce:
1.Make change as described above
2.Change a user's shell so it's not /bin/bash e.g. to /bin/false or whatever
3.Attempt FTP login (which will fail)
4.See /var/log/secure
  
Actual results:
Login fails, bizarre-looking log message

Expected results:
Login succeeds, correct log message

Additional info:
Comment 1 John Robinson 2007-02-23 03:00:10 EST
I've followed this up and discovered that the "in" and "notin" feature was only
added in August last year, and isn't present in EL4's PAM, which will be why it
doesn't work. However, I really think the error message ought to say "no such
operator" or something like that, instead of just "requirement not met". Just in
case you're interested, I'll attach a patch to provide the feature (originally
from
http://pam.cvs.sourceforge.net/pam/Linux-PAM/modules/pam_succeed_if/pam_succeed_if.c?r1=1.11&r2=1.12&view=patch
but modified to apply cleanly to your pam-0.77-66.17).
Comment 2 John Robinson 2007-02-23 03:03:10 EST
Created attachment 148651 [details]
Add upstream "in" and "notin" list matching feature
Comment 3 John Robinson 2007-02-23 03:11:17 EST
Created attachment 148652 [details]
Patch to pam spec to (i) build cleanly and (ii) add list match feature

Build fails with unpackaged files error, so remove them (they're unnecessary
symlinks).
Comment 4 Tomas Mraz 2007-02-23 06:21:32 EST

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

Note You need to log in before you can comment on or make changes to this bug.