Robert, yes, it works and is what i want, exactly.
There is small issue, however. - Primary groups didn''t supported in current 
code. So, for example, if user1 has 'group1' as its primary group (set in 
/etc/passwd) he will be filtered out. Can you please improve in_group () method 
with smth like:

    private bool in_group (string group_name, string user_name)
    {
        unowned Posix.Group? group = Posix.getgrnam (group_name);
        if (group == null)
            return false;

        /* Check if user has group_name as it's primary group  */
        unowned Posix.Passwd? pw = Posix.getpwnam( user_name );
        if( pw.pw_gid == group.gr_gid )
            return true;

        /* Check if group_name is user's auxilary group */
        foreach (var name in group.gr_mem)
            if (name == user_name)
                return true;

        return false;
    }

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1493335

Title:
  Support for 'list members of group(s) only'

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/unity-greeter/+bug/1493335/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to