aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2011-01-26 15:23:51 +0100
committerGerd Hoffmann <kraxel@redhat.com>2011-01-26 15:23:51 +0100
commitbfcf332ff45fcca15897b84b3f24476559a17f85 (patch)
tree90c1952602107b993c28896b60ccf1edb149c2a1
parente7a838c31d8db6a3621b9eada1e7e94c4806ccb2 (diff)
downloadwebfs-bfcf332ff45fcca15897b84b3f24476559a17f85.tar.gz
fix default group
When starting webfsd with -u $user but without -g $group the group wasn't changed. Now the default group of the user specified is used instead.
-rw-r--r--webfsd.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/webfsd.c b/webfsd.c
index 2f3bf6e..cb29b56 100644
--- a/webfsd.c
+++ b/webfsd.c
@@ -197,11 +197,13 @@ fix_ug(void)
pw = getpwuid(atoi(user));
} else {
pw = getpwuid(getuid());
+ gr = getgrgid(pw->pw_gid);
}
if (0 == getuid() && strlen(group) > 0) {
if (NULL == (gr = getgrnam(group)))
gr = getgrgid(atoi(group));
- } else {
+ }
+ if (NULL == gr) {
gr = getgrgid(getgid());
}