After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 787287 - Set GROUP for newly logged in user
Set GROUP for newly logged in user
Status: RESOLVED FIXED
Product: gdm
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: GDM maintainers
GDM maintainers
Depends on:
Blocks:
 
 
Reported: 2017-09-05 01:53 UTC by Sam Spilsbury
Modified: 2018-01-08 20:54 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
daemon: Make sure to set GROUP as well (1018 bytes, patch)
2017-09-05 01:53 UTC, Sam Spilsbury
none Details | Review
common: Also set GROUP in scripts (1.70 KB, patch)
2017-09-27 13:33 UTC, Sam Spilsbury
none Details | Review
common: Also set GROUP in scripts (1.71 KB, patch)
2017-10-04 01:48 UTC, Sam Spilsbury
committed Details | Review

Description Sam Spilsbury 2017-09-05 01:53:28 UTC
Created attachment 359150 [details] [review]
daemon: Make sure to set GROUP as well

We set USER but not GROUP, which we might want to rely on in session setup scripts
Comment 1 Ray Strode [halfline] 2017-09-05 14:56:30 UTC
Review of attachment 359150 [details] [review]:

Hey thanks for this.  I'm sort of hoping to deprecate the scripts at some point (let's get shell out of the login path), but for now this is fine I guess.

::: common/gdm-common.c
@@ +590,3 @@
+
+                        /* Also get group name and propagate down */
+                        struct group *grent = getgrgid (pwent->pw_gid);

this doesn't handle EINTR.  probably there should be a gdm_get_grent_for_gid call, like the gdm_get_pwent_for_name call, with the same weird loop.
Comment 2 Sam Spilsbury 2017-09-27 13:33:30 UTC
Created attachment 360533 [details] [review]
common: Also set GROUP in scripts

Adds gdm_get_grent_for_gid
Comment 3 Ray Strode [halfline] 2017-10-03 20:16:17 UTC
Attachment 360533 [details] pushed as 6594b1f - common: Also set GROUP in scripts
Comment 4 Ray Strode [halfline] 2017-10-03 20:19:21 UTC
oops got a little trigger happy with my ctrl-r enter and git bz pushed this on accident.
Comment 5 Ray Strode [halfline] 2017-10-03 20:20:24 UTC
Review of attachment 360533 [details] [review]:

please test it too before we push it

::: common/gdm-common.c
@@ +101,3 @@
+gboolean
+gdm_get_grent_for_gid (gint           gid,
+                       struct grent **grentp)

should be struct group here.
Comment 6 Sam Spilsbury 2017-10-04 01:25:23 UTC
(In reply to Ray Strode [halfline] from comment #5)
> Review of attachment 360533 [details] [review] [review]:
> 
> please test it too before we push it
> 
> ::: common/gdm-common.c
> @@ +101,3 @@
> +gboolean
> +gdm_get_grent_for_gid (gint           gid,
> +                       struct grent **grentp)
> 
> should be struct group here.

Oops, yep, got a little trigger-happy myself :) I'll give it a quick test and fix that up, thanks for catching.
Comment 7 Sam Spilsbury 2017-10-04 01:48:26 UTC
Created attachment 360890 [details] [review]
common: Also set GROUP in scripts

Updated, tested again.
Comment 8 Ray Strode [halfline] 2018-01-08 20:54:51 UTC
Attachment 360890 [details] pushed as bf0a664 - common: Also set GROUP in scripts