[ 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:
|
|