[Adduser-devel] [PATCH] adduser: add -M option for useradd

Huang, Jie (Jackie) Jackie.Huang at windriver.com
Wed Oct 19 03:21:41 UTC 2016



> -----Original Message-----
> From: jackie.huang at windriver.com [mailto:jackie.huang at windriver.com]
> Sent: Wednesday, October 19, 2016 10:54 AM
> To: adduser-devel at lists.alioth.debian.org
> Cc: Huang, Jie (Jackie)
> Subject: [PATCH] adduser: add -M option for useradd
> 
> 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);

The indentation is not consistent, sorry for that, I will change
and re-send.

Thanks,
Jackie

>      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