mbox series

[0/2] useradd: consistent shadow files across package backends

Message ID 20261106141348.2757557-1-peter@berginkonsult.se
Headers show
Series useradd: consistent shadow files across package backends | expand

Message

Peter Bergin Nov. 6, 2026, 2:13 p.m. UTC
On ipk and deb rootfs, useradd/groupadd run from preinsts before
shadow's postinst has created /etc/shadow and /etc/gshadow, so
--system accounts end up with different aging and gshadow password
fields than on rpm [YOCTO #14139].

Patch 1 creates the shadow files in useradd_preinst, patch 2 adds an
oe-selftest that compares /etc/shadow and /etc/gshadow per account
across rpm, ipk and deb rootfs.

Tested with oe-selftest -r usergrouptests
imagefeatures.ImageFeatures.test_useradd_static on poky, and
usergrouptests on poky-altcfg. The new test fails without patch 1
on both.

Peter Bergin (2):
  useradd.bbclass: create shadow files before useradd on ipk/deb rootfs
  oe-selftest: usergrouptests: compare shadow files across package
    backends

 meta/classes/useradd.bbclass                  | 11 +++++++++
 .../lib/oeqa/selftest/cases/usergrouptests.py | 24 +++++++++++++++++++
 2 files changed, 35 insertions(+)