1
/* cgi-wrapper.c --- Generic wrapper that will take info from a environment
2
* variable, and pass it to two commands.
4
* Copyright (C) 1998,1999,2000,2001,2002 by the Free Software Foundation, Inc.
6
* This program is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU General Public License
8
* as published by the Free Software Foundation; either version 2
9
* of the License, or (at your option) any later version.
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, write to the Free Software
18
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24
/* passed in by configure */
25
#define SCRIPTNAME SCRIPT
26
#define LOG_IDENT "Mailman cgi-wrapper (" SCRIPT ")"
28
/* Group name that CGI scripts run as. See your web server's documentation
31
#define LEGAL_PARENT_GROUP CGI_GROUP
33
const char* logident = LOG_IDENT;
34
char* script = SCRIPTNAME;
35
const char* parentgroup = LEGAL_PARENT_GROUP;
39
main(int argc, char** argv, char** env)
45
check_caller(logident, parentgroup);
47
/* For these CGI programs, we can ignore argc and argv since they
48
* don't contain anything useful. `script' will always be the driver
49
* program and argv will always just contain the name of the real
50
* script for the driver to import and execute (padded with two dummy
51
* values in argv[0] and argv[1] that are ignored by run_script().
55
fake_argv[2] = script;
57
status = run_script("driver", 3, fake_argv, env);
58
fatal(logident, status, "%s", strerror(errno));
66
* c-file-style: "python"