Bug 101972

Summary: Add support for a list of extra groups for admin users
Product: accountsservice Reporter: Cosimo Cecchi <cosimoc>
Component: generalAssignee: Matthias Clasen <mclasen>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium CC: bugseforuns, cosimoc, marius.vollmer, oholy, rstrode, stefw
Version: unspecified   
Hardware: All   
OS: All   
i915 platform: i915 features:
Attachments: Add support for a list of extra groups for admin users
Fix useradd failures caused by invalid read

Description Cosimo Cecchi 2017-07-30 13:50:15 UTC
This patch upstreams a functionality that Debian/Ubuntu carry downstream patches for.
Comment 1 Cosimo Cecchi 2017-07-30 13:50:17 UTC
Created attachment 133135 [details] [review]
Add support for a list of extra groups for admin users

It's common for distributions to want to add administrator users to
additional groups (e.g. lpadmin or systemd-journal); Debian and Ubuntu
have patches that add this kind of functionality already.

This commit adds a configure option to specify a comma-separated list of
extra groups for admin users and adds support for it when both adding a
new admin user and promoting an user to admin.
Comment 2 Robert Ancell 2017-12-19 02:28:47 UTC
Comment on attachment 133135 [details] [review]
Add support for a list of extra groups for admin users

Review of attachment 133135 [details] [review]:

Comment 3 Cosimo Cecchi 2017-12-19 02:55:38 UTC
Thanks for the review, Robert! Is there any chance you can push this for me? I don't think I have write access to this repo.
Comment 4 Robert Ancell 2017-12-19 20:33:52 UTC
Pushed, I just wanted to check with Ray he was OK with this change first. Thanks for the patch!
Comment 5 Ondrej Holy 2018-05-03 07:42:56 UTC
Created attachment 139293 [details] [review]
Fix useradd failures caused by invalid read

Commit 93e2a85 added support for extra admin groups, but causes useradd
failures, when adding admin accounts. It is because admin_groups are
released before they are actually used, which causes that garbage is
used instead of the group and useradd fails consequently with invalid
group name. Do not release the memory before it is used and also fix
one corresponding memory leak.
Comment 6 Ondrej Holy 2018-05-03 07:43:18 UTC
Comment 7 Cosimo Cecchi 2018-05-03 15:01:55 UTC
Whoops, good catch... the patch looks good to me.
Comment 8 Felipe 2018-05-08 23:17:20 UTC
Hello, when will this error be fixed?
Comment 9 Ray Strode [halfline] 2018-05-10 14:23:39 UTC
hey i missed this go by in my mail and did two similar fixes yesterday:


(but didn't push them to master yet)

Anyway, seems good to me, please push !
Comment 10 Ray Strode [halfline] 2018-05-10 14:37:22 UTC
(downstream bug https://bugzilla.redhat.com/show_bug.cgi?id=1575780 )
Comment 11 Ray Strode [halfline] 2018-05-10 17:04:48 UTC
9d14729..1557846  master -> master

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.