Files
packages/admin/sudo
Michael Pfeifroth 6b5954ef81 sudo: create sudo group
Add a 'sudo' system group at package-install time using the USERID
mechanism.

Rationale: sudoers configurations that grant privileges to the 'sudo'
group -- the near-universal Debian/Ubuntu idiom, e.g.

    %sudo ALL=(ALL:ALL) NOPASSWD: ALL

-- fail silently on OpenWrt today because no 'sudo' group exists in
/etc/group.  sudo(8) logs 'unknown group: sudo' and the rule is skipped.
Users also cannot 'usermod -aG sudo <user>' without the group present,
so there is no straightforward way to delegate root without hand-editing
/etc/group or writing per-user sudoers snippets.

Seeding the group here matches how OpenWrt already handles other
service accounts (chrony, dbus, ntpd, ...): the USERID mechanism
creates them lazily via add_group_and_user in the postinst script.

No privileges are granted by default -- an administrator still has to
add users to the group and ship a sudoers rule that references it.

No numeric GID is pinned. The group name is what sudoers, addgroup(1),
and getgrnam() operate on; the numeric GID is invisible to sudo's
authorisation path and matters only for on-disk group ownership
metadata (e.g. 'chgrp sudo' persisted to shared storage) -- something
this package does not do. Letting add_group_and_user pick a dynamic
GID in the 32768+ range keeps sudo out of base-files' reserved
low-range group space and avoids any name-vs-number collision debate.

Bump PKG_RELEASE.

Signed-off-by: Michael Pfeifroth <micpf@westermo.com>
2026-08-07 13:34:12 +03:00
..
2023-12-18 13:49:53 +02:00
2026-08-07 13:34:12 +03:00