|
Revision 1594, 0.6 kB
(checked in by benjamin, 3 years ago)
|
replacing c setuid scripts by perl-setuid one
|
- Property svn:executable set to
*
|
| Line | |
|---|
| 1 |
|
|---|
| 2 |
|
|---|
| 3 |
use strict; |
|---|
| 4 |
|
|---|
| 5 |
my ($listname,$email) = @ARGV; |
|---|
| 6 |
|
|---|
| 7 |
my $M_PATH = "/usr/lib/mailman/bin/remove_members"; |
|---|
| 8 |
|
|---|
| 9 |
if (!$listname || !$email) { |
|---|
| 10 |
print "Usage: mailman.unsub <listname> <email>\n"; |
|---|
| 11 |
exit(1); |
|---|
| 12 |
} |
|---|
| 13 |
|
|---|
| 14 |
$ENV{PATH} = ""; |
|---|
| 15 |
delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV'}; |
|---|
| 16 |
|
|---|
| 17 |
$< = $>; |
|---|
| 18 |
$( = $); |
|---|
| 19 |
|
|---|
| 20 |
if (!($listname =~ /^([a-z0-9]+)$/)) { |
|---|
| 21 |
die "List name is incorrect."; |
|---|
| 22 |
} |
|---|
| 23 |
$listname=$1; |
|---|
| 24 |
|
|---|
| 25 |
if (!($email =~ /^([a-z0-9_\+\.-]+\@[a-z0-9\.-]+)$/)) { |
|---|
| 26 |
die "Email is incorrect."; |
|---|
| 27 |
} |
|---|
| 28 |
$email=$1; |
|---|
| 29 |
|
|---|
| 30 |
exec($M_PATH." -N -n '".quotemeta($listname)."' '".quotemeta($email)."'"); |
|---|
| 31 |
|
|---|
| 32 |
|
|---|
| 33 |
0; |
|---|