On Tue, May 13, 2014 at 11:06:47PM +0200, Jakub Hrozek wrote:
On Fri, May 09, 2014 at 09:58:52PM +0200, Jakub Hrozek wrote:
> Hi,
>
> the attached two patches add a GetGroupsList method that adelton's
> mod_lookup_identity uses.
>
> The first patch is a one-liner that I don't think harms the current
> sysdb_initgroups() users in any way, also all the sysdb tests pass.
>
> The second patch adds the new method.
Pavel did a review on IRC and requested a change -- the patches don't
work quite well if the user is not a member of any group except his
private one. I'll address this comment.
I'm sorry but I couldn't reproduce that bug. I added a user in IPA:
$ ipa user-show nogroups
User login: nogroups
First name: no secondary
Last name: groups
Home directory: /home/nogroups
Login shell: /bin/sh
Email address: nogroups(a)ipatest.example.com
UID: 69800016
GID: 69800016
Account disabled: False
Password: False
Member of groups: ipausers
Kerberos keys available: False
And requesting his groups comes as empty, which is what I'd expect since
ipausers is a non-POSIX group:
$ dbus-send --print-reply --system --dest=org.freedesktop.sssd.infopipe
/org/freedesktop/sssd/infopipe org.freedesktop.sssd.infopipe.GetUserGroups
string:nogroups
method return sender=:1.31 -> dest=:1.32 reply_serial=2
array [
]
$ id nogroups
uid=69800016(nogroups) gid=69800016(nogroups) groups=69800016(nogroups)
I'm attaching a new set of patches anyway to address the some formatting
issues.