[Rpm-maint] [rpm-software-management/rpm] Automatically create users and groups from sysusers.d(5) files (PR #2432)

Panu Matilainen notifications at github.com
Thu Mar 16 10:36:51 UTC 2023


This is a work-in-progress PR for declarative user and group handling, ie #1032 and https://github.com/rpm-software-management/rpm/discussions/2277

The executive summary is: if you ship sysusers.d(5) files in your packages, you never need to muck with user or group creation in specs again. 

More details in the commits, but basically we now generate user and group requires and provides automatically, encode any sysusers data into the generated provides and autocreate these on install. A macro is provided for manually declaring users and groups from specs too.
The native tooling is systemd-sysusers, but it's possible to create a compatibility script that translates the sysusers syntax to other tooling (eg adduser/addgroup).

Misc stuff to do
- [ ] pass providing filename when available (for --replace=...)
- [ ] use the common macro for sysuser dep generation
- [ ] add disabler for user/group requires (needed for distro migration)
- [ ] documentation

Dunno if all these make sense as separate commits for a final version, probably not, but should for discussion anyway.
You can view, comment on, or merge this pull request online at:

  https://github.com/rpm-software-management/rpm/pull/2432

-- Commit Summary --

  * Populate user and group data in cpio payload again
  * Generate user/group provides from packaged /etc/passwd and /etc/group
  * Generate user() and group() provides from packaged sysusers.d files
  * Add a tag extension to decode sysuser lines from user/group provides
  * Make rpmscript machinery chroot-aware
  * Automatically create sysuser users and groups on install
  * Autogenerate requires for users and groups in packages from file data

-- File Changes --

    M build/files.c (3)
    M build/rpmbuild_internal.h (2)
    M build/rpmfc.c (34)
    M docs/man/rpm.8.md (4)
    M docs/manual/tags.md (1)
    M fileattrs/CMakeLists.txt (2)
    A fileattrs/sysusers.attr (19)
    A fileattrs/usergroup.attr (14)
    M include/rpm/rpmtag.h (1)
    M include/rpm/rpmts.h (2)
    M lib/poptI.c (4)
    M lib/psm.c (42)
    M lib/rpmscript.c (35)
    M lib/rpmscript.h (11)
    M lib/tagexts.c (34)
    M lib/transaction.c (4)
    M macros.in (28)
    M tests/populate (2)
    M tests/rpmbuild.at (35)
    M tests/rpmgeneral.at (1)
    M tests/rpmi.at (32)
    M tests/rpmsigdig.at (10)

-- Patch Links --

https://github.com/rpm-software-management/rpm/pull/2432.patch
https://github.com/rpm-software-management/rpm/pull/2432.diff

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/2432
You are receiving this because you are subscribed to this thread.

Message ID: <rpm-software-management/rpm/pull/2432 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20230316/5413d3da/attachment-0001.html>


More information about the Rpm-maint mailing list