root/alternc-mailman/tags/1.4.10/src/mailman.unsub.c
| Revision 1248, 1.6 kB (checked in by anarcat, 3 years ago) | |
|---|---|
| |
| Line | |
|---|---|
| 1 | /* |
| 2 | $Id$ |
| 3 | ---------------------------------------------------------------------- |
| 4 | AlternC - Web Hosting System |
| 5 | Copyright (C) 2004 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: Subscribe a user to a mailing list |
| 27 | ---------------------------------------------------------------------- |
| 28 | */ |
| 29 | /* setgid() */ |
| 30 | #include <sys/types.h> |
| 31 | #include <unistd.h> |
| 32 | /* printf() perror() */ |
| 33 | #include <stdio.h> |
| 34 | |
| 35 | #define M_PATH "/usr/lib/mailman/bin/remove_members" |
| 36 | |
| 37 | int main(int argc,char *argv[]) { |
| 38 | if (argc!=3) { |
| 39 | printf("Utilisation : mailman.unsub <list> <email>\n\n"); |
| 40 | return -1; |
| 41 | } |
| 42 | |
| 43 | setgid(getegid()); |
| 44 | |
| 45 | // WARNING : LIST ZONE // |
| 46 | execl(M_PATH, M_PATH, "-n", "-N", argv[1], argv[2], (char*) NULL); |
| 47 | perror("exec failed"); |
| 48 | |
| 49 | return 0; |
| 50 | } |
Note: See TracBrowser for help on using the browser.
