diff options
Diffstat (limited to 'support')
-rw-r--r-- | support/suexec.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/support/suexec.c b/support/suexec.c index 1037a06c6e..59371be0bb 100644 --- a/support/suexec.c +++ b/support/suexec.c @@ -395,13 +395,15 @@ int main(int argc, char *argv[]) log_err("invalid target group name: (%s)\n", target_gname); exit(106); } - gid = gr->gr_gid; - actual_gname = strdup(gr->gr_name); } else { - gid = atoi(target_gname); - actual_gname = strdup(target_gname); + if ((gr = getgrgid(atoi(target_gname))) == NULL) { + log_err("invalid target group id: (%s)\n", target_gname); + exit(106); + } } + gid = gr->gr_gid; + actual_gname = strdup(gr->gr_name); #ifdef _OSD_POSIX /* |