diff options
author | Kai Kang <kai.kang@windriver.com> | 2020-01-09 14:15:58 +0800 |
---|---|---|
committer | Armin Kuster <akuster808@gmail.com> | 2020-01-19 09:05:19 -0800 |
commit | 81e186f6141a6e8f4ab3185b00b9f1392bb89ca1 (patch) | |
tree | 4d648bf70a1ad1a82fd9eba11f11429c43d77fd2 /meta-perl/recipes-perl | |
parent | ae5aa7b7e90b248b84b48541fac9ec75d391116f (diff) | |
download | meta-openembedded-81e186f6141a6e8f4ab3185b00b9f1392bb89ca1.tar.gz |
adduser: set default shell with /sbin/nologin
Shell nologin whether provided by shadow or util-linux is installed to
/sbin/nologin in oe-core. But the default shell of adduser is
/usr/sbin/nologin and will fail to create a new user.
Set the default shell with /sbin/nologin to fix the issue.
Signed-off-by: Kai Kang <kai.kang@windriver.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
(cherry picked from commit d49c0eba5bcd64a0dd1f2e389453f94d7efc988f)
Signed-off-by: Armin Kuster <akuster808@gmail.com>
Diffstat (limited to 'meta-perl/recipes-perl')
-rw-r--r-- | meta-perl/recipes-perl/adduser/adduser_3.118.bb | 1 | ||||
-rw-r--r-- | meta-perl/recipes-perl/adduser/files/0001-adduser-set-default-shell-with-sbin-nologin.patch | 34 |
2 files changed, 35 insertions, 0 deletions
diff --git a/meta-perl/recipes-perl/adduser/adduser_3.118.bb b/meta-perl/recipes-perl/adduser/adduser_3.118.bb index e695c5894..80cf14286 100644 --- a/meta-perl/recipes-perl/adduser/adduser_3.118.bb +++ b/meta-perl/recipes-perl/adduser/adduser_3.118.bb | |||
@@ -8,6 +8,7 @@ LIC_FILES_CHKSUM = "file://debian/copyright;md5=caed49ab166f22ef31bf1127f558d0ef | |||
8 | 8 | ||
9 | SRC_URI = "https://launchpad.net/debian/+archive/primary/+sourcefiles/adduser/${PV}/${BPN}_${PV}.tar.xz \ | 9 | SRC_URI = "https://launchpad.net/debian/+archive/primary/+sourcefiles/adduser/${PV}/${BPN}_${PV}.tar.xz \ |
10 | file://adduser-add-M-option-for-useradd.patch \ | 10 | file://adduser-add-M-option-for-useradd.patch \ |
11 | file://0001-adduser-set-default-shell-with-sbin-nologin.patch \ | ||
11 | " | 12 | " |
12 | 13 | ||
13 | SRC_URI[md5sum] = "44ba2475ebdaafc9613236bdda321c97" | 14 | SRC_URI[md5sum] = "44ba2475ebdaafc9613236bdda321c97" |
diff --git a/meta-perl/recipes-perl/adduser/files/0001-adduser-set-default-shell-with-sbin-nologin.patch b/meta-perl/recipes-perl/adduser/files/0001-adduser-set-default-shell-with-sbin-nologin.patch new file mode 100644 index 000000000..91cc6bcba --- /dev/null +++ b/meta-perl/recipes-perl/adduser/files/0001-adduser-set-default-shell-with-sbin-nologin.patch | |||
@@ -0,0 +1,34 @@ | |||
1 | From 75e949bf80bf5e3e5bd8f81b258095e662b705c4 Mon Sep 17 00:00:00 2001 | ||
2 | From: Kai Kang <kai.kang@windriver.com> | ||
3 | Date: Thu, 9 Jan 2020 13:51:28 +0800 | ||
4 | Subject: [PATCH] adduser: set default shell with /sbin/nologin | ||
5 | |||
6 | Shell nologin whether provided by shadow or util-linux is installed to | ||
7 | /sbin/nologin in oe-core. But the default shell of adduser is | ||
8 | /usr/sbin/nologin and will fail to create a new user. | ||
9 | |||
10 | Set the default shell with /sbin/nologin to fix the issue. | ||
11 | |||
12 | Upstream-Status: Inappropriate [OE specific] | ||
13 | |||
14 | Signed-off-by: Kai Kang <kai.kang@windriver.com> | ||
15 | --- | ||
16 | adduser | 2 +- | ||
17 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
18 | |||
19 | diff --git a/adduser b/adduser | ||
20 | index 0f24cc9..ab554d0 100755 | ||
21 | --- a/adduser | ||
22 | +++ b/adduser | ||
23 | @@ -431,7 +431,7 @@ if ($action eq "addsysuser") { | ||
24 | printf gtx("Adding new user `%s' (UID %d) with group `%s' ...\n"),$new_name,$new_uid,$ingroup_name | ||
25 | if $verbose; | ||
26 | $home_dir = $special_home || &homedir($new_name, $ingroup_name); | ||
27 | - $shell = $special_shell || '/usr/sbin/nologin'; | ||
28 | + $shell = $special_shell || '/sbin/nologin'; | ||
29 | $undouser = $new_name; | ||
30 | my $useradd = &which('useradd'); | ||
31 | &systemcall($useradd, '-d', $home_dir, '-g', $ingroup_name, '-s', | ||
32 | -- | ||
33 | 2.17.1 | ||
34 | |||