Bug 88286 - RFE: loginctl: add GroupsMember=GroupName1(GID1), GroupName2(GID2),...,GroupNameN(GIDN)
Summary: RFE: loginctl: add GroupsMember=GroupName1(GID1), GroupName2(GID2),...,GroupN...
Status: RESOLVED WONTFIX
Alias: None
Product: systemd
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: systemd-bugs
QA Contact: systemd-bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-01-11 10:37 UTC by Mikhail Kasimov
Modified: 2016-06-07 10:19 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Mikhail Kasimov 2015-01-11 10:37:48 UTC
Having a result of 'loginctl show-user'
=====
k_mikhail@linux-mk500:~> loginctl show-user k_mikhail 
UID=1000
GID=100
Name=k_mikhail
Timestamp=Пнд 2015-01-05 02:44:08 EET
TimestampMonotonic=55312165
RuntimePath=/run/user/1000
Service=user@1000.service
Slice=user-1000.slice
State=active
IdleHint=no
IdleSinceHint=0
IdleSinceHintMonotonic=0
Linger=no
=====

but sometimes it's needed to know info about gropus that user belongs to. The traditional way is to use this schema:
=====
k_mikhail@linux-mk500:~> cat /etc/group | grep k_mikhail
vboxusers:x:481:k_mikhail
wheel:x:10:k_mikhail
users:x:100:k_mikhail
k_mikhail@linux-mk500:~>
=====

So, te idea is to add GroupsMember=GroupName1(GID1), GroupName2(GID2),...,GroupNameN(GIDN) in 'loginctl show-user':
=====
k_mikhail@linux-mk500:~> loginctl show-user k_mikhail 
UID=1000
GID=100
Name=k_mikhail
GroupsMember=vboxusers(481), wheel(10), users(1000)
=====

or, if dislpaying of groupnames is insecure, show only UIDs: GroupsMember=481,10,1000
Comment 1 Mikhail Kasimov 2015-01-11 10:38:56 UTC
*show only GIDs: GroupsMember=481,10,1000
Comment 2 Mikhail Kasimov 2015-01-15 01:07:30 UTC
Or, as a variant: GroupsMember= echo $(id -nG && id -G)
Comment 3 Lennart Poettering 2015-01-29 00:19:47 UTC
Hmm, why to get the group memberships of a user "k_mihail" you can use "id k_minkhail" ont the command line. Why precsiely do you think loginctl should show this too, that wouldn't be covered with the simple "id" command?
Comment 4 Mikhail Kasimov 2015-01-29 00:54:00 UTC
Why precsiely do you think "systemctl status something" should show this too, that wouldn't be covered with the simple "service something status" in sysvinit? :P :)

To be more serious: systemd, as a fact, often duplicates most habitual things, but with its own syntax.

In that logic "loginctl show-user" makes the same to simple "id", "whoami" commands (speaking it more simply). So, as for me in role of an admin, if I use systemd command "loginctl", I'd like to have the possibility to view list of groups, which user belongs to without using anything else. This makes user-info _more complete_ and it's more convinient. I think you agree with me.

Of course, I also have the alternative with "id" command. Or just like of using xinetd instead of some systemd functionality and so on.
Comment 5 Lennart Poettering 2015-01-29 01:07:59 UTC
The bits "systemctl show" or "loginctl show" currently show are something systemd actually makes use of, these are properties that are relevant to systemd's own logic. However, the supplementary group id list for running services is really nothing logind ever needed to know so far, it's nothing it will configure, and nothing it will query for its operation...
Comment 6 Mikhail Kasimov 2015-01-29 01:28:49 UTC
Simply speaking - feaure request is refused. OK.
Comment 7 Lennart Poettering 2016-06-07 10:19:37 UTC
So yeah, I am not convinced that logind should be an API for the user/group database. Sorry! Closing.


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.