From 8914cc4b3aa056bd29fb140eb848fd500ade78fb Mon Sep 17 00:00:00 2001 From: mike Date: Sat, 19 Jul 2003 22:13:54 +0000 Subject: [PATCH] Mirror 1.1.x changes. git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/branches/branch-1.2@3795 7a7537e8-13f0-0310-91df-b6672ffda945 --- scheduler/client.c | 16 +++++++++------- scheduler/dirsvc.c | 19 ++++++++++++------- scheduler/job.c | 16 +++++++++------- 3 files changed, 30 insertions(+), 21 deletions(-) diff --git a/scheduler/client.c b/scheduler/client.c index 2502f774ba..a206aade06 100644 --- a/scheduler/client.c +++ b/scheduler/client.c @@ -1,5 +1,5 @@ /* - * "$Id: client.c,v 1.91.2.61 2003/07/19 21:57:46 mike Exp $" + * "$Id: client.c,v 1.91.2.62 2003/07/19 22:13:52 mike Exp $" * * Client routines for the Common UNIX Printing System (CUPS) scheduler. * @@ -3201,12 +3201,14 @@ pipe_command(client_t *con, /* I - Client connection */ if (setuid(User)) exit(errno); } + else + { + /* + * Reset group membership to just the main one we belong to. + */ - /* - * Reset group membership to just the main one we belong to. - */ - - setgroups(0, NULL); + setgroups(0, NULL); + } /* * Update stdin/stdout/stderr... @@ -3351,5 +3353,5 @@ CDSAWriteFunc(SSLConnectionRef connection, /* I - SSL/TLS connection */ /* - * End of "$Id: client.c,v 1.91.2.61 2003/07/19 21:57:46 mike Exp $". + * End of "$Id: client.c,v 1.91.2.62 2003/07/19 22:13:52 mike Exp $". */ diff --git a/scheduler/dirsvc.c b/scheduler/dirsvc.c index fdab5634eb..4cb1837596 100644 --- a/scheduler/dirsvc.c +++ b/scheduler/dirsvc.c @@ -1,5 +1,5 @@ /* - * "$Id: dirsvc.c,v 1.73.2.33 2003/05/12 20:52:12 mike Exp $" + * "$Id: dirsvc.c,v 1.73.2.34 2003/07/19 22:13:53 mike Exp $" * * Directory services routines for the Common UNIX Printing System (CUPS). * @@ -920,15 +920,20 @@ StartPolling(void) if (setgid(Group)) exit(errno); + if (setgroups(0, NULL)) + exit(errno); + if (setuid(User)) exit(errno); } + else + { + /* + * Reset group membership to just the main one we belong to. + */ - /* - * Reset group membership to just the main one we belong to. - */ - - setgroups(0, NULL); + setgroups(0, NULL); + } /* * Redirect stdin and stdout to /dev/null, and stderr to the @@ -1937,5 +1942,5 @@ UpdateSLPBrowse(void) /* - * End of "$Id: dirsvc.c,v 1.73.2.33 2003/05/12 20:52:12 mike Exp $". + * End of "$Id: dirsvc.c,v 1.73.2.34 2003/07/19 22:13:53 mike Exp $". */ diff --git a/scheduler/job.c b/scheduler/job.c index 7ca301ef1d..a167065a0d 100644 --- a/scheduler/job.c +++ b/scheduler/job.c @@ -1,5 +1,5 @@ /* - * "$Id: job.c,v 1.124.2.73 2003/07/19 21:57:47 mike Exp $" + * "$Id: job.c,v 1.124.2.74 2003/07/19 22:13:54 mike Exp $" * * Job management routines for the Common UNIX Printing System (CUPS). * @@ -2709,12 +2709,14 @@ start_process(const char *command, /* I - Full path to command */ if (setuid(User)) exit(errno); } + else + { + /* + * Reset group membership to just the main one we belong to. + */ - /* - * Reset group membership to just the main one we belong to. - */ - - setgroups(0, NULL); + setgroups(0, NULL); + } /* * Change umask to restrict permissions on created files... @@ -2773,5 +2775,5 @@ start_process(const char *command, /* I - Full path to command */ /* - * End of "$Id: job.c,v 1.124.2.73 2003/07/19 21:57:47 mike Exp $". + * End of "$Id: job.c,v 1.124.2.74 2003/07/19 22:13:54 mike Exp $". */ -- 2.47.3