]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
shadow: add /etc/default/useradd
authorYi Zhao <yi.zhao@windriver.com>
Thu, 19 Aug 2021 09:56:21 +0000 (17:56 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 20 Aug 2021 07:52:59 +0000 (08:52 +0100)
The shadow 4.9 stops shiping /etc/default/useradd[1] and uses built-in
settings by default. Some settings are not consistent with previous
shadow 4.8.1 in oe-core. e.g. The default shell is /bin/bash rather than
/bin/sh. Per shadow 4.8.1 settings, add /etc/default/useradd back.

[1] https://github.com/shadow-maint/shadow/commit/bbf4b79bc49fd1826eb41f6629669ef0b647267b

Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-extended/shadow/files/useradd [new file with mode: 0644]
meta/recipes-extended/shadow/shadow.inc

diff --git a/meta/recipes-extended/shadow/files/useradd b/meta/recipes-extended/shadow/files/useradd
new file mode 100644 (file)
index 0000000..782aeef
--- /dev/null
@@ -0,0 +1,8 @@
+# useradd defaults file
+GROUP=100
+HOME=/home
+INACTIVE=-1
+EXPIRE=
+SHELL=/bin/sh
+SKEL=/etc/skel
+CREATE_MAIL_SPOOL=no
index c1e24b4f169a76418ad2f0133b58bb6d41411ec6..c35cc8396dff14cc0be60001417c608e141fe361 100644 (file)
@@ -17,6 +17,7 @@ SRC_URI = "https://github.com/shadow-maint/shadow/releases/download/v${PV}/${BP}
            file://0001-Fix-out-of-tree-builds-with-respect-to-libsubid-incl.patch \
            file://0001-libsubid-link-to-PAM-libraries.patch \
            file://0001-libmisc-fix-default-value-in-SHA_get_salt_rounds.patch \
+           file://useradd \
            "
 
 SRC_URI:append:class-target = " \
@@ -116,6 +117,8 @@ do_install() {
        # Use proper encryption for passwords
        sed -i 's/^#ENCRYPT_METHOD.*$/ENCRYPT_METHOD SHA512/' ${D}${sysconfdir}/login.defs
 
+       install -d ${D}${sysconfdir}/default
+       install -m 0644 ${WORKDIR}/useradd ${D}${sysconfdir}/default
 }
 
 do_install:append() {