From d0b9d52ecf77e58eaa9e8e1d8a8724a938bbfd5a Mon Sep 17 00:00:00 2001 From: Fabian Keil Date: Thu, 24 Aug 2006 11:01:34 +0000 Subject: [PATCH] --user fix. Only use the user as group if no group is specified. Solves BR 1492612. Thanks to Spinor S. and David Laight. --- jcc.c | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/jcc.c b/jcc.c index a977c238..da261fe8 100644 --- a/jcc.c +++ b/jcc.c @@ -1,4 +1,4 @@ -const char jcc_rcs[] = "$Id: jcc.c,v 1.96 2006/08/15 20:12:36 david__schmidt Exp $"; +const char jcc_rcs[] = "$Id: jcc.c,v 1.97 2006/08/18 15:23:17 david__schmidt Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/jcc.c,v $ @@ -33,6 +33,27 @@ const char jcc_rcs[] = "$Id: jcc.c,v 1.96 2006/08/15 20:12:36 david__schmidt Exp * * Revisions : * $Log: jcc.c,v $ + * Revision 1.97 2006/08/18 15:23:17 david__schmidt + * Windows service (re-)integration + * + * The new args are: + * + * --install[:service_name] + * --uninstall[:service_name] + * --service + * + * They work as follows: + * --install will create a service for you and then terminate. + * By default the service name will be "privoxy" (without the quotes). + * However you can run multiple services if you wish, just by adding + * a colon and then a name (no spaces). + * + * --uninstall follows the exact same rules a --install. + * + * --service is used when the program is executed by the service + * control manager, and in normal circumstances would never be + * used as a command line argument. + * * Revision 1.96 2006/08/15 20:12:36 david__schmidt * Windows service integration * @@ -2135,7 +2156,7 @@ int main(int argc, const char *argv[]) if (NULL != pw) { - if (((NULL != grp) && setgid(grp->gr_gid)) || (setgid(pw->pw_gid))) + if (setgid((NULL != grp) ? grp->gr_gid : pw->pw_gid)) { log_error(LOG_LEVEL_FATAL, "Cannot setgid(): Insufficient permissions."); } -- 2.39.2