[Mailman-Developers] Share list passwords with a php script: a possible solution

OXullo Intersecans xullo at inetware.com
Thu May 22 10:20:28 EDT 2003


Greetings,
I'm here again to share my solution with the list

I solved my fuss with the following perl-suid script:


-------------- code snippet ---------------------
#!/usr/bin/perl

$ENV{PATH} = '';

if ($ARGV[0] =~ /(\w{1}\w*)/)
{
         $list = $1;
}
else
{
         nok();
}

if ($ARGV[1] =~ /(\w{1}[\w-.]*)\@([\w-.]+)/)
{
     $email = "$1\@$2";
}
else
{
         nok();
}

$pass = $ARGV[2];


$o = `/usr/local/mailman/bin/withlist -q -r getmemberpw $list $email`;
chomp($o);

if ($pass eq $o)
{
         print "OK\n";
}
else
{
         nok();
}

sub nok()
{
         print "NOK";
         exit();
}
--------------------------------------------------

Cleaning up the eventual taint on the arguments, I call this script with 
exec() function in PHP, getting the output as a return code.
The script is setuid to mailman.

Thanks for your attention


Marco Fagiolini




More information about the Mailman-Developers mailing list