summaryrefslogtreecommitdiff
path: root/src/mail-wrapper.c
diff options
context:
space:
mode:
authorbwarsaw2002-08-23 20:40:27 +0000
committerbwarsaw2002-08-23 20:40:27 +0000
commit66f7d6350e70589f43341b3d25e091bfad56db4f (patch)
tree404269c59e06088061bc81d77cf2f8d786cc7424 /src/mail-wrapper.c
parent589b3bc54504c0126e226c8dac19e288dea51ae8 (diff)
downloadmailman-66f7d6350e70589f43341b3d25e091bfad56db4f.tar.gz
mailman-66f7d6350e70589f43341b3d25e091bfad56db4f.tar.zst
mailman-66f7d6350e70589f43341b3d25e091bfad56db4f.zip
Diffstat (limited to 'src/mail-wrapper.c')
-rw-r--r--src/mail-wrapper.c78
1 files changed, 38 insertions, 40 deletions
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;
}