Files
shadow/tests
Pierre Warnier f3a20b2043 tests: cover gpasswd as a group administrator (#287)
The reason gpasswd is setuid is that someone who is not root, but is
named an administrator of one group, manages that group's membership.
Nothing in the suite exercised a non-root caller of it, and that is the
only place the omission shows: the multicall binary drops privilege for
every applet not on its setuid list, so leaving gpasswd off that list
produces a permission error there and nowhere else. It was off the list
when the tool arrived.

Twelve assertions: an administrator adds a member without being root and
the change lands in both group and gshadow; a plain member may not change
the membership, may not appoint administrators and may not use --root;
and the administrator list is unchanged after all three refusals.

Checked that the test bites by taking gpasswd back off the setuid list
and rebuilding -- the administrator is then refused and the group file is
untouched. Worth saying that the first attempt at that check appeared to
show the fix was unnecessary; the build output had been suppressed and a
stale binary was installed.
2026-09-06 11:15:09 +02:00
..