[Adduser-devel] [PATCH] adduser: add -M option for useradd
jackie.huang at windriver.com
jackie.huang at windriver.com
Wed Oct 19 02:54:13 UTC 2016
From: Jackie Huang <jackie.huang at windriver.com>
The -M (--no-create-home) option is set for useradd
by default on debian based system, but it's not on
other system like Yocto, add -M option always so
it works the same when porting to other systems.
Signed-off-by: Jackie Huang <jackie.huang at windriver.com>
---
adduser | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/adduser b/adduser
index a5f83f3..f6cb52c 100755
--- a/adduser
+++ b/adduser
@@ -435,7 +435,7 @@ if ($action eq "addsysuser") {
$undouser = $new_name;
my $useradd = &which('useradd');
&systemcall($useradd, '-d', $home_dir, '-g', $ingroup_name, '-s',
- $shell, '-u', $new_uid, $new_name);
+ $shell, '-u', $new_uid, '-M', $new_name);
if(!$disabled_login) {
my $usermod = &which('usermod');
&systemcall($usermod, '-p', '*', $new_name);
@@ -525,7 +525,7 @@ if ($action eq "adduser") {
$undouser = $new_name;
my $useradd = &which('useradd');
&systemcall($useradd, '-d', $home_dir, '-g', $ingroup_name, '-s',
- $shell, '-u', $new_uid, $new_name);
+ $shell, '-u', $new_uid, '-M', $new_name);
&invalidate_nscd();
create_homedir (1); # copy skeleton data
--
2.8.3
More information about the Adduser-devel
mailing list