diff options
author | Jiaqing Zhao <jiaqing.zhao@linux.intel.com> | 2022-04-30 10:48:10 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-04-30 22:00:20 +0100 |
commit | b08c60224fad7e9134673f0e18a2a8fdd99ccc1a (patch) | |
tree | 9eca1f26b02e728b1cce7985c099703ce88b6420 /meta/recipes-core/base-passwd | |
parent | fc80c5ee16dfa2bfe05da088d7a690af9eb62dcf (diff) | |
download | poky-b08c60224fad7e9134673f0e18a2a8fdd99ccc1a.tar.gz |
base-passwd: Disable shell for default users
Change the shell of all global static users other than root (which
retains /bin/sh) and sync (as /bin/sync is rather harmless) to
/sbin/nologin (as /usr/sbin/nologin does not exist in openembedded)
Upstream-Status: Backport [https://launchpad.net/ubuntu/+source/base-passwd/3.5.30]
(From OE-Core rev: ba3bc4d7a0a39a96f6e8d340e1b2654d47475f07)
Signed-off-by: Jiaqing Zhao <jiaqing.zhao@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/base-passwd')
-rw-r--r-- | meta/recipes-core/base-passwd/base-passwd/disable-shell.patch | 57 | ||||
-rw-r--r-- | meta/recipes-core/base-passwd/base-passwd_3.5.29.bb | 1 |
2 files changed, 58 insertions, 0 deletions
diff --git a/meta/recipes-core/base-passwd/base-passwd/disable-shell.patch b/meta/recipes-core/base-passwd/base-passwd/disable-shell.patch new file mode 100644 index 0000000000..dddc93ca35 --- /dev/null +++ b/meta/recipes-core/base-passwd/base-passwd/disable-shell.patch | |||
@@ -0,0 +1,57 @@ | |||
1 | From 91e0db96741359173ddf2be083aafcc1a3c32472 Mon Sep 17 00:00:00 2001 | ||
2 | From: Jiaqing Zhao <jiaqing.zhao@linux.intel.com> | ||
3 | Date: Mon, 18 Apr 2022 11:22:43 +0800 | ||
4 | Subject: [PATCH] Disable shell for default users | ||
5 | |||
6 | Change the shell of all global static users other than root (which | ||
7 | retains /bin/sh) and sync (as /bin/sync is rather harmless) to | ||
8 | /sbin/nologin (as /usr/sbin/nologin does not exist in openembedded) | ||
9 | |||
10 | Upstream-Status: Backport [https://launchpad.net/ubuntu/+source/base-passwd/3.5.30] | ||
11 | Signed-off-by: Jiaqing Zhao <jiaqing.zhao@linux.intel.com> | ||
12 | --- | ||
13 | passwd.master | 32 ++++++++++++++++---------------- | ||
14 | 1 file changed, 16 insertions(+), 16 deletions(-) | ||
15 | |||
16 | diff --git a/passwd.master b/passwd.master | ||
17 | index e1c32ff..0cd5ffd 100644 | ||
18 | --- a/passwd.master | ||
19 | +++ b/passwd.master | ||
20 | @@ -1,18 +1,18 @@ | ||
21 | root::0:0:root:/root:/bin/sh | ||
22 | -daemon:*:1:1:daemon:/usr/sbin:/bin/sh | ||
23 | -bin:*:2:2:bin:/bin:/bin/sh | ||
24 | -sys:*:3:3:sys:/dev:/bin/sh | ||
25 | +daemon:*:1:1:daemon:/usr/sbin:/sbin/nologin | ||
26 | +bin:*:2:2:bin:/bin:/sbin/nologin | ||
27 | +sys:*:3:3:sys:/dev:/sbin/nologin | ||
28 | sync:*:4:65534:sync:/bin:/bin/sync | ||
29 | -games:*:5:60:games:/usr/games:/bin/sh | ||
30 | -man:*:6:12:man:/var/cache/man:/bin/sh | ||
31 | -lp:*:7:7:lp:/var/spool/lpd:/bin/sh | ||
32 | -mail:*:8:8:mail:/var/mail:/bin/sh | ||
33 | -news:*:9:9:news:/var/spool/news:/bin/sh | ||
34 | -uucp:*:10:10:uucp:/var/spool/uucp:/bin/sh | ||
35 | -proxy:*:13:13:proxy:/bin:/bin/sh | ||
36 | -www-data:*:33:33:www-data:/var/www:/bin/sh | ||
37 | -backup:*:34:34:backup:/var/backups:/bin/sh | ||
38 | -list:*:38:38:Mailing List Manager:/var/list:/bin/sh | ||
39 | -irc:*:39:39:ircd:/var/run/ircd:/bin/sh | ||
40 | -gnats:*:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh | ||
41 | -nobody:*:65534:65534:nobody:/nonexistent:/bin/sh | ||
42 | +games:*:5:60:games:/usr/games:/sbin/nologin | ||
43 | +man:*:6:12:man:/var/cache/man:/sbin/nologin | ||
44 | +lp:*:7:7:lp:/var/spool/lpd:/sbin/nologin | ||
45 | +mail:*:8:8:mail:/var/mail:/sbin/nologin | ||
46 | +news:*:9:9:news:/var/spool/news:/sbin/nologin | ||
47 | +uucp:*:10:10:uucp:/var/spool/uucp:/sbin/nologin | ||
48 | +proxy:*:13:13:proxy:/bin:/sbin/nologin | ||
49 | +www-data:*:33:33:www-data:/var/www:/sbin/nologin | ||
50 | +backup:*:34:34:backup:/var/backups:/sbin/nologin | ||
51 | +list:*:38:38:Mailing List Manager:/var/list:/sbin/nologin | ||
52 | +irc:*:39:39:ircd:/var/run/ircd:/sbin/nologin | ||
53 | +gnats:*:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/sbin/nologin | ||
54 | +nobody:*:65534:65534:nobody:/nonexistent:/sbin/nologin | ||
55 | -- | ||
56 | 2.32.0 | ||
57 | |||
diff --git a/meta/recipes-core/base-passwd/base-passwd_3.5.29.bb b/meta/recipes-core/base-passwd/base-passwd_3.5.29.bb index 9a27ad3ab5..ef7792ae49 100644 --- a/meta/recipes-core/base-passwd/base-passwd_3.5.29.bb +++ b/meta/recipes-core/base-passwd/base-passwd_3.5.29.bb | |||
@@ -14,6 +14,7 @@ SRC_URI = "https://launchpad.net/debian/+archive/primary/+files/${BPN}_${PV}.tar | |||
14 | file://input.patch \ | 14 | file://input.patch \ |
15 | file://disable-docs.patch \ | 15 | file://disable-docs.patch \ |
16 | file://kvm.patch \ | 16 | file://kvm.patch \ |
17 | file://disable-shell.patch \ | ||
17 | " | 18 | " |
18 | 19 | ||
19 | SRC_URI[md5sum] = "6beccac48083fe8ae5048acd062e5421" | 20 | SRC_URI[md5sum] = "6beccac48083fe8ae5048acd062e5421" |