Skip to Content.
Sympa Menu

en - Re: [sympa-users] Include2 delays when changing data sources setup

Subject: The mailing list for listmasters using Sympa

List archive

Chronological Thread  
  • From: Olivier Salaun - CRU <address@concealed>
  • To: John Dalbec <address@concealed>
  • Cc: address@concealed
  • Subject: Re: [sympa-users] Include2 delays when changing data sources setup
  • Date: Thu, 25 Sep 2003 09:43:26 +0200

John Dalbec wrote:

I converted several lists to include2 mode today. Most of them worked fine, but the task_manager kept creating tasks for one of the lists and never executing them. The only difference I can see is that the list name contains a '+' character. Is that the problem?

The listname regular expression has been duplicated in the task_manager and it does not accept '+' characters.
I'v fixed this, moving all regexp in tools.pl. A patch is attached to this message ; it was generated against a 4.0.a6, hope it will fit your 3.3.4.

I'm running Sympa 3.4.4.1 now. I've thought about installing 3.4.4.3 but there doesn't seem to be an RPM for it yet.

The RPM exists. You just haven't updated the link from the main page on www.sympa.org.

We've updated the link on the sympa.org.

Thanks.

--
Olivier Salaun
Comite Reseau des Universites

Index: src/Commands.pm
===================================================================
RCS file: /home/sympa/cvsroot/sympa/src/Commands.pm,v
retrieving revision 1.86
diff -c -r1.86 Commands.pm
*** src/Commands.pm 18 Sep 2003 14:12:39 -0000 1.86
--- src/Commands.pm 25 Sep 2003 07:18:18 -0000
***************
*** 71,80 ****
my $time_command;
my $msg_file;

- ## Caution : if this regexp changes (more/less parenthesis), then regexp
using it should
- ## also be changed
- my $email_regexp = '([\w\-\_\.\/\+\=]+|\".*\")\@[\w\-]+(\.[\w\-]+)+';
-
## Parse the command and call the adequate subroutine with
## the arguments to the command.
sub parse {
--- 71,76 ----
***************
*** 953,959 ****

do_log('debug', 'Commands::add(%s,%s)', $what,$sign_mod );

! $what =~ /^(\S+)\s+($email_regexp)(\s+(.+))?\s*$/;
my($which, $email, $comment) = ($1, $2, $6);
my $auth_method ;

--- 949,955 ----

do_log('debug', 'Commands::add(%s,%s)', $what,$sign_mod );

! $what =~ /^(\S+)\s+($tools::regexp{'email'})(\s+(.+))?\s*$/;
my($which, $email, $comment) = ($1, $2, $6);
my $auth_method ;

***************
*** 1375,1381 ****

do_log('debug', 'Commands::del(%s,%s)', $what,$sign_mod);

! $what =~ /^(\S+)\s+($email_regexp)\s*/;
my($which, $who) = ($1, $2);
my $auth_method;

--- 1371,1377 ----

do_log('debug', 'Commands::del(%s,%s)', $what,$sign_mod);

! $what =~ /^(\S+)\s+($tools::regexp{'email'})\s*/;
my($which, $who) = ($1, $2);
my $auth_method;

Index: src/tools.pl
===================================================================
RCS file: /home/sympa/cvsroot/sympa/src/tools.pl,v
retrieving revision 1.118
diff -c -r1.118 tools.pl
*** src/tools.pl 18 Sep 2003 13:36:53 -0000 1.118
--- src/tools.pl 25 Sep 2003 07:18:18 -0000
***************
*** 29,40 ****
--- 29,52 ----
use Log;
use Time::Local;
use File::Find;
+ use Digest::MD5;

## RCS identification.
#my $id = '@(#)$Id: tools.pl,v 1.118 2003/09/18 13:36:53 salaun Exp $';

## global var to store a CipherSaber object
my $cipher;
+
+ ## Regexps for list params
+ %regexp = ('email' => '([\w\-\_\.\/\+\=\']+|\".*\")\@[\w\-]+(\.[\w\-]+)+',
+ 'host' => '[\w\.\-]+',
+ 'multiple_host_with_port' =>
'[\w\.\-]+(:\d+)?(,[\w\.\-]+(:\d+)?)*',
+ 'listname' => '[a-z0-9][a-z0-9\-\.\+_]*',
+ 'sql_query' => '(SELECT|select).*',
+ 'scenario' => '[\w,\.\-]+',
+ 'task' => '\w+'
+ );
+

my %openssl_errors = (1 => 'an error occurred parsing the command options',
2 => 'one of the input files could not be read',
Index: src/List.pm
===================================================================
RCS file: /home/sympa/cvsroot/sympa/src/List.pm,v
retrieving revision 1.393
diff -c -r1.393 List.pm
*** src/List.pm 19 Sep 2003 06:15:17 -0000 1.393
--- src/List.pm 25 Sep 2003 07:18:18 -0000
***************
*** 217,232 ****
}
);

- ## Regexps for list params
- my %regexp = ('email' =>
'([\w\-\_\.\/\+\=\']+|\".*\")\@[\w\-]+(\.[\w\-]+)+',
- 'host' => '[\w\.\-]+',
- 'multiple_host_with_port' =>
'[\w\.\-]+(:\d+)?(,[\w\.\-]+(:\d+)?)*',
- 'listname' => '[a-z0-9][a-z0-9\-\._]+',
- 'sql_query' => '(SELECT|select).*',
- 'scenario' => '[\w,\.\-]+',
- 'task' => '\w+'
- );
-
## List parameters defaults
my %default = ('occurrence' => '0-1',
'length' => 25
--- 217,222 ----
***************
*** 401,407 ****
'title_id' => 14,
'order' => 2
},
! 'email' => {'format' =>
$regexp{'email'},
'occurrence' => '1',
'title_id' => 15,
'order' => 1
--- 391,397 ----
'title_id' => 14,
'order' => 2
},
! 'email' => {'format' =>
$tools::regexp{'email'},
'occurrence' => '1',
'title_id' => 15,
'order' => 1
***************
*** 464,470 ****
'group' => 'sending'
},

! 'editor' => {'format' => {'email' => {'format' =>
$regexp{'email'},
'length' => 30,
'occurrence' => '1',
'title_id' => 27,
--- 454,460 ----
'group' => 'sending'
},

! 'editor' => {'format' => {'email' => {'format' =>
$tools::regexp{'email'},
'length' => 30,
'occurrence' => '1',
'title_id' => 27,
***************
*** 503,509 ****
'title_id' => 32,
'obsolete' => 1
},
! 'host' => {'format' => $regexp{'host'},
'length' => 20,
'title_id' => 33,
'group' => 'description'
--- 493,499 ----
'title_id' => 32,
'obsolete' => 1
},
! 'host' => {'format' => $tools::regexp{'host'},
'length' => 20,
'title_id' => 33,
'group' => 'description'
***************
*** 538,544 ****
},


! 'include_ldap_query' => {'format' => {'host' => {'format' =>
$regexp{'multiple_host_with_port'},
'occurrence' =>
'1',
'title_id' => 36,
'order' => 2
--- 528,534 ----
},


! 'include_ldap_query' => {'format' => {'host' => {'format' =>
$tools::regexp{'multiple_host_with_port'},
'occurrence' =>
'1',
'title_id' => 36,
'order' => 2
***************
*** 601,607 ****
'title_id' => 35,
'group' => 'data_source'
},
! 'include_ldap_2level_query' => {'format' => {'host' => {'format'
=> $regexp{'multiple_host_with_port'},
'occurrence' =>
'1',
'title_id' =>
136,
'order' => 1
--- 591,597 ----
'title_id' => 35,
'group' => 'data_source'
},
! 'include_ldap_2level_query' => {'format' => {'host' => {'format'
=> $tools::regexp{'multiple_host_with_port'},
'occurrence' =>
'1',
'title_id' =>
136,
'order' => 1
***************
*** 708,719 ****
'title_id' => 135,
'group' => 'data_source'
},
! 'include_list' => {'format' => $regexp{'listname'},
'occurrence' => '0-n',
'title_id' => 44,
'group' => 'data_source'
},
! 'include_remote_sympa_list' => {'format' => {'host' => {'format'
=> $regexp{'host'},
'occurrence' =>
'1',
'title_id' => 136,
'order' => 1
--- 698,709 ----
'title_id' => 135,
'group' => 'data_source'
},
! 'include_list' => {'format' => $tools::regexp{'listname'},
'occurrence' => '0-n',
'title_id' => 44,
'group' => 'data_source'
},
! 'include_remote_sympa_list' => {'format' => {'host' => {'format'
=> $tools::regexp{'host'},
'occurrence' =>
'1',
'title_id' => 136,
'order' => 1
***************
*** 752,758 ****
'title_id' =>
46,
'order' => 1
},
! 'host' => {'format' =>
$regexp{'host'},
'occurrence' =>
'1',
'title_id' => 47,
'order' => 2
--- 742,748 ----
'title_id' =>
46,
'order' => 1
},
! 'host' => {'format' =>
$tools::regexp{'host'},
'occurrence' =>
'1',
'title_id' => 47,
'order' => 2
***************
*** 779,785 ****
'title_id' =>
50,
'order' => 7
},
! 'sql_query' => {'format' =>
$regexp{'sql_query'},
'length' =>
50,
'occurrence'
=> '1',
'title_id'
=> 51,
--- 769,775 ----
'title_id' =>
50,
'order' => 7
},
! 'sql_query' => {'format' =>
$tools::regexp{'sql_query'},
'length' =>
50,
'occurrence'
=> '1',
'title_id'
=> 51,
***************
*** 820,826 ****
'title_id' => 56,
'group' => 'sending'
},
! 'owner' => {'format' => {'email' => {'format' => $regexp{'email'},
'length' =>30,
'occurrence' => '1',
'title_id' => 58,
--- 810,816 ----
'title_id' => 56,
'group' => 'sending'
},
! 'owner' => {'format' => {'email' => {'format' =>
$tools::regexp{'email'},
'length' =>30,
'occurrence' => '1',
'title_id' => 58,
***************
*** 882,888 ****
'occurrence' =>
'1',
'order' => 1
},
! 'other_email' => {'format' =>
$regexp{'email'},
'title_id'
=> 92,
'order' => 2
},
--- 872,878 ----
'occurrence' =>
'1',
'order' => 1
},
! 'other_email' => {'format' =>
$tools::regexp{'email'},
'title_id'
=> 92,
'order' => 2
},
***************
*** 984,990 ****
'title_id' => 79,
'order' => 2
},
! 'email' => {'format' =>
$regexp{'email'},
'length' => 30,
'occurrence' => '1',
'title_id' => 80,
--- 974,980 ----
'title_id' => 79,
'order' => 2
},
! 'email' => {'format' =>
$tools::regexp{'email'},
'length' => 30,
'occurrence' => '1',
'title_id' => 80,
***************
*** 1178,1184 ****
}

## Only process the list if the name is valid.
! unless ($name and ($name =~ /^[a-z0-9][a-z0-9\-\+\._]*$/io) ) {
&do_log('err', 'Incorrect listname "%s"', $name);
return undef;
}
--- 1168,1174 ----
}

## Only process the list if the name is valid.
! unless ($name and ($name =~ /^$tools::regexp{'listname'}$/io) ) {
&do_log('err', 'Incorrect listname "%s"', $name);
return undef;
}
***************
*** 5075,5081 ****
next unless (-d $dir);

while (<$dir/$action.*>) {
! next unless (/$action\.($regexp{'scenario'})$/);
my $name = $1;

next if (defined $list_of_scenario{$name});
--- 5065,5071 ----
next unless (-d $dir);

while (<$dir/$action.*>) {
! next unless (/$action\.($tools::regexp{'scenario'})$/);
my $name = $1;

next if (defined $list_of_scenario{$name});
***************
*** 5433,5439 ****
next if /^\s*$/;
next if /^\s*\#/;

! unless (/^\s*($regexp{'email'})(\s*(\S.*))?\s*$/) {
&do_log('notice', 'Not an email address: %s', $_);
}

--- 5423,5429 ----
next if /^\s*$/;
next if /^\s*\#/;

! unless (/^\s*($tools::regexp{'email'})(\s*(\S.*))?\s*$/) {
&do_log('notice', 'Not an email address: %s', $_);
}

***************
*** 7112,7124 ****

## Scenario format
if ($::pinfo{$p}{'scenario'}) {
! $::pinfo{$p}{'format'} = $regexp{'scenario'};
$::pinfo{$p}{'default'} = 'default';
}

## Task format
if ($::pinfo{$p}{'task'}) {
! $::pinfo{$p}{'format'} = $regexp{'task'};
}

## Enumeration
--- 7102,7114 ----

## Scenario format
if ($::pinfo{$p}{'scenario'}) {
! $::pinfo{$p}{'format'} = $tools::regexp{'scenario'};
$::pinfo{$p}{'default'} = 'default';
}

## Task format
if ($::pinfo{$p}{'task'}) {
! $::pinfo{$p}{'format'} = $tools::regexp{'task'};
}

## Enumeration
***************
*** 7152,7164 ****

## Scenario format
if (ref($::pinfo{$p}{'format'}{$k}) &&
$::pinfo{$p}{'format'}{$k}{'scenario'}) {
! $::pinfo{$p}{'format'}{$k}{'format'} = $regexp{'scenario'};
$::pinfo{$p}{'format'}{$k}{'default'} = 'default' unless (($p
eq 'web_archive') && ($k eq 'access'));
}

## Task format
if (ref($::pinfo{$p}{'format'}{$k}) &&
$::pinfo{$p}{'format'}{$k}{'task'}) {
! $::pinfo{$p}{'format'}{$k}{'format'} = $regexp{'task'};
}

## Enumeration
--- 7142,7154 ----

## Scenario format
if (ref($::pinfo{$p}{'format'}{$k}) &&
$::pinfo{$p}{'format'}{$k}{'scenario'}) {
! $::pinfo{$p}{'format'}{$k}{'format'} =
$tools::regexp{'scenario'};
$::pinfo{$p}{'format'}{$k}{'default'} = 'default' unless (($p
eq 'web_archive') && ($k eq 'access'));
}

## Task format
if (ref($::pinfo{$p}{'format'}{$k}) &&
$::pinfo{$p}{'format'}{$k}{'task'}) {
! $::pinfo{$p}{'format'}{$k}{'format'} = $tools::regexp{'task'};
}

## Enumeration
Index: src/task_manager.pl
===================================================================
RCS file: /home/sympa/cvsroot/sympa/src/task_manager.pl,v
retrieving revision 1.50
diff -c -r1.50 task_manager.pl
*** src/task_manager.pl 12 Aug 2003 10:34:33 -0000 1.50
--- src/task_manager.pl 25 Sep 2003 07:18:18 -0000
***************
*** 68,83 ****
my $wwsconf = {};
my $adrlist = {};

- # some regexp that all modules should use and share
- my %regexp = ('email' => '(\S+|\".*\")(@\S+)',
- 'host' => '[\w\.\-]+',
- 'listname' => '[a-z0-9][a-z0-9\-\._]+',
- 'sql_query' => 'SELECT.*',
- 'scenario' => '[\w,\.\-]+',
- 'task' => '\w+'
- );
-
-
# Load WWSympa configuration
unless ($wwsconf = &wwslib::load_config($wwsympa_conf)) {
&fatal_err('error : unable to load config file');
--- 68,73 ----
***************
*** 733,743 ****
# building of %context
my %context; # datas necessary to command processing
$context{'task_file'} = $task_file; # long task file name
! $task_file =~ /\/($regexp{'listname'})$/i;
$context{'task_name'} = $1; # task file name
$context{'task_name'} =~ /^(\d+)\..+/;
$context{'execution_date'} = $1; # task execution date
! $context{'task_name'} =~ /^\w+\.\w*\.\w+\.($regexp{'listname'})$/;
$context{'object_name'} = $1; # object of the task
$context{'line_number'} = $lnb;

--- 723,733 ----
# building of %context
my %context; # datas necessary to command processing
$context{'task_file'} = $task_file; # long task file name
! $task_file =~ /\/($tools::regexp{'listname'})$/i;
$context{'task_name'} = $1; # task file name
$context{'task_name'} =~ /^(\d+)\..+/;
$context{'execution_date'} = $1; # task execution date
! $context{'task_name'} =~
/^\w+\.\w*\.\w+\.($tools::regexp{'listname'})$/;
$context{'object_name'} = $1; # object of the task
$context{'line_number'} = $lnb;

***************
*** 1664,1670 ****
sub match_task {
my $filename = shift;

! if ($filename =~
/^(\d+)\.(\w*)\.(\w+)\.($regexp{'listname'}|_global)$/) {
my $task = {'date' => $1,
'label' => $2,
'model' => $3,
--- 1654,1660 ----
sub match_task {
my $filename = shift;

! if ($filename =~
/^(\d+)\.(\w*)\.(\w+)\.($tools::regexp{'listname'}|_global)$/) {
my $task = {'date' => $1,
'label' => $2,
'model' => $3,



Archive powered by MHonArc 2.6.19+.

Top of Page