Description of problem:
One of new added functionalities of PAM PTA is support for multiple configuration entries. To be backward compatible, top-level configuration entry cn=PAM Pass Through Auth,cn=plugins,cn=config is still valid configuration entry. In addition to that, each child is also expected to be PAM PTA config entry. However, top-level config entry is being ignored when a child entry is present, and only child entries configure plugins behavior.
Version-Release number of selected component (if applicable): tested on 389-ds-base-1.2.11.15-2.el6.x86_64
How reproducible: always
Steps to Reproduce: One way to reproduce is to setup top-level config entry to include ldap user and set child config entry to exclude user. Both instances have fallback set to false. When user tries to bind, top-level entry is ignored, and user binds. If however child config entry is set to include user entry, then user bind fails on 32 - user does no exist in PAM.
USERD="uid=tuserD, ..."
1) Add user $USERD ldapmodify -h $IP -p $PORT -D "cn=directory manager" -w Secret123 <<EOF dn: $USERD changetype: add ... userPassword: password EOF
2) configure top-level entry to include $USERD and deny fallback ldapmodify -h $IP -p $PORT -D "cn=directory manager" -w Secret123 <<EOF dn: cn=PAM Pass Through Auth,cn=plugins,cn=config changetype: modify replace: nsslapd-pluginEnabled nsslapd-pluginEnabled: on - replace: pamFallback pamFallback: FALSE - replace: pamIncludeSuffix pamIncludeSuffix: $USERD EOF
3) configure child entry to exclude $USERD and deny fallback ldapmodify -h $IP -p $PORT -D "cn=directory manager" -w Secret123 <<EOF dn: cn=inst2,cn=PAM Pass Through Auth,cn=plugins,cn=config changetype: add cn: test1 objectClass: pamConfig objectClass: top pamIDMapMethod: RDN DN ENTRY pamFallback: FALSE pamSecure: FALSE pamService: ldapserver pamExcludeSuffix: $USERD pamMissingSuffix: ALLOW pamIDAttr: uid EOF
4) restart server service dirsrv restart
5) try to bind as $USERD ldapsearch -h $IP -p $PORT -D "$USERD" -w password -b "$USERD"
Actual results: echo $? 0
Expected results: ldap_bind: No such object (32) additional info: User id [tuserD] for bind DN [uid=tuserD,dc=suf1,dc=example,dc=com] does not exist in PAM
Additional info: https://fedorahosted.org/389/attachment/ticket/181/0001-ticket-181-Allow-PAM-passthru-plug-in-to-have-multip.patch: "When the normal area in cn=config is used, both the top-level PAM passthru plug-in config entry and it's children are considered to be config entries."
Linked to Bugzilla bug: https://bugzilla.redhat.com/show_bug.cgi?id=868167 (''Red Hat Enterprise Linux 6'')
This problem could be related to the fact that you are using the DN of "user D" as a suffix in the PAM config. This is not correct. The include/exclude suffixes are supposed to be top-level suffixes, not any arbitrary DN within your tree.
This needs to be tested using valid suffixes in the config.
The problem here is that you have 2 overlapping config entries. The logic isn't designed to have the PAM passthru plug-in fall through when a configuration entry fails to work for authenticating a user. When a bind attempt comes in, the logic is as follows:
There is no fallback logic. In your test scenario, the child config entry (cn=inst2,...) is checked first when we are looping through the config entries. When you exclude $USERD in the child entry, that config doesn't apply, so the top-level config entry is used. When you change the child to include $USERD, the child entry does apply, and that config entry is used instead of the top-level config.
The behavior described in comment#3 is by design. The intention of allowing multiple PAM passthru configuration settings is to have separate configuration for separate entries (via suffix, filter, or a combination of the two). Having multiple configuration entries that apply to the same set of bind target entries is beyond the scope of the current design. This also matches up with the way most of the other DS plug-ins work that support multiple config entries.
I'm closing this as INVALID.
Metadata Update from @nkinder: - Issue assigned to rmeggins - Issue set to the milestone: N/A
389-ds-base is moving from Pagure to Github. This means that new issues and pull requests will be accepted only in 389-ds-base's github repository.
This issue has been cloned to Github and is available here: - https://github.com/389ds/389-ds-base/issues/492
If you want to receive further updates on the issue, please navigate to the github issue and click on subscribe button.
subscribe
Thank you for understanding. We apologize for all inconvenience.
Metadata Update from @spichugi: - Issue close_status updated to: wontfix (was: Invalid)
Login to comment on this ticket.