From 5038dc1abd9160d5fcfd91d75b1e45e735b3e2ae Mon Sep 17 00:00:00 2001 From: Wolfram Schneider Date: Sat, 10 Feb 1996 17:15:47 +0000 Subject: [PATCH] Submitted by: Masafumi NAKANE bugfix: chown home directory if don't copy dotfiles --- usr.sbin/adduser/adduser.perl | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/usr.sbin/adduser/adduser.perl b/usr.sbin/adduser/adduser.perl index 5b548e61edda..00556a12d621 100644 --- a/usr.sbin/adduser/adduser.perl +++ b/usr.sbin/adduser/adduser.perl @@ -32,7 +32,7 @@ # # Email: Wolfram Schneider # -# $Id: adduser.perl,v 1.8 1995/10/19 06:26:49 jkh Exp $ +# $Id: adduser.perl,v 1.9 1995/10/22 11:44:16 jkh Exp $ # # read variables @@ -938,7 +938,13 @@ sub home_create { return 0; } - return mkdir("$homedir",0755) if $dotdir eq "no"; + if ($dotdir eq 'no') { + if (!mkdir("$homedir",0755)) { + warn "mkdir $homedir: $!\n"; return 0; + } + system 'chown', "$name:$group", $homedir; + return !$?; + } # copy files from $dotdir to $homedir # rename 'dot.foo' files to '.foo'