X-Git-Url: http://www.privoxy.org/gitweb/?a=blobdiff_plain;f=jcc.c;h=face11b511d2be7557868d0c684640350b9df99f;hb=4a427f8f3021e8b725ad3530f8c8c872c084e7e0;hp=f2fa2cfca6e91799a1d1296eedac387a077fe7c1;hpb=4633ee87749c102bc15660c144e3a0b5119526ec;p=privoxy.git diff --git a/jcc.c b/jcc.c index f2fa2cfc..face11b5 100644 --- a/jcc.c +++ b/jcc.c @@ -1,4 +1,4 @@ -const char jcc_rcs[] = "$Id: jcc.c,v 1.379 2012/07/23 12:39:12 fabiankeil Exp $"; +const char jcc_rcs[] = "$Id: jcc.c,v 1.381 2012/07/23 12:40:52 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/jcc.c,v $ @@ -3032,12 +3032,7 @@ int main(int argc, char **argv) basedir = strdup_or_die(cwd); /* XXX: why + 5? */ abs_file_size = strlen(cwd) + strlen(configfile) + 5; - abs_file = malloc(abs_file_size); - if (NULL == abs_file) - { - perror("malloc failed"); - exit(1); - } + abs_file = malloc_or_die(abs_file_size); strlcpy(abs_file, basedir, abs_file_size); strlcat(abs_file, "/", abs_file_size); strlcat(abs_file, configfile, abs_file_size); @@ -3198,12 +3193,9 @@ int main(int argc, char **argv) { log_error(LOG_LEVEL_FATAL, "Cannot setgid(): Insufficient permissions."); } - if (NULL != grp) + if ((NULL != grp) && setgroups(1, &grp->gr_gid)) { - if (setgroups(1, &grp->gr_gid)) - { - log_error(LOG_LEVEL_FATAL, "setgroups() failed: %E"); - } + log_error(LOG_LEVEL_FATAL, "setgroups() failed: %E"); } else if (initgroups(pw->pw_name, pw->pw_gid)) {