52 lines
2.4 KiB
Plaintext
52 lines
2.4 KiB
Plaintext
$OpenBSD: patch-cgi-bin_openwebmail_openwebmail_pl,v 1.8 2004/07/21 00:26:11 kevlo Exp $
|
|
--- cgi-bin/openwebmail/openwebmail.pl.orig Tue Jul 20 18:24:51 2004
|
|
+++ cgi-bin/openwebmail/openwebmail.pl Wed Jul 21 08:14:47 2004
|
|
@@ -1,4 +1,4 @@
|
|
-#!/usr/bin/suidperl -T
|
|
+#!/usr/bin/perl
|
|
#################################################################
|
|
# #
|
|
# Open WebMail - Provides a web interface to user mailboxes #
|
|
@@ -18,10 +18,10 @@
|
|
#
|
|
use vars qw($SCRIPT_DIR);
|
|
if ( $0 =~ m!^(\S*)/[\w\d\-\.]+\.pl! ) { $SCRIPT_DIR=$1 }
|
|
-if ($SCRIPT_DIR eq '' && open(F, '/etc/openwebmail_path.conf')) {
|
|
+if ($SCRIPT_DIR eq '' && open(F, '%%SYSCONFDIR%%/openwebmail/openwebmail_path.conf')) {
|
|
$_=<F>; close(F); if ( $_=~/^(\S*)/) { $SCRIPT_DIR=$1 }
|
|
}
|
|
-if ($SCRIPT_DIR eq '') { print "Content-type: text/html\n\nSCRIPT_DIR not set in /etc/openwebmail_path.conf !\n"; exit 0; }
|
|
+if ($SCRIPT_DIR eq '') { print "Content-type: text/html\n\nSCRIPT_DIR not set in %%SYSCONFDIR%%/openwebmail/openwebmail_path.conf !\n"; exit 0; }
|
|
push (@INC, $SCRIPT_DIR);
|
|
|
|
foreach (qw(PATH ENV BASH_ENV CDPATH IFS TERM)) { $ENV{$_}='' } # secure ENV
|
|
@@ -63,8 +63,8 @@
|
|
$SIG{PIPE}=\&openwebmail_exit; # for user stop
|
|
$SIG{TERM}=\&openwebmail_exit; # for user stop
|
|
|
|
-load_owconf(\%config_raw, "$SCRIPT_DIR/etc/openwebmail.conf.default");
|
|
-read_owconf(\%config, \%config_raw, "$SCRIPT_DIR/etc/openwebmail.conf") if (-f "$SCRIPT_DIR/etc/openwebmail.conf");
|
|
+load_owconf(\%config_raw, "%%SYSCONFDIR%%/openwebmail/openwebmail.conf.default");
|
|
+read_owconf(\%config, \%config_raw, "%%SYSCONFDIR%%/openwebmail/openwebmail.conf") if (-f "%%SYSCONFDIR%%/openwebmail/openwebmail.conf");
|
|
loadlang($config{'default_language'}); # so %lang... can be used in error msg
|
|
|
|
# check & create mapping table for solar/lunar, b2g, g2b convertion
|
|
@@ -77,7 +77,7 @@
|
|
}
|
|
|
|
if ($config{'logfile'}) {
|
|
- my $mailgid=getgrnam('mail');
|
|
+ my $mailgid=getgrnam('_mail');
|
|
my ($fmode, $fuid, $fgid) = (stat($config{'logfile'}))[2,4,5];
|
|
if ( !($fmode & 0100000) ) {
|
|
open (LOGFILE,">>$config{'logfile'}") or
|
|
@@ -230,7 +230,7 @@
|
|
|
|
# create domain logfile
|
|
if ($config{'logfile'}) {
|
|
- my $mailgid=getgrnam('mail');
|
|
+ my $mailgid=getgrnam('_mail');
|
|
my ($fmode, $fuid, $fgid) = (stat($config{'logfile'}))[2,4,5];
|
|
if ( !($fmode & 0100000) ) {
|
|
open (LOGFILE,">>$config{'logfile'}") or
|