summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWolfram Schneider <wosch@FreeBSD.org>1996-02-10 17:15:47 +0000
committerWolfram Schneider <wosch@FreeBSD.org>1996-02-10 17:15:47 +0000
commit54a3862761e80ebccc2f02846f9c1240f0acd5f9 (patch)
tree8406979f2c1e3830fcb3bfab41ea38e5ebfa26e6
parent8a135db228b51e6f57a19b8c4788118534bfe959 (diff)
downloadpw-darwin-54a3862761e80ebccc2f02846f9c1240f0acd5f9.tar.gz
pw-darwin-54a3862761e80ebccc2f02846f9c1240f0acd5f9.tar.zst
pw-darwin-54a3862761e80ebccc2f02846f9c1240f0acd5f9.zip
Submitted by: Masafumi NAKANE <masafumi@tky007.tth.expo96.ad.jp>
bugfix: chown home directory if don't copy dotfiles
-rw-r--r--adduser/adduser.perl10
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'