diff -ruN 1.8x/cgi-bin/openwebmail/openwebmail-abook.pl fix/cgi-bin/openwebmail/openwebmail-abook.pl --- 1.8x/cgi-bin/openwebmail/openwebmail-abook.pl Fri Nov 22 01:40:04 2002 +++ fix/cgi-bin/openwebmail/openwebmail-abook.pl Thu Feb 20 13:37:33 2003 @@ -4,9 +4,12 @@ # use vars qw($SCRIPT_DIR); -if ( $ENV{'SCRIPT_FILENAME'} =~ m!^(.*?)/[\w\d\-\.]+\.pl! || $0 =~ m!^(.*?)/[\w\d\-\.]+\.pl! ) { $SCRIPT_DIR=$1; } -if (!$SCRIPT_DIR) { print "Content-type: text/html\n\n\$SCRIPT_DIR not set in CGI script!\n"; exit 0; } -push (@INC, $SCRIPT_DIR, "."); +if ( $0 =~ m!^(.*?)/[\w\d\-\.]+\.pl! ) { $SCRIPT_DIR=$1; } +if (!$SCRIPT_DIR && open(F, '/etc/openwebmail_path.conf')) { + $_=; close(F); if ( $_=~/^([^\s]*)/) { $SCRIPT_DIR=$1; } +} +if (!$SCRIPT_DIR) { print "Content-type: text/html\n\n\SCRIPT_DIR not set in /etc/openwebmail_path.conf !\n"; exit 0; } +push (@INC, $SCRIPT_DIR); $ENV{PATH} = ""; # no PATH should be needed $ENV{ENV} = ""; # no startup script for sh diff -ruN 1.8x/cgi-bin/openwebmail/openwebmail-advsearch.pl fix/cgi-bin/openwebmail/openwebmail-advsearch.pl --- 1.8x/cgi-bin/openwebmail/openwebmail-advsearch.pl Sat Nov 16 13:16:39 2002 +++ fix/cgi-bin/openwebmail/openwebmail-advsearch.pl Thu Feb 20 13:38:56 2003 @@ -6,9 +6,12 @@ # use vars qw($SCRIPT_DIR); -if ( $ENV{'SCRIPT_FILENAME'} =~ m!^(.*?)/[\w\d\-\.]+\.pl! || $0 =~ m!^(.*?)/[\w\d\-\.]+\.pl! ) { $SCRIPT_DIR=$1; } -if (!$SCRIPT_DIR) { print "Content-type: text/html\n\n\$SCRIPT_DIR not set in CGI script!\n"; exit 0; } -push (@INC, $SCRIPT_DIR, "."); +if ( $0 =~ m!^(.*?)/[\w\d\-\.]+\.pl! ) { $SCRIPT_DIR=$1; } +if (!$SCRIPT_DIR && open(F, '/etc/openwebmail_path.conf')) { + $_=; close(F); if ( $_=~/^([^\s]*)/) { $SCRIPT_DIR=$1; } +} +if (!$SCRIPT_DIR) { print "Content-type: text/html\n\n\SCRIPT_DIR not set in /etc/openwebmail_path.conf !\n"; exit 0; } +push (@INC, $SCRIPT_DIR); $ENV{PATH} = ""; # no PATH should be needed $ENV{ENV} = ""; # no startup script for sh diff -ruN 1.8x/cgi-bin/openwebmail/openwebmail-cal.pl fix/cgi-bin/openwebmail/openwebmail-cal.pl --- 1.8x/cgi-bin/openwebmail/openwebmail-cal.pl Mon Nov 18 20:28:23 2002 +++ fix/cgi-bin/openwebmail/openwebmail-cal.pl Thu Feb 20 13:36:36 2003 @@ -10,9 +10,12 @@ # use vars qw($SCRIPT_DIR); -if ( $ENV{'SCRIPT_FILENAME'} =~ m!^(.*?)/[\w\d\-\.]+\.pl! || $0 =~ m!^(.*?)/[\w\d\-\.]+\.pl! ) { $SCRIPT_DIR=$1; } -if (!$SCRIPT_DIR) { print "Content-type: text/html\n\n\$SCRIPT_DIR not set in CGI script!\n"; exit 0; } -push (@INC, $SCRIPT_DIR, "."); +if ( $0 =~ m!^(.*?)/[\w\d\-\.]+\.pl! ) { $SCRIPT_DIR=$1; } +if (!$SCRIPT_DIR && open(F, '/etc/openwebmail_path.conf')) { + $_=; close(F); if ( $_=~/^([^\s]*)/) { $SCRIPT_DIR=$1; } +} +if (!$SCRIPT_DIR) { print "Content-type: text/html\n\n\SCRIPT_DIR not set in /etc/openwebmail_path.conf !\n"; exit 0; } +push (@INC, $SCRIPT_DIR); $ENV{PATH} = ""; # no PATH should be needed $ENV{ENV} = ""; # no startup script for sh diff -ruN 1.8x/cgi-bin/openwebmail/openwebmail-folder.pl fix/cgi-bin/openwebmail/openwebmail-folder.pl --- 1.8x/cgi-bin/openwebmail/openwebmail-folder.pl Thu Nov 21 16:46:42 2002 +++ fix/cgi-bin/openwebmail/openwebmail-folder.pl Thu Feb 20 13:38:50 2003 @@ -4,9 +4,12 @@ # use vars qw($SCRIPT_DIR); -if ( $ENV{'SCRIPT_FILENAME'} =~ m!^(.*?)/[\w\d\-\.]+\.pl! || $0 =~ m!^(.*?)/[\w\d\-\.]+\.pl! ) { $SCRIPT_DIR=$1; } -if (!$SCRIPT_DIR) { print "Content-type: text/html\n\n\$SCRIPT_DIR not set in CGI script!\n"; exit 0; } -push (@INC, $SCRIPT_DIR, "."); +if ( $0 =~ m!^(.*?)/[\w\d\-\.]+\.pl! ) { $SCRIPT_DIR=$1; } +if (!$SCRIPT_DIR && open(F, '/etc/openwebmail_path.conf')) { + $_=; close(F); if ( $_=~/^([^\s]*)/) { $SCRIPT_DIR=$1; } +} +if (!$SCRIPT_DIR) { print "Content-type: text/html\n\n\SCRIPT_DIR not set in /etc/openwebmail_path.conf !\n"; exit 0; } +push (@INC, $SCRIPT_DIR); $ENV{PATH} = ""; # no PATH should be needed $ENV{ENV} = ""; # no startup script for sh diff -ruN 1.8x/cgi-bin/openwebmail/openwebmail-main.pl fix/cgi-bin/openwebmail/openwebmail-main.pl --- 1.8x/cgi-bin/openwebmail/openwebmail-main.pl Tue Nov 26 19:05:44 2002 +++ fix/cgi-bin/openwebmail/openwebmail-main.pl Thu Feb 20 13:36:30 2003 @@ -4,9 +4,12 @@ # use vars qw($SCRIPT_DIR); -if ( $ENV{'SCRIPT_FILENAME'} =~ m!^(.*?)/[\w\d\-\.]+\.pl! || $0 =~ m!^(.*?)/[\w\d\-\.]+\.pl! ) { $SCRIPT_DIR=$1; } -if (!$SCRIPT_DIR) { print "Content-type: text/html\n\n\$SCRIPT_DIR not set in CGI script!\n"; exit 0; } -push (@INC, $SCRIPT_DIR, "."); +if ( $0 =~ m!^(.*?)/[\w\d\-\.]+\.pl! ) { $SCRIPT_DIR=$1; } +if (!$SCRIPT_DIR && open(F, '/etc/openwebmail_path.conf')) { + $_=; close(F); if ( $_=~/^([^\s]*)/) { $SCRIPT_DIR=$1; } +} +if (!$SCRIPT_DIR) { print "Content-type: text/html\n\n\SCRIPT_DIR not set in /etc/openwebmail_path.conf !\n"; exit 0; } +push (@INC, $SCRIPT_DIR); $ENV{PATH} = ""; # no PATH should be needed $ENV{ENV} = ""; # no startup script for sh diff -ruN 1.8x/cgi-bin/openwebmail/openwebmail-prefs.pl fix/cgi-bin/openwebmail/openwebmail-prefs.pl --- 1.8x/cgi-bin/openwebmail/openwebmail-prefs.pl Tue Nov 26 19:34:38 2002 +++ fix/cgi-bin/openwebmail/openwebmail-prefs.pl Thu Feb 20 13:38:45 2003 @@ -4,9 +4,12 @@ # use vars qw($SCRIPT_DIR); -if ( $ENV{'SCRIPT_FILENAME'} =~ m!^(.*?)/[\w\d\-\.]+\.pl! || $0 =~ m!^(.*?)/[\w\d\-\.]+\.pl! ) { $SCRIPT_DIR=$1; } -if (!$SCRIPT_DIR) { print "Content-type: text/html\n\n\$SCRIPT_DIR not set in CGI script!\n"; exit 0; } -push (@INC, $SCRIPT_DIR, "."); +if ( $0 =~ m!^(.*?)/[\w\d\-\.]+\.pl! ) { $SCRIPT_DIR=$1; } +if (!$SCRIPT_DIR && open(F, '/etc/openwebmail_path.conf')) { + $_=; close(F); if ( $_=~/^([^\s]*)/) { $SCRIPT_DIR=$1; } +} +if (!$SCRIPT_DIR) { print "Content-type: text/html\n\n\SCRIPT_DIR not set in /etc/openwebmail_path.conf !\n"; exit 0; } +push (@INC, $SCRIPT_DIR); $ENV{PATH} = ""; # no PATH should be needed $ENV{ENV} = ""; # no startup script for sh diff -ruN 1.8x/cgi-bin/openwebmail/openwebmail-read.pl fix/cgi-bin/openwebmail/openwebmail-read.pl --- 1.8x/cgi-bin/openwebmail/openwebmail-read.pl Tue Nov 26 19:34:13 2002 +++ fix/cgi-bin/openwebmail/openwebmail-read.pl Thu Feb 20 13:36:24 2003 @@ -4,9 +4,12 @@ # use vars qw($SCRIPT_DIR); -if ( $ENV{'SCRIPT_FILENAME'} =~ m!^(.*?)/[\w\d\-\.]+\.pl! || $0 =~ m!^(.*?)/[\w\d\-\.]+\.pl! ) { $SCRIPT_DIR=$1; } -if (!$SCRIPT_DIR) { print "Content-type: text/html\n\n\$SCRIPT_DIR not set in CGI script!\n"; exit 0; } -push (@INC, $SCRIPT_DIR, "."); +if ( $0 =~ m!^(.*?)/[\w\d\-\.]+\.pl! ) { $SCRIPT_DIR=$1; } +if (!$SCRIPT_DIR && open(F, '/etc/openwebmail_path.conf')) { + $_=; close(F); if ( $_=~/^([^\s]*)/) { $SCRIPT_DIR=$1; } +} +if (!$SCRIPT_DIR) { print "Content-type: text/html\n\n\SCRIPT_DIR not set in /etc/openwebmail_path.conf !\n"; exit 0; } +push (@INC, $SCRIPT_DIR); $ENV{PATH} = ""; # no PATH should be needed $ENV{ENV} = ""; # no startup script for sh diff -ruN 1.8x/cgi-bin/openwebmail/openwebmail-send.pl fix/cgi-bin/openwebmail/openwebmail-send.pl --- 1.8x/cgi-bin/openwebmail/openwebmail-send.pl Wed Nov 27 17:34:37 2002 +++ fix/cgi-bin/openwebmail/openwebmail-send.pl Thu Feb 20 13:38:40 2003 @@ -4,9 +4,12 @@ # use vars qw($SCRIPT_DIR); -if ( $ENV{'SCRIPT_FILENAME'} =~ m!^(.*?)/[\w\d\-\.]+\.pl! || $0 =~ m!^(.*?)/[\w\d\-\.]+\.pl! ) { $SCRIPT_DIR=$1; } -if (!$SCRIPT_DIR) { print "Content-type: text/html\n\n\$SCRIPT_DIR not set in CGI script!\n"; exit 0; } -push (@INC, $SCRIPT_DIR, "."); +if ( $0 =~ m!^(.*?)/[\w\d\-\.]+\.pl! ) { $SCRIPT_DIR=$1; } +if (!$SCRIPT_DIR && open(F, '/etc/openwebmail_path.conf')) { + $_=; close(F); if ( $_=~/^([^\s]*)/) { $SCRIPT_DIR=$1; } +} +if (!$SCRIPT_DIR) { print "Content-type: text/html\n\n\SCRIPT_DIR not set in /etc/openwebmail_path.conf !\n"; exit 0; } +push (@INC, $SCRIPT_DIR); $ENV{PATH} = ""; # no PATH should be needed $ENV{ENV} = ""; # no startup script for sh diff -ruN 1.8x/cgi-bin/openwebmail/openwebmail-spell.pl fix/cgi-bin/openwebmail/openwebmail-spell.pl --- 1.8x/cgi-bin/openwebmail/openwebmail-spell.pl Sat Nov 16 13:16:37 2002 +++ fix/cgi-bin/openwebmail/openwebmail-spell.pl Thu Feb 20 13:36:15 2003 @@ -27,9 +27,12 @@ use vars qw($SCRIPT_DIR); -if ( $ENV{'SCRIPT_FILENAME'} =~ m!^(.*?)/[\w\d\-\.]+\.pl! || $0 =~ m!^(.*?)/[\w\d\-\.]+\.pl! ) { $SCRIPT_DIR=$1; } -if (!$SCRIPT_DIR) { print "Content-type: text/html\n\n\$SCRIPT_DIR not set in CGI script!\n"; exit 0; } -push (@INC, $SCRIPT_DIR, "."); +if ( $0 =~ m!^(.*?)/[\w\d\-\.]+\.pl! ) { $SCRIPT_DIR=$1; } +if (!$SCRIPT_DIR && open(F, '/etc/openwebmail_path.conf')) { + $_=; close(F); if ( $_=~/^([^\s]*)/) { $SCRIPT_DIR=$1; } +} +if (!$SCRIPT_DIR) { print "Content-type: text/html\n\n\SCRIPT_DIR not set in /etc/openwebmail_path.conf !\n"; exit 0; } +push (@INC, $SCRIPT_DIR); $ENV{PATH} = ""; # no PATH should be needed $ENV{ENV} = ""; # no startup script for sh diff -ruN 1.8x/cgi-bin/openwebmail/openwebmail-tool.pl fix/cgi-bin/openwebmail/openwebmail-tool.pl --- 1.8x/cgi-bin/openwebmail/openwebmail-tool.pl Wed Nov 27 23:17:57 2002 +++ fix/cgi-bin/openwebmail/openwebmail-tool.pl Thu Feb 20 13:38:29 2003 @@ -7,18 +7,21 @@ # use vars qw($SCRIPT_DIR); -if ( $0 =~ m!^(.*?)/[\w\d\-\.]+\.pl! ) { - $SCRIPT_DIR=$1; -} elsif ( -f ($ENV{'openwebmail'}||$ENV{'PWD'})."/openwebmail-tool.pl" ) { - $SCRIPT_DIR=$ENV{'openwebmail'}||$ENV{'PWD'}; - ($SCRIPT_DIR =~ /^(.+)$/) && ($SCRIPT_DIR = $1); # untaint +if ( $0 =~ m!^(.*?)/[\w\d\-\.]+\.pl! ) { $SCRIPT_DIR=$1; } +if (!$SCRIPT_DIR && open(F, '/etc/openwebmail_path.conf')) { + $_=; close(F); if ( $_=~/^([^\s]*)/) { $SCRIPT_DIR=$1; } } if (!$SCRIPT_DIR) { - print "Please execute script openwebmail-tool.pl with full path\n". - " or 'cd your_openwebmail_cgi_dir; ./openwebmail-tool.pl'\n"; - exit 1; + print qq|\nOpen WebMail is unable to locate itself on this system,\n|. + qq|please put 'the path of openwebmail CGI directory' to\n|. + qq|the first line of file /etc/openwebmail_path.conf\n\n|. + qq|For example, if the script is\n\n|. + qq|/usr/local/www/cgi-bin/openwebmail/openwebmail-tool.pl,\n\n|. + qq|then the content of /etc/openwebmail_path.conf should be:\n\n|. + qq|/usr/local/www/cgi-bin/openwebmail/\n\n|; + exit 0; } -push (@INC, $SCRIPT_DIR, "."); +push (@INC, $SCRIPT_DIR); $ENV{PATH} = ""; # no PATH should be needed $ENV{ENV} = ""; # no startup script for sh diff -ruN 1.8x/cgi-bin/openwebmail/openwebmail-viewatt.pl fix/cgi-bin/openwebmail/openwebmail-viewatt.pl --- 1.8x/cgi-bin/openwebmail/openwebmail-viewatt.pl Tue Nov 26 19:14:48 2002 +++ fix/cgi-bin/openwebmail/openwebmail-viewatt.pl Thu Feb 20 13:39:01 2003 @@ -4,9 +4,12 @@ # use vars qw($SCRIPT_DIR); -if ( $ENV{'SCRIPT_FILENAME'} =~ m!^(.*?)/[\w\d\-\.]+\.pl! || $0 =~ m!^(.*?)/[\w\d\-\.]+\.pl! ) { $SCRIPT_DIR=$1; } -if (!$SCRIPT_DIR) { print "Content-type: text/html\n\n\$SCRIPT_DIR not set in CGI script!\n"; exit 0; } -push (@INC, $SCRIPT_DIR, "."); +if ( $0 =~ m!^(.*?)/[\w\d\-\.]+\.pl! ) { $SCRIPT_DIR=$1; } +if (!$SCRIPT_DIR && open(F, '/etc/openwebmail_path.conf')) { + $_=; close(F); if ( $_=~/^([^\s]*)/) { $SCRIPT_DIR=$1; } +} +if (!$SCRIPT_DIR) { print "Content-type: text/html\n\n\SCRIPT_DIR not set in /etc/openwebmail_path.conf !\n"; exit 0; } +push (@INC, $SCRIPT_DIR); $ENV{PATH} = ""; # no PATH should be needed $ENV{ENV} = ""; # no startup script for sh diff -ruN 1.8x/cgi-bin/openwebmail/openwebmail.pl fix/cgi-bin/openwebmail/openwebmail.pl --- 1.8x/cgi-bin/openwebmail/openwebmail.pl Tue Nov 26 19:33:50 2002 +++ fix/cgi-bin/openwebmail/openwebmail.pl Thu Feb 20 13:37:39 2003 @@ -18,9 +18,12 @@ # use vars qw($SCRIPT_DIR); -if ( $ENV{'SCRIPT_FILENAME'} =~ m!^(.*?)/[\w\d\-\.]+\.pl! || $0 =~ m!^(.*?)/[\w\d\-\.]+\.pl! ) { $SCRIPT_DIR=$1; } -if (!$SCRIPT_DIR) { print "Content-type: text/html\n\n\$SCRIPT_DIR not set in CGI script!\n"; exit 0; } -push (@INC, $SCRIPT_DIR, "."); +if ( $0 =~ m!^(.*?)/[\w\d\-\.]+\.pl! ) { $SCRIPT_DIR=$1; } +if (!$SCRIPT_DIR && open(F, '/etc/openwebmail_path.conf')) { + $_=; close(F); if ( $_=~/^([^\s]*)/) { $SCRIPT_DIR=$1; } +} +if (!$SCRIPT_DIR) { print "Content-type: text/html\n\n\SCRIPT_DIR not set in /etc/openwebmail_path.conf !\n"; exit 0; } +push (@INC, $SCRIPT_DIR); $ENV{PATH} = ""; # no PATH should be needed $ENV{ENV} = ""; # no startup script for sh