Skip to content

Commit 6ebf04d

Browse files
committed
WIP: compose: Add experimental/sysusers option
First, we add support for a new `experimental:` key. Then there's a new `sysusers` key underneath that. When enabled, we drop all of the other previous passwd handling. In practice the only one that was used was having static files. That is a pain to maintain. However, we need to statically assign non-zero uid/gid for any files that come from a base ostree commit. Anything else would mean the user/groups could be unpredictably assigned in different rpm-ostree runs. This code now checks for an errors out on that. In order to convert *fully* to sysusers, we install an interceptor for `useradd/groupadd` that talk back via a pipe to the compose process. These invocations then get translated to drop into a new` `sysusers.d/rpmostree-auto.conf` file. This way we don't need to require that every RPM have ported to sysusers.d. At the end, we drop everything in `/etc/passwd` and `/etc/group` except for the `root:` entries, relying on `systemd-sysusers` to readd everything at boot time. Closes: #49
1 parent c8f81b4 commit 6ebf04d

15 files changed

+1248
-59
lines changed

docs/manual/treefile.md

+4
Original file line numberDiff line numberDiff line change
@@ -253,3 +253,7 @@ version of `rpm-ostree`.
253253

254254
* `rojig`: Object, optional. Sub-keys are `name`, `summary`, `license`,
255255
and `description`. Of those, `name` and `license` are mandatory.
256+
257+
* `sysusers`: boolean, optional: Defaults to `false`. Enable generation of
258+
systemd sysusers.d entries based on `useradd` invocations. If enabled,
259+
this overrides `preserve-passwd`. It also obsoletes `check-passwd`.

rust/src/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,5 @@ pub use journal::*;
5151
mod utils;
5252
pub use utils::*;
5353
mod openat_utils;
54+
mod sysusers;
55+
pub use sysusers::*;

0 commit comments

Comments
 (0)