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

Bug #1493335 reported by Dmzavr
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
unity-greeter (Ubuntu)
Fix Released
Wishlist
Unassigned

Bug Description

It would be great to have "/com/canonical/unity-greeter/hidden-users" counterpart with revert logic.

In our project we need the greeter shows members of some group(s) only.

We can't delegate this work to lightdm or accountsservice because this can break login/policy/accounting system. - Our goal only is to get occasional/admin users of workplace out of greeter's 'users board'.

To achieve this we had to change current unity-greeter code.
We publish branch here: lp:~dmzavr/unity-greeter/unity-greeter

Can we expect the requested feature will be supported in some future release?

Tags: patch

Related branches

Dmzavr (dmzavr)
description: updated
Revision history for this message
Dmzavr (dmzavr) wrote :
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "Workaround we use now" seems to be a debdiff. The ubuntu-sponsors team has been subscribed to the bug report so that they can review and hopefully sponsor the debdiff. If the attachment isn't a patch, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are member of the ~ubuntu-sponsors, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issue please contact him.]

tags: added: patch
Changed in unity-greeter (Ubuntu):
status: New → Triaged
importance: Undecided → Wishlist
Revision history for this message
Robert Ancell (robert-ancell) wrote :

This seems like a useful feature. I think it can be implemented much simpler just using Vala code.

Revision history for this message
Robert Ancell (robert-ancell) wrote :

Could you try lp:~robert-ancell/unity-greeter/group-filter and see if that works?

The setting is enabled using GSettings which is the method for the other Unity Greeter settings. The easiest way to set these is to make a GSettings override file, see http://askubuntu.com/a/177024/28129 for an example.

Revision history for this message
Robert Ancell (robert-ancell) wrote :

And the contents of the override file should be something like:
[com.canonical.unity-greeter]
group-filter = ['group1', 'group2']

Revision history for this message
Iain Lane (laney) wrote :

(unsubscribing sponsors - thanks Robert for handling this)

Revision history for this message
Dmzavr (dmzavr) wrote :

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;
    }

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package unity-greeter - 16.04.0-0ubuntu1

---------------
unity-greeter (16.04.0-0ubuntu1) xenial; urgency=medium

  * New upstream release:
    - Add an option to only show users in a list of specified groups
      (LP: #1493335)
    - Use non-deprecated Gdk.Cursor methods
    - Remove obsolete CONFIG_FILE define
  * debian/rules:
    - Update greeter logo for Xenial Xerus.

 -- Robert Ancell <email address hidden> Tue, 27 Oct 2015 11:48:39 +1300

Changed in unity-greeter (Ubuntu):
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.