root/alternc-mailman/tags/1.4.10/src/mailman.create.c

Revision 1240, 1.7 kB (checked in by lunar, 3 years ago)

r91@sud: lunar | 2006-03-11 15:40:01 +0100
Fix permissions on mailman wrappers.


We use only setgid and not setuid, so let's only use the setgid bit.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1 /*
2  $Id$
3  ----------------------------------------------------------------------
4  AlternC - Web Hosting System
5  Copyright (C) 2002 by the AlternC Development Team.
6  http://alternc.org/
7  ----------------------------------------------------------------------
8  Based on:
9  Valentin Lacambre's web hosting softwares: http://altern.org/
10  ----------------------------------------------------------------------
11  LICENSE
12
13  This program is free software; you can redistribute it and/or
14  modify it under the terms of the GNU General Public License (GPL)
15  as published by the Free Software Foundation; either version 2
16  of the License, or (at your option) any later version.
17
18  This program is distributed in the hope that it will be useful,
19  but WITHOUT ANY WARRANTY; without even the implied warranty of
20  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21  GNU General Public License for more details.
22
23  To read the license please visit http://www.gnu.org/copyleft/gpl.html
24  ----------------------------------------------------------------------
25  Original Author of file: Benjamin Sonntag - 2003-01-19
26  Purpose of file: Create a mailman mailing-list
27  ----------------------------------------------------------------------
28 */
29 /* setgid() */
30 #include <sys/types.h>
31 #include <unistd.h>
32 #include <stdlib.h>
33 /* printf() perror() */
34 #include <stdio.h>
35
36
37 #define M_PATH "/var/lib/mailman/bin/newlist"
38
39 int main(int argc,char *argv[]) {
40
41   if (argc!=4) {
42     printf("Utilisation : create.mailman <list> <admin> <password>\n\n");
43     exit(-1);
44   }
45  
46   setgid(getegid());
47
48   // WARNING : LIST ZONE //
49   execl(M_PATH, M_PATH, "-q", argv[1],argv[2],argv[3], NULL);
50  
51   perror("exec failed");
52
53   return 0;
54 }
Note: See TracBrowser for help on using the browser.