setpriv: dump user and group info
authorDenys Vlasenko <vda.linux@googlemail.com>
Tue, 4 Jul 2017 16:49:24 +0000 (18:49 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Tue, 4 Jul 2017 16:59:11 +0000 (18:59 +0200)
commit6798486141057f7989c0e59d5f645aba87a58f62
tree3511f6a8f344d290747fdaddc670746671af2094
parenta8cf9c5a3ffd1601872d1ab14c5be00fde29209c
setpriv: dump user and group info

setpriv from util-linux has an option to dump the current state
regarding privilege settings via '--dump'. It prints out information on
the real and effective user and group IDs, supplementary groups, the
no-new-privs flag, the capability sets as well as secure bits.

This patch is the start of supporting this mode. To make introduction of
the '--dump' easier to reason about, its introduction has been split
into multiple patches. This particular one introduces the ability to
print out user and group information of the current process.

function                                             old     new   delta
setpriv_main                                          89     322    +233
getresuid                                              -      41     +41
getresgid                                              -      41     +41
static.setpriv_longopts                               22      29      +7
packed_usage                                       31675   31669      -6
------------------------------------------------------------------------------
(add/remove: 4/0 grow/shrink: 2/1 up/down: 322/-6)            Total: 316 bytes

Patch by Patrick Steinhardt <ps@pks.im>

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
util-linux/setpriv.c