Skip to contentSkip to conversation

shadow: add /etc/default/useradd

PATCH Superseded Yi Zhao 2 participants 2 messages Aug 17, 2021

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Yi Zhao

author
#0 lore raw

PATCH v2 1/1 shadow: add /etc/default/useradd

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 to update useradd settings.

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

---
 meta/recipes-extended/shadow/files/useradd | 8 ++++++++
 meta/recipes-extended/shadow/shadow.inc    | 3 +++
 2 files changed, 11 insertions(+)
 create mode 100644 meta/recipes-extended/shadow/files/useradd
meta/recipes-extended/shadow/files/useradd new file +8 -0
new file mode 100644
index 0000000000..782aeef418
@@ -0,0 +1,8 @@
+# useradd defaults file
+GROUP=100
+HOME=/home
+INACTIVE=-1
+EXPIRE=
+SHELL=/bin/sh
+SKEL=/etc/skel
+CREATE_MAIL_SPOOL=no
meta/recipes-extended/shadow/shadow.inc +3 -0
index 97ffae978a..44b9898897 100644
@@ -16,6 +16,7 @@ SRC_URI = "https://github.com/shadow-maint/shadow/releases/download/v${PV}/${BP}
            file://shadow-relaxed-usernames.patch \
            file://0001-Fix-out-of-tree-builds-with-respect-to-libsubid-incl.patch \
            file://0001-libsubid-link-to-PAM-libraries.patch \
+           file://useradd \
            "
 
 SRC_URI:append:class-target = " \
@@ -115,6 +116,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() {
Signature · 1 line
2.25.1
#1 lore raw

Thanks, this should work fine :)

Alex

Quoted 60 lines · Yi Zhao

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 to update useradd settings.

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

---
 meta/recipes-extended/shadow/files/useradd | 8 ++++++++
 meta/recipes-extended/shadow/shadow.inc    | 3 +++
 2 files changed, 11 insertions(+)
 create mode 100644 meta/recipes-extended/shadow/files/useradd
meta/recipes-extended/shadow/files/useradd new file +8 -0
new file mode 100644
index 0000000000..782aeef418
@@ -0,0 +1,8 @@
+# useradd defaults file
+GROUP=100
+HOME=/home
+INACTIVE=-1
+EXPIRE=
+SHELL=/bin/sh
+SKEL=/etc/skel
+CREATE_MAIL_SPOOL=no
meta/recipes-extended/shadow/shadow.inc +1 -0
index 97ffae978a..44b9898897 100644
@@ -16,6 +16,7 @@ SRC_URI = "
 https://github.com/shadow-maint/shadow/releases/download/v${PV}/${BP}
            file://shadow-relaxed-usernames.patch \
 
 file://0001-Fix-out-of-tree-builds-with-respect-to-libsubid-incl.patch \
            file://0001-libsubid-link-to-PAM-libraries.patch \
+           file://useradd \
            "

SRC_URI:append:class-target = " \

meta/recipes-extended/shadow/shadow.inc +0 -0
@@ -115,6 +116,8 @@ do_install() {
        # Use proper encryption for passwords
        sed -i 's/^#ENCRYPT_METHOD.*$/ENCRYPT_METHOD SHA512/'

${D}${sysconfdir}/login.defs

meta/recipes-extended/shadow/shadow.inc +2 -1
+       install -d ${D}${sysconfdir}/default
+       install -m 0644 ${WORKDIR}/useradd ${D}${sysconfdir}/default
 }
 
 do_install:append() {
--

2.25.1