]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
shadow: Enable subid support
authorAndrei Gherzan <andrei.gherzan@huawei.com>
Wed, 24 Aug 2022 09:42:17 +0000 (11:42 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 25 Aug 2022 10:07:33 +0000 (11:07 +0100)
shadow utils are used when creating users at image creation time. The
useradd/usermod tools will only try to add a default configuration for
subid files if they exist.

Signed-off-by: Andrei Gherzan <andrei.gherzan@huawei.com>
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-extended/shadow/shadow.inc

index fbb1d395ff8e1f103e4e5761b59bb1f5570b6ae9..b2f82e9ac76f20f626836281ff58d4a00acc7fbc 100644 (file)
@@ -147,6 +147,13 @@ do_install:append() {
        # Handle link properly after rename, otherwise missing files would
        # lead rpm failed dependencies.
        ln -sf newgrp.${BPN} ${D}${bindir}/sg
+
+       # usermod requires the subuid/subgid files to be in place before being
+       # able to use the -v/-V flags otherwise it fails:
+       # usermod: /etc/subuid does not exist, you cannot use the flags -v or -V
+       install -d ${D}${sysconfdir}
+       touch ${D}${sysconfdir}/subuid
+       touch ${D}${sysconfdir}/subgid
 }
 
 PACKAGES =+ "${PN}-base"