1
1
/* common.c --- Common routines, constants, etc. Used by all the wrappers.
3
* Copyright (C) 1998,1999,2000,2001,2002 by the Free Software Foundation, Inc.
3
* Copyright (C) 1998-2005 by the Free Software Foundation, Inc.
5
5
* This program is free software; you can redistribute it and/or
6
6
* modify it under the terms of the GNU General Public License
15
15
* You should have received a copy of the GNU General Public License
16
16
* along with this program; if not, write to the Free Software
17
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
20
21
#include "common.h"
119
120
check_caller(const char* ident, const char* parentgroup)
121
122
GID_T mygid = getgid();
122
struct group *mygroup = getgrgid(mygid);
127
if (running_as_cgi) {
128
option = "--with-cgi-gid";
133
option = "--with-mail-gid";
139
fatal(ident, GROUP_NAME_NOT_FOUND,
140
"Failure to find group name %s. Try adding this group\n"
141
"to your system, or re-run configure, providing an\n"
142
"existing group name with the command line option %s.",
143
parentgroup, option);
123
struct group *mygroup = getgrgid(mygid);
128
if (running_as_cgi) {
129
option = "--with-cgi-gid";
134
option = "--with-mail-gid";
140
fatal(ident, GROUP_NAME_NOT_FOUND,
141
"Failure to find group name for GID %d. Mailman\n"
142
"expected the %s wrapper to be executed as group\n"
143
"\"%s\", but the system's %s server executed the\n"
144
"wrapper as GID %d for which the name could not be\n"
145
"found. Try adding GID %d to your system as \"%s\",\n"
146
"or tweak your %s server to run the wrapper as group\n"
148
mygid, wrapper, parentgroup, server, mygid, mygid,
149
parentgroup, server, parentgroup);
145
151
if (strcmp(parentgroup, mygroup->gr_name))
146
152
fatal(ident, GROUP_MISMATCH,
147
"Group mismatch error. Mailman expected the %s\n"
148
"wrapper script to be executed as group \"%s\", but\n"
149
"the system's %s server executed the %s script as\n"
150
"group \"%s\". Try tweaking the %s server to run the\n"
151
"script as group \"%s\", or re-run configure, \n"
152
"providing the command line option `%s=%s'.",
153
wrapper, parentgroup, server, wrapper, mygroup->gr_name,
154
server, parentgroup, option, mygroup->gr_name);
153
"Group mismatch error. Mailman expected the %s\n"
154
"wrapper script to be executed as group \"%s\", but\n"
155
"the system's %s server executed the %s script as\n"
156
"group \"%s\". Try tweaking the %s server to run the\n"
157
"script as group \"%s\", or re-run configure, \n"
158
"providing the command line option `%s=%s'.",
159
wrapper, parentgroup, server, wrapper, mygroup->gr_name,
160
server, parentgroup, option, mygroup->gr_name);