]> git.ipfire.org Git - thirdparty/util-linux.git/commit
su: clean up groups initialization
authorKarel Zak <kzak@redhat.com>
Mon, 15 Feb 2016 12:55:37 +0000 (13:55 +0100)
committerKarel Zak <kzak@redhat.com>
Mon, 15 Feb 2016 13:07:25 +0000 (14:07 +0100)
commitc619d3d167115990e9228b27851e0cc2faa8f936
tree01fa30c52400922e1e900a6fae0cbd8e245abefd
parentf16f28b0fc0ce09720181b2088254a3a1d0b547a
su: clean up groups initialization

This patch does not change any su/runuser behaviour, code changes:

* don't use huge groups[NGROUPS_MAX]; the array has 256k, but we need
  it only occasionally when -G/-g specified.

* the current code uses groups[0] for -g and the rest for -G, this patch adds
  'gid' to remember -g argument to avoid memmove()

* add function add_supp_group() to simplify su_main()

* add note about -G and -g relation to the man pages (undocumented now)

Signed-off-by: Karel Zak <kzak@redhat.com>
login-utils/runuser.1
login-utils/su-common.c
login-utils/su.1