Group GIDs 1-99 not shown in Groups Settings dialog

Bug #141067 reported by TJ
12
Affects Status Importance Assigned to Milestone
gnome-system-tools (Ubuntu)
Confirmed
Undecided
Unassigned
system-tools-backends (Ubuntu)
New
Undecided
Unassigned

Bug Description

Binary package hint: gnome-system-tools

As a result of investigating bug #133862 ("Kino: libraw1394 -> plugdev does not work in Gutsy") we found that the "Groups settings" table of Users and Groups doesn't display the statically defined system groups GIDs 1-99.

Colin Watson commented:

"If this is indeed how users-admin behaves, it's wrong. The only difference between groups in the 0-99 range and those in 100-999 is that those in 0-99 are allocated statically by the base-passwd maintainer (a.k.a. me) while those in 100-999 are allocated dynamically by packages calling 'addgroup --system'."

I've followed through the source code of gnome-system-tools, liboobs, dbus and system-config-backend trying to determine where and why these GIDs are ignored. Unfortunately there's a lack of comments or documentation on this so I've not made much progress on locating the cause.

The closest I've got so far is in gnome-system-tools-2.20.0/src/users/groups-table.c::groups_model_filter():

 return (tool->showall ||
  (gid == 0 ||
   (gid >= tool->minimum_gid &&
    gid <= tool->maximum_gid)))

tool->showall equates to the gconf key /apps/gnome-system-tools/users/showall but altering that value doesn't change the displayed groups. There's reference to minimum_gid and maximum_gid but minimum_gid appears to be set to 0 via:

liboobs-2.20.0/oobs/oobs-groupsconfig.c::oobs_groups_config_update()

  dbus_message_iter_next (&iter);
  dbus_message_iter_get_basic (&iter, &priv->minimum_gid);

The value comes from the Dbus GroupsConfig structure Integer32 'Minimum GID' element (see http://system-tools-backends.freedesktop.org/dbus-spec.html).

I've checked system-tools-backends-2.4.0/Users/Groups.pm::get() and it simply parses /etc/group and returns an array containing all entries. There is no filtering.

Dbus runs /etc/dbus-1/event.d/70system-tools-backends which starts the daemon /usr/bin/system-tools-backends.

liboobs-2.20.0/oobs/oobs-groupsconfig.c::oobs_groups_config_update() processes the Dbus GroupsConfig structure. It iterates the array of groups, calling create_group_from_dbus_reply() for each group.

Revision history for this message
TJ (tj) wrote :

It always helps to step back and the revisit a problem, especially when it involves PERL :)

I mention in my previous comment:

liboobs-2.20.0/oobs/oobs-groupsconfig.c::oobs_groups_config_update()

  dbus_message_iter_next (&iter);
  dbus_message_iter_get_basic (&iter, &priv->minimum_gid);

The value comes from the Dbus GroupsConfig structure Integer32 'Minimum GID' element (see http://system-tools-backends.freedesktop.org/dbus-spec.html).

Rereading that made me realise I'd not actually looked at where Dbus got the values because I got sidetracked chasing another lead at that time.

system-tools-backends-2.4.0/Groups.pm::get() hands the GroupsConfig structure to Dbus and liboobs.

Groups.pm::get() does:

return ($groups, $$logindefs{"gmin"}, $$logindefs{"gmax"});

$logindefs is defined in system-tools-backends-2.4.0/Users/Users.pm, and for a debian distro reads defaults from:

@login_defs_names = ( "/etc/login.defs", "/etc/adduser.conf" );

/etc/login.defs contains the entries:

# Min/max values for automatic gid selection in groupadd
#
GID_MIN 100
GID_MAX 60000

so, GID_MIN is the reason that "Group settings" table of Users and Groups doesn't display GIDs 1-99.

Revision history for this message
TJ (tj) wrote :

Another realisation: It appears that tools->showall is being ignored in the filter if the gconf key value /apps/gnome-system-tools/users/showall is being assigned to tool->showall correctly:

gnome-system-tools-2.20.0/src/users/groups-table.c::groups_model_filter():

 return (tool->showall || (gid == 0 || (gid >= tool->minimum_gid && gid <= tool->maximum_gid) ) )

If it is set the filter ought to return 'true' regardless of minimum_gid when /apps/gnome-system-tools/users/showall is true.

Revision history for this message
Colin Watson (cjwatson) wrote :

/etc/login.defs is correct. It just isn't meant to be used for this purpose.

Revision history for this message
TJ (tj) wrote :

Changed from 'shadow' package to 'system-tools-backends' since issue is in GroupsConfig.pm::get()

Revision history for this message
Yann Rouillard (yann-pleiades) wrote :

I think "Users and Groups" is supposed to not show system users and groups to not confuse users (the GNOME spirit !).
So I suppose that under Debian/Ubuntu, it should rather only show GID >= 1000.

Basic system groups seems to be "exposed" via the privilege tabs, hence maybe a fix to bug #133862 would be to add a "Raw access to disk" privilege linked to the disk group.

Revision history for this message
Caroline Ford (secretlondon) wrote :

confirming.

Current hardy shows group 0, and then 100+

Changed in gnome-system-tools:
status: New → Confirmed
Revision history for this message
C de-Avillez (hggdh2) wrote :

I am considering marking this bug as a duplicate of bug 124993. The solution for this mess is to set the (rather undocumented) gconf key /apps/gnome-system-tools/users/showall, and magically all users and all groups appear.

Comments, anyone, before I do so?

Revision history for this message
TJ (tj) wrote :

Looks like a sensible move to me. bug #124993 publishes a fix that works in Hardy.

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.