Great Circle Associates Majordomo-Workers
(June 1996)
 

Indexed By Date: [Previous] [Next] Indexed By Thread: [Previous] [Next]

Subject: Re: Majordomo advertise/noadvertise bug?
From: Dave Wolfe <dwolfe @ risc . sps . mot . com>
Date: Tue, 11 Jun 1996 09:42:09 -0500 (CDT)
To: clolson @ me . umn . edu (Curtis L. Olson)
Cc: majordomo-workers @ greatcircle . com
In-reply-to: <199606072206.RAA01260@kenai.me.umn.edu> from "Curtis L. Olson" at Jun 7, 96 05:06:25 pm
Reply-to: Dave Wolfe <david_wolfe @ risc . sps . mot . com>

[ Curtis L. Olson writes: ]
> 
> (Is majordomo-workers@greatcircle.com a mailing list I need to be on
> in order to see replies?)

It usually helps to monitor a list for awhile before posting. And it's
just plain good netiquette.

> I was having problems getting the advertise/noadvertise features in
> the mailing list config file to work.  For instance, line 884 in sub
> do_lists() of the file "majordomo" reads:
> 
>     $command = "(qq~$reply_addr~ =~ $i)";
> 
> Although this doesn't seem to generate an execution error, it
> definitely doesn't work on our system -- no matches are ever
> reported.  From my knowledge of perl, this doesn't even seem to be
> syntactically correct.

You need to learn more about Perl. ;-)

> I modified this line (and made a similar modification to line 894) to
> read:
> 
>     $command = "(\$reply_addr =~ $i)";
> 
> This made much more sense to me and seemed to work just fine.

Really?? All you did was delay the interpolation of $reply_addr until
the eval in line 885 and remove the quoting from the substituted value
of $reply_addr. The bare-word value of $reply_addr probably defaulted to
a string (with no more interpolation done for the embedded '@', so that
may have made it work better), but that would be, uh..., "unpredictable"
if $reply_addr happened to match a reserved word or a subroutine name,
e.g. "Reply-To: <unlink listname.config>".

The qq~~ is legal, but $reply_addr should have the meta-characters
escaped before it's eval'ed to keep the '@' from being interpolated by
Perl 5. The cheap fix is to use non-interpolating inner quotes:

884    $command = "(q~$reply_addr~ =~ $i)";
894    $command = "(q~$reply_addr~ =~ $i)";
                    ^
Note 1 'q' instead of 2. This still counts on '~' not being in
$reply_addr (probably a safe bet), but really should escape all
non-alphanumeric characters in a copy of $reply_addr to be robust.

-- 
 Dave Wolfe    *Not a spokesman for Motorola*
 Motorola MMTG  6501 Wm. Cannon Dr. W. OE112  Austin  TX  78735-8598


References:
Indexed By Date Previous: mj's reaction to sendmail nslookup timeout
From: Lucas Parra <lucas@scr.siemens.com>
Next: [no subject]
From: (Sergio Tiezzi)
Indexed By Thread Previous: Majordomo advertise/noadvertise bug?
From: "Curtis L. Olson" <clolson@me.umn.edu>
Next: mj's reaction to sendmail nslookup timeout
From: Lucas Parra <lucas@scr.siemens.com>

Google
 
Search Internet Search www.greatcircle.com