Great Circle Associates Majordomo-Users
(May 1995)
 

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

Subject: Re: [Q] Hiding lists......
From: dwolfe @ risc . sps . mot . com (Dave Wolfe)
Date: Wed, 3 May 1995 15:04:58 -0500 (CDT)
To: uunet!Stoner . COM!curnutt @ uunet . uu . net (Bryan Curnutt)
Cc: uunet!greatcircle . com!majordomo-users @ uunet . uu . net
In-reply-to: <199505031751.MAA10643@crusher.Stoner.COM> from "Bryan Curnutt" at May 3, 95 12:51:13 pm
Reply-to: David Wolfe <david_wolfe @ risc . sps . mot . com>

[ Bryan Curnutt writes: ]
> 
> Dave Wolfe wrote:
> > 
> > To ignore requests from outside the sps.mot.com domain, we use the
> > following in advertise:
> > 
> >     /^.*\.sps\.mot\.com$/i
> 
> Stock majordomo 1.93 will ignore that because of the "i" on the end [...]

Drat! Caught me editing the config files instead of sending them through
majordomo. :-( I'm not sure what the point is beyond ensuring that the
specified regexps are delimited by //, but allowing 'i*' on the end
is hardly adequate. At least go for '[ig]*'; other options could be
recognized but 'mosx' seem pretty pointless in that context.

The bigger problem is that this cursory check doesn't guarantee a valid
regexp and the results of the eval when it's used are ignored, leading
to more insidious silent failures. This seems more worthwhile to me.
(Warning: this has been only minimally tested; line numbers may differ
due to other changes.)

Index: config_parse.pl
===================================================================
RCS file: /cvs/tools/PD/majordomo/config_parse.pl,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 config_parse.pl
*** 1.1.1.1     1995/03/01 14:43:23
--- config_parse.pl     1995/05/03 20:00:09
***************
*** 963,978 ****
        local(@return_re, @re_errors, $re) = ();
   
        foreach $re (@re_array){
!             push(@re_errors,
!               "regular expression |$re| contains a ^A at line $.\n"), next
!                   if $re =~ /\001/;
! 
!                 push(@return_re, $re), next 
!                               if "$re" =~ /^\/[\@\!\w\.\|\\\?\<\>\$\*\^\+]+\/$
/;
!                 push(@return_re, $re), next if "$re" =~ /^$/;
! 
!             push(@re_errors,
!               "regexp |$re| does not match pattern at line $.\n");
        }
  
          if (@re_errors) {
--- 965,980 ----
        local(@return_re, @re_errors, $re) = ();
   
        foreach $re (@re_array){
!           if ($re =~ /\001/) {
!               push(@re_errors,
!                   "regular expression |$re| contains a ^A at line $.\n");
!           }
!           elsif (eval "'' =~ $re", $@) {
!               push(@re_errors, $@);
!           }
!           else {
!               push(@return_re, $re);
!           }
        }
  
          if (@re_errors) {

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


References:
Indexed By Date Previous: Re: Any Reasons for Not Using Reply-To ??
From: pjstevns@wice.xs4all.nl (Paul J. Stevens)
Next: Majordomo 1.93 and Perl 5.001e
From: will@kingcrab.nrl.navy.mil (Michael Will)
Indexed By Thread Previous: Re: [Q] Hiding lists......
From: Bryan Curnutt <curnutt@Stoner.COM>
Next: Re: [Q] Hiding lists......
From: dwolfe@risc.sps.mot.com (Dave Wolfe)

Google
 
Search Internet Search www.greatcircle.com