diff options
Diffstat (limited to 'meta-perl/recipes-perl/adduser/files/adduser-add-M-option-for-useradd-when-no-create-home.patch')
-rw-r--r-- | meta-perl/recipes-perl/adduser/files/adduser-add-M-option-for-useradd-when-no-create-home.patch | 57 |
1 files changed, 0 insertions, 57 deletions
diff --git a/meta-perl/recipes-perl/adduser/files/adduser-add-M-option-for-useradd-when-no-create-home.patch b/meta-perl/recipes-perl/adduser/files/adduser-add-M-option-for-useradd-when-no-create-home.patch deleted file mode 100644 index 4b0a03f02..000000000 --- a/meta-perl/recipes-perl/adduser/files/adduser-add-M-option-for-useradd-when-no-create-home.patch +++ /dev/null | |||
@@ -1,57 +0,0 @@ | |||
1 | From 809f00a6ef0224b41b2e1207194c8da3cd3e3c7e Mon Sep 17 00:00:00 2001 | ||
2 | From: Jackie Huang <jackie.huang@windriver.com> | ||
3 | Date: Thu, 18 Dec 2014 17:23:37 +0800 | ||
4 | Subject: [PATCH] adduser: add -M option for useradd when --no-create-home is specified | ||
5 | |||
6 | The useradd (from package passwd) in debian based system sets -M (--no-create-home) by default, | ||
7 | but the one we are using (from package shadow) sets -m (--create-home) by default, so we | ||
8 | need to explicitly add -M option for useradd call when --no-create-home is specified for adduser. | ||
9 | |||
10 | Upstream-Status: Pending | ||
11 | |||
12 | Signed-off-by: Jackie Huang <jackie.huang@windriver.com> | ||
13 | --- | ||
14 | adduser | 20 ++++++++++++++++---- | ||
15 | 1 files changed, 16 insertions(+), 4 deletions(-) | ||
16 | |||
17 | diff --git a/adduser b/adduser | ||
18 | index c3bd8b0..9a07f9f 100755 | ||
19 | --- a/adduser | ||
20 | +++ b/adduser | ||
21 | @@ -434,8 +434,14 @@ if ($action eq "addsysuser") { | ||
22 | $shell = $special_shell || '/bin/false'; | ||
23 | $undouser = $new_name; | ||
24 | my $useradd = &which('useradd'); | ||
25 | - &systemcall($useradd, '-d', $home_dir, '-g', $ingroup_name, '-s', | ||
26 | - $shell, '-u', $new_uid, $new_name); | ||
27 | + if ($no_create_home) { | ||
28 | + &systemcall($useradd, '-d', $home_dir, '-g', $ingroup_name, '-s', | ||
29 | + $shell, '-u', $new_uid, '-M', $new_name); | ||
30 | + } | ||
31 | + else { | ||
32 | + &systemcall($useradd, '-d', $home_dir, '-g', $ingroup_name, '-s', | ||
33 | + $shell, '-u', $new_uid, $new_name); | ||
34 | + } | ||
35 | if(!$disabled_login) { | ||
36 | my $usermod = &which('usermod'); | ||
37 | &systemcall($usermod, '-p', '*', $new_name); | ||
38 | @@ -524,8 +530,14 @@ if ($action eq "adduser") { | ||
39 | $shell = $special_shell || $config{"dshell"}; | ||
40 | $undouser = $new_name; | ||
41 | my $useradd = &which('useradd'); | ||
42 | - &systemcall($useradd, '-d', $home_dir, '-g', $ingroup_name, '-s', | ||
43 | - $shell, '-u', $new_uid, $new_name); | ||
44 | + if ($no_create_home) { | ||
45 | + &systemcall($useradd, '-d', $home_dir, '-g', $ingroup_name, '-s', | ||
46 | + $shell, '-u', $new_uid, '-M', $new_name); | ||
47 | + } | ||
48 | + else { | ||
49 | + &systemcall($useradd, '-d', $home_dir, '-g', $ingroup_name, '-s', | ||
50 | + $shell, '-u', $new_uid, $new_name); | ||
51 | + } | ||
52 | &invalidate_nscd(); | ||
53 | |||
54 | create_homedir (1); # copy skeleton data | ||
55 | -- | ||
56 | 1.7.1 | ||
57 | |||