Skip to content

Commit

Permalink
image: unset password reset date to ensure reprodicibility (#3466)
Browse files Browse the repository at this point in the history
* image: unset password reset date
  • Loading branch information
burgerdev authored Nov 4, 2024
1 parent 54058ee commit 960499a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions image/base/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ copy_to_directory(
mkosi_image(
name = "base_" + kernel_variant,
srcs = [
"mkosi.finalize",
"mkosi.postinst",
"mkosi.prepare",
] + glob([
Expand Down
14 changes: 14 additions & 0 deletions image/base/mkosi.finalize
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env bash
set -euxo pipefail

# For some reason yet unknown, SourceDateEpoch is not applied correctly to the
# users added by systemd-sysusers. This has only been observed in our mkosi
# flake so far, not in an upstream mkosi configuration.
# TODO(burgerdev): wait for a couple of Nix package upgrades and try again?

# Strategy: unset the "last password change" date without leaving a trace in
# /etc/shadow-.
tmp=$(mktemp)
cp -a "${BUILDROOT}/etc/shadow-" "${tmp}"
mkosi-chroot chage -d "" etcd
cp -a "${tmp}" "${BUILDROOT}/etc/shadow-"

0 comments on commit 960499a

Please sign in to comment.