Skip to Content.
Sympa Menu

en - RE: [sympa-users] Whitelist/Modlist for Sympa 6.2

Subject: The mailing list for listmasters using Sympa

List archive

Chronological Thread  
  • From: Steve Shipway <address@concealed>
  • To: John Levine <address@concealed>, "address@concealed" <address@concealed>
  • Subject: RE: [sympa-users] Whitelist/Modlist for Sympa 6.2
  • Date: Sun, 4 Oct 2015 23:28:50 +0000

> @data = split /\0/, $data;
> $action = $data[0];
> $data = $data[1];

So, basically, when a custom_action module is called, the parameters are
($listref, $arg0.'\0'.$arg1,@args) where @args are split by '/', which seems
horrible. I had thought the parameters were ($listref,@args) but apparently
not. What I'm not sure of is how it has worked on our system at all. This
seems to be a result of how I'm passing the args via POST data rather than
PATH_INFO, which I have to do because no other form fields are preserved by
the call.

The new 6.2 plugin architecture has some good things; for example, it now
allows you to pass parameters via POST or GET with names 'plugin.X.Y' to have
these included in the stash. Unfortunately, these are not passed on to the
*_plugin::process() function which makes them much less useful. This is why
my plugin passes the parameters as name 'cap' in order to overwrite the
PATH_INFO params and have them passed to the process() function;
unfortunately, it seems Sympa does not expect a list-context response from
CGI->param('cap') and so the multiple cap parameters are concatenated with a
null separator. A later split() call breaks the result by '/' and so you get
the weird behaviour.

There are therefore also some other cases to handle for if the text actually
contains a / anywhere in it. So, what I ended up with is to just add a '/'
to
the end of the 'save/' parameter in the whitelist.tt2; then, I can simply
strip all nulls from the returned data --

$action = shift; // take off the first
$data = join '/',@_;
$data =~ s/\x00//g;

.. which ends up with $action holding the secondary command and $data holding
the new file content, if any.

I'll make some changes to the script and post a v1.1

As far as the other report of the whitelist.txt not being created goes, my
only guess is filesystem permissions, as that part (at least) works on our
system.

TL;DR - I'm doing nonstandard things with the cap parameter, which breaks it
like this. I wish there were another way to pass parameters to the process()
function.

Steve

Steve Shipway
T: +64 9 3737 599 ext 86487
E: address@concealed

Attachment: smime.p7s
Description: S/MIME cryptographic signature




Archive powered by MHonArc 2.6.19+.

Top of Page