~maxb/debian/sid/mailman/red-bean

« back to all changes in this revision

Viewing changes to .pc/10_wrapper_uid.patch/src/cgi-wrapper.c

  • Committer: Bazaar Package Importer
  • Author(s): Thijs Kinkhorst
  • Date: 2010-07-13 21:35:40 UTC
  • mto: This revision was merged to the branch mainline in revision 14.
  • Revision ID: james.westby@ubuntu.com-20100713213540-g9zrs50cua0o8f5h
Tags: 1:2.1.13-3
* Drop unneeded Indexes option from shipped apache.conf.
* Eliminate update_rc.d warning by not passing runlevel 1 at stop.
* Add 25_site_logo patch by Paul Wise (closes: #267243).
* Do not compress PDF's under /u/s/d/mailman (closes: #582259).
* Back up ./configure before running autoconf, so it can be restored
  in clean as not to generate irrelevant diff.gz content.
* Switch to dpkg-source 3.0 (quilt) format.
* Checked for policy 3.9.0, no changes needed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* cgi-wrapper.c --- Generic wrapper that will take info from a environment
 
2
 * variable, and pass it to two commands.
 
3
 *
 
4
 * Copyright (C) 1998,1999,2000,2001,2002 by the Free Software Foundation, Inc.
 
5
 *
 
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.
 
10
 *
 
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.
 
15
 *
 
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.
 
19
 *
 
20
 */
 
21
 
 
22
#include "common.h"
 
23
 
 
24
/* passed in by configure */
 
25
#define SCRIPTNAME  SCRIPT
 
26
#define LOG_IDENT   "Mailman cgi-wrapper (" SCRIPT ")"
 
27
 
 
28
/* Group name that CGI scripts run as.  See your web server's documentation
 
29
 * for details.
 
30
 */
 
31
#define LEGAL_PARENT_GROUP CGI_GROUP
 
32
 
 
33
const char* logident = LOG_IDENT;
 
34
char* script = SCRIPTNAME;
 
35
const char* parentgroup = LEGAL_PARENT_GROUP;
 
36
 
 
37
 
 
38
int
 
39
main(int argc, char** argv, char** env)
 
40
{
 
41
        int status;
 
42
        char* fake_argv[3];
 
43
 
 
44
        running_as_cgi = 1;
 
45
        check_caller(logident, parentgroup);
 
46
 
 
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().
 
52
         */
 
53
        fake_argv[0] = NULL;
 
54
        fake_argv[1] = NULL;
 
55
        fake_argv[2] = script;
 
56
 
 
57
        status = run_script("driver", 3, fake_argv, env);
 
58
        fatal(logident, status, "%s", strerror(errno));
 
59
        return status;
 
60
}
 
61
 
 
62
 
 
63
 
 
64
/*
 
65
 * Local Variables:
 
66
 * c-file-style: "python"
 
67
 * End:
 
68
 */