diff options
author | Wolfram Schneider <wosch@FreeBSD.org> | 1996-02-10 17:15:47 +0000 |
---|---|---|
committer | Wolfram Schneider <wosch@FreeBSD.org> | 1996-02-10 17:15:47 +0000 |
commit | e2c869cbfe54894510133c8ead54cb72b9f9f795 (patch) | |
tree | b58a1e5ed5dce2f3c880fc8a5f4e087002cdb8df /adduser | |
parent | b64f14fcdf0069b38141d4ec719670e796c332a5 (diff) | |
download | pw-darwin-e2c869cbfe54894510133c8ead54cb72b9f9f795.tar.gz pw-darwin-e2c869cbfe54894510133c8ead54cb72b9f9f795.tar.zst pw-darwin-e2c869cbfe54894510133c8ead54cb72b9f9f795.zip |
Submitted by: Masafumi NAKANE <masafumi@tky007.tth.expo96.ad.jp>
bugfix: chown home directory if don't copy dotfiles
Diffstat (limited to 'adduser')
-rw-r--r-- | adduser/adduser.perl | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/adduser/adduser.perl b/adduser/adduser.perl index 5b548e6..00556a1 100644 --- a/adduser/adduser.perl +++ b/adduser/adduser.perl @@ -32,7 +32,7 @@ # # Email: Wolfram Schneider <wosch@cs.tu-berlin.de> # -# $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' |