Files
shadow/docs/man
Jocelyn Le SageandPierre Warnier 8361bf512b gpasswd: added implementation of gpasswd (#282)
* gpasswd: added implementation of gpasswd

* gpasswd: rebase onto main and port to the current APIs

Rebases jlesage's implementation onto a main that moved a long way under
it, and carries it onto the interfaces that landed since the branch was
cut. The tool's behaviour is unchanged and still matches GNU on every
path probed.

What the rebase had to resolve:

  - shadow-rs.spec and debian/ were revived by the merge; both were
    deleted because neither could build.
  - The standalone dispatch() and hand-written --list predate the single
    applets() table, which now drives both. gpasswd joins the table.
  - The five shadow-core parser features it asked for no longer exist.
  - The fourteen [[test]] targets are one; test_gpasswd joins it.
  - README, Makefile and PLATFORM-SUPPORT described the pre-#239
    privilege model, in which every applet ran with euid 0.

What changed beyond the rebase:

  - gpasswd keeps its privilege in the multicall build. It is setuid in
    GNU and the branch marks it setuid for the per-tool install, but
    SETUID_APPLETS still listed four names, so the multicall build would
    have dropped privilege and no group administrator could have used it
    -- silently.
  - Comments in /etc/group survive. It read entries only and wrote them
    back, which erases every comment, blank line and NIS compatibility
    line in the file. The locked-file transaction keeps them, and commits
    group and gshadow together so a bad value cannot leave the pair
    disagreeing.
  - The duplicated EchoGuard and password reader are gone, replaced by
    shadow_core::tty, which blocks interrupts for the read so Ctrl-C at
    the prompt cannot leave the terminal with echo off.
  - The print macros are replaced. They panic when the stream is closed,
    which a setuid-root tool must not do part way through a change.
    These were the only five in the repository and no lint caught them,
    so clippy::print_stdout and print_stderr are now denied
    workspace-wide, with the test crate exempt.

The GNU comparison suite gains gpasswd: the unknown-group, unknown-user
and non-member exit codes, all three of which match.

CONTRIBUTING's licence list also said ISC, BSD-2-Clause, CC0-1.0, Zlib
and MPL-2.0 were acceptable, which stopped being true when deny.toml was
narrowed to the graph. It now says what deny.toml enforces.

---------

Co-authored-by: Pierre Warnier <pierre@warnier.net>
2026-09-06 11:03:53 +02:00
..