Bug 1081 - AIX port does not support group allow/ deny via nss_ldap
Summary: AIX port does not support group allow/ deny via nss_ldap
Status: CLOSED FIXED
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: sshd (show other bugs)
Version: -current
Hardware: PPC AIX
: P2 normal
Assignee: Assigned to nobody
URL:
Keywords:
Depends on:
Blocks: V_4_8
  Show dependency treegraph
 
Reported: 2005-09-08 07:42 AEST by paul moore
Modified: 2008-03-31 15:20 AEDT (History)
2 users (show)

See Also:


Attachments
Implement getgrouplist() on AIX via getgrset(). (4.58 KB, patch)
2006-06-03 13:15 AEST, Darren Tucker
no flags Details | Diff
Implement getgroupslist via getgrset (diff against 4.7p1). (4.17 KB, patch)
2008-01-01 02:49 AEDT, Darren Tucker
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description paul moore 2005-09-08 07:42:08 AEST
if the platform does not support getgrouplist directly then sshd uses getgrent 
to enumerate group membership (for group allow / deny). The AIX version of this 
API only supports /etc/group and NIS and so the group features do not work with 
other naming providers (nss_ldap say).

The AIX port should use getuserattr(user, S_GROUPS, ..), this uses NSS.

We can provide a candidate fix for this if needed.
Comment 1 Darren Tucker 2005-09-08 10:22:44 AEST
(In reply to comment #0)
> The AIX port should use getuserattr(user, S_GROUPS, ..), this uses NSS.
> 
> We can provide a candidate fix for this if needed.

Sure, go ahead.  I've not looked into AIX's NIS support (I don't use it) but it
sounds like the right fix would be to implement a getgrouplist() in port-aix.c
Comment 2 Darren Tucker 2006-06-03 13:15:53 AEST
Created attachment 1144 [details]
Implement getgrouplist() on AIX via getgrset().

Attached is an implementation of getgrouplist() while looking at another problem but it may also help here.
Comment 3 Darren Tucker 2008-01-01 02:49:57 AEDT
Created attachment 1430 [details]
Implement getgroupslist via getgrset (diff against 4.7p1).

It appears that my previous patch did not get the #ifdefs right.  Updated patch attached.
Comment 4 Darren Tucker 2008-01-01 02:53:08 AEDT
If this works correctly then I would like to target 4.8.

I encourage anyone who is interested in this change, especially if you yous LDAP or NSS on your AIX boxes, to please try the patch and report success or failure.  (Preferably in this bug, but feel free to email me privately if you're allergic to bugzilla.)  Thanks.
Comment 5 Philippe April 2008-01-25 02:06:18 AEDT
Success!

We tested this patch on AIX 5.3 using "match" configuration entries too, everything is working fine, AllowGroups, DenyGroups and others now work with LDAP.
Comment 6 Darren Tucker 2008-02-28 23:16:45 AEDT
This patch has been applied and will be in the 4.8 release.  Thanks.
Comment 7 Damien Miller 2008-03-31 15:20:25 AEDT
Fix shipped in 4.9/4.9p1 release.