diff options
| author | bwarsaw | 2002-08-23 20:40:27 +0000 |
|---|---|---|
| committer | bwarsaw | 2002-08-23 20:40:27 +0000 |
| commit | 66f7d6350e70589f43341b3d25e091bfad56db4f (patch) | |
| tree | 404269c59e06088061bc81d77cf2f8d786cc7424 | |
| parent | 589b3bc54504c0126e226c8dac19e288dea51ae8 (diff) | |
| download | mailman-66f7d6350e70589f43341b3d25e091bfad56db4f.tar.gz mailman-66f7d6350e70589f43341b3d25e091bfad56db4f.tar.zst mailman-66f7d6350e70589f43341b3d25e091bfad56db4f.zip | |
| -rw-r--r-- | src/cgi-wrapper.c | 48 | ||||
| -rw-r--r-- | src/mail-wrapper.c | 78 |
2 files changed, 63 insertions, 63 deletions
diff --git a/src/cgi-wrapper.c b/src/cgi-wrapper.c index 8b00f9f13..351d4e1ed 100644 --- a/src/cgi-wrapper.c +++ b/src/cgi-wrapper.c @@ -7,14 +7,14 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * */ @@ -25,36 +25,38 @@ #define SCRIPTNAME SCRIPT #define LOG_IDENT "Mailman cgi-wrapper (" SCRIPT ")" -/* GID that CGI scripts run as. See your Web server's documentation. */ -#define LEGAL_PARENT_GID CGI_GID +/* Group name that CGI scripts run as. See your web server's documentation + * for details. + */ +#define LEGAL_PARENT_GROUP CGI_GROUP const char* logident = LOG_IDENT; char* script = SCRIPTNAME; -const GID_T parentgid = LEGAL_PARENT_GID; +const char* parentgroup = LEGAL_PARENT_GROUP; int -main(int argc, char** argv, char** env) +main(int argc, char** argv, char** env) { - int status; - char* fake_argv[3]; + int status; + char* fake_argv[3]; - running_as_cgi = 1; - check_caller(logident, parentgid); + running_as_cgi = 1; + check_caller(logident, parentgroup); - /* for these CGI programs, we can ignore argc and argv since they - * don't contain anything useful. `script' will always be the driver - * program and argv will always just contain the name of the real - * script for the driver to import and execute (padded with two dummy - * values in argv[0] and argv[1] that are ignored by run_script(). - */ - fake_argv[0] = NULL; - fake_argv[1] = NULL; - fake_argv[2] = script; + /* For these CGI programs, we can ignore argc and argv since they + * don't contain anything useful. `script' will always be the driver + * program and argv will always just contain the name of the real + * script for the driver to import and execute (padded with two dummy + * values in argv[0] and argv[1] that are ignored by run_script(). + */ + fake_argv[0] = NULL; + fake_argv[1] = NULL; + fake_argv[2] = script; - status = run_script("driver", 3, fake_argv, env); - fatal(logident, status, "%s", strerror(errno)); - return status; + status = run_script("driver", 3, fake_argv, env); + fatal(logident, status, "%s", strerror(errno)); + return status; } diff --git a/src/mail-wrapper.c b/src/mail-wrapper.c index 24a77ca45..2d63a9804 100644 --- a/src/mail-wrapper.c +++ b/src/mail-wrapper.c @@ -7,57 +7,55 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "common.h" -/* TBD: Should make this an array too?... */ - -/* GID that your sendmail runs filter programs as. See you sendmail.cf - * documentation for details +/* Group name that your mail programs run as. See your mail server's + * documentation for details. */ -#define LEGAL_PARENT_GID MAIL_GID +#define LEGAL_PARENT_GROUP MAIL_GROUP -const GID_T parentgid = LEGAL_PARENT_GID; +const char* parentgroup = LEGAL_PARENT_GROUP; const char* logident = "Mailman mail-wrapper"; const char *VALID_COMMANDS[] = { - "admin", - "bounces", - "confirm", - "join", - "leave", - "post", - "owner", - "request", - "subscribe", - "unsubscribe", - NULL /* Sentinel, don't remove */ + "admin", + "bounces", + "confirm", + "join", + "leave", + "post", + "owner", + "request", + "subscribe", + "unsubscribe", + NULL /* Sentinel, don't remove */ }; int check_command(char *command) { - int i = 0; + int i = 0; - while (VALID_COMMANDS[i] != NULL) { - if (!strcmp(command, VALID_COMMANDS[i])) - return 1; - i++; - } - return 0; + while (VALID_COMMANDS[i] != NULL) { + if (!strcmp(command, VALID_COMMANDS[i])) + return 1; + i++; + } + return 0; } @@ -65,23 +63,23 @@ check_command(char *command) int main(int argc, char** argv, char** env) { - int status; + int status; - /* sanity check arguments */ - if (argc < 2) - fatal(logident, MAIL_USAGE_ERROR, - "Usage: %s program [args...]", argv[0]); + /* sanity check arguments */ + if (argc < 2) + fatal(logident, MAIL_USAGE_ERROR, + "Usage: %s program [args...]", argv[0]); - if (!check_command(argv[1])) - fatal(logident, MAIL_ILLEGAL_COMMAND, - "Illegal command: %s", argv[1]); + if (!check_command(argv[1])) + fatal(logident, MAIL_ILLEGAL_COMMAND, + "Illegal command: %s", argv[1]); - check_caller(logident, parentgid); + check_caller(logident, parentgroup); - /* If we got here, everything must be OK */ - status = run_script(argv[1], argc, argv, env); - fatal(logident, status, "%s", strerror(errno)); - return status; + /* If we got here, everything must be OK */ + status = run_script(argv[1], argc, argv, env); + fatal(logident, status, "%s", strerror(errno)); + return status; } |
