summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMilan Bouchet-Valat <nalimilan@club.fr>2010-08-21 14:58:15 +0200
committerMilan Bouchet-Valat <nalimilan@club.fr>2010-08-21 15:18:12 +0200
commit942f9320a4e8571d94749e7461683d76b40fa9c5 (patch)
tree5703bcb85ed464ce44794db4aabab71641959a77
parentdab5f3d1ba2cd266f327639a52b5d099ed059f1f (diff)
Fix chown syntax not supported on all platforms
We know the GID of the new user, so we can easily pass it to chown instead of omitting the main group, which is not supported by FreeBSD according to man pages.
-rw-r--r--Users/Users.pm2
1 files changed, 1 insertions, 1 deletions
diff --git a/Users/Users.pm b/Users/Users.pm
index a52ea56..d2b6812 100644
--- a/Users/Users.pm
+++ b/Users/Users.pm
@@ -657,7 +657,7 @@ sub add_user
# ensure user owns its home dir if asked
if ($chown_home && $$user[$HOME] ne "/")
{
- @command = ("chown", "-R", "$$user[$LOGIN]:", $$user[$HOME]);
+ @command = ("chown", "-R", "$$user[$LOGIN]:$$user[$GID]", $$user[$HOME]);
&Utils::File::run (@command);
}