[systemd-devel] [PATCH 0/4] loginctl --property option fixes
Djalal Harouni
tixxdz at opendz.org
Tue Dec 17 10:41:59 PST 2013
The following patches try to fix a regression in the loginctl --property
logic and improve the code.
[Patch 1/4] loginctl: replace strv_append() by strv_extend()
[Patch 2/4] loginctl: add show_properties() to get login1 properties
[Patch 3/4] loginctl: use show_properties() to get login1 properties
[Patch 4/4] loginctl: improve print_{session|user|seat}_status_info() functions
Patch 1 and 4 are code cleaning.
Patch 2 and 3 fixes a regression in the loginctl --property
loginctl allows the --property option to filter properties, however
currently it does not work, it will show all properties.
This was introduced in commit f8f14b3654bcd, the
show_{user|session|seat}() functions are passing a NULL filter to the
bus_print_all_properties().
Fix this by adding a new show_properties() function, then just use it to
query login1 properties.
Before:
$ loginctl show-user tixxdz --property=UID
UID=1000
GID=1000
Name=tixxdz
Timestamp=Tue 2013-12-17 19:12:59 CET
TimestampMonotonic=191644290
RuntimePath=/run/user/1000
DefaultControlGroup=systemd:/user/1000.user
Service=
Display=[unprintable]
State=active
Sessions=[unprintable]
IdleHint=no
IdleSinceHint=1387304298707790
IdleSinceHintMonotonic=511232662
After:
$ loginctl show-user tixxdz --property=UID
UID=1000
The patches were splitted to avoid bugs in git tree and make it easy
to comment on code.
Thanks!
More information about the systemd-devel
mailing list