diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2011-01-26 15:23:51 +0100 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2011-01-26 15:23:51 +0100 |
commit | bfcf332ff45fcca15897b84b3f24476559a17f85 (patch) | |
tree | 90c1952602107b993c28896b60ccf1edb149c2a1 | |
parent | e7a838c31d8db6a3621b9eada1e7e94c4806ccb2 (diff) | |
download | webfs-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.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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()); } |