Skip to Content.
Sympa Menu

devel - list naming bug

Subject: Developers of Sympa

List archive

Chronological Thread  
  • From: Sergiy Zhuk <address@concealed>
  • To: address@concealed
  • Cc: address@concealed
  • Subject: list naming bug
  • Date: Mon, 24 Jun 2002 17:43:19 -0700 (PDT)

hi

as we all know, sympa has several "service" suffixes like -request,
-unsubscribe etc.
So, these names should be reserved and no one should be able to create lists
with the above service suffixes.
Unfortunately, List.pm and wwsympa.fcgi didn't check service suffixes, so
you could still create lists like 'test-request', which won't work
afterwards.
sympa.pl parses the listname and treats any address ending with a
service suffix as a service alias, e.g. if you have list 'test-request',
messages will never go there, but instead sympa will try to forward them to
owners of the list 'test' even if list 'test' doesn't exist.
In any case this will be an incorrect behavior.
There's more than one way to fix it.
I think the simplest way is to check service aliases in List.pm and
wwsympa.fcgi, and this is what I did (see attached).
I'm using 'list_check_suffixes' to get the list of service aliases in use,
but you can change it to a hardcoded list or to some other variable if you
wish.
I did the same thing with 'list_check_suffixes' for sympa.pl once (check
the archives)

thanks

--
rgds,
serge
--- List.pm 2002/06/07 23:48:44 1.30
+++ List.pm 2002/06/25 00:23:15
@@ -1033,6 +1033,17 @@
## Lowercase the list name.
$name =~ tr/A-Z/a-z/;

+ my $regx = $Conf{'robots'}{$robot}{'list_check_suffixes'} ||
$Conf{'list_check_suffixes'};
+ if( defined ($regx) && $regx )
+ {
+ $regx =~ s/,/\|/g;
+ if ($name =~ /^(\S+)-(${regx})$/)
+ {
+ &do_log('info', 'Incorrect name: listname "%s" matches one of
service aliases', $name);
+ return undef;
+ }
+ }
+
if ($list_of_lists{$name}){
# use the current list in memory and update it
$liste=$list_of_lists{$name};
Index: wwsympa.fcgi
===================================================================
RCS file: /CVSROOT/yahoo/network/email/sympa/bin/wwsympa.fcgi,v
retrieving revision 1.25
diff -u -r1.25 wwsympa.fcgi
--- wwsympa.fcgi 2002/06/14 18:55:46 1.25
+++ wwsympa.fcgi 2002/06/25 00:24:58
@@ -1,7 +1,7 @@
#!/usr/bin/perl -U

# wwsympa.fcgi - This script provides the web interface to Sympa
-# RCS Identication ; $Revision: 1.25 $ ; $Date: 2002/06/14 18:55:46 $
+# RCS Identication ; $Revision: 1.24 $ ; $Date: 2002/06/05 05:01:05 $
#
# Sympa - SYsteme de Multi-Postage Automatique
# Copyright (c) 1997, 1998, 1999, 2000, 2001 Comite Reseau des Universites
@@ -4281,6 +4281,16 @@
return 'create_list_request';
}

+ my $regx = $Conf{'robots'}{$robot}{'list_check_suffixes'} ||
$Conf{'list_check_suffixes'};
+ if( defined ($regx) && $regx )
+ {
+ $regx =~ s/,/\|/g;
+ if ($in{'listname'} =~ /^(\S+)-(${regx})$/)
+ {
+ &error_message("Incorrect listname \"$in{'listname'}\"
matches one of service aliases",{'listname' => $in{'listname'}});
+ return 'create_list_request';
+ }
+ }
## 'other' topic means no topic
$in{'topics'} = undef if ($in{'topics'} eq 'other');




Archive powered by MHonArc 2.6.19+.

Top of Page