blob: 23124252faf160666d6b91a21fe3502b47c50963 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
$NetBSD: patch-ab,v 1.3 2011/01/29 19:39:14 spz Exp $
avoid the wrapper + -C trap
--- archive2.pl.orig 2000-01-07 11:00:49.000000000 +0000
+++ archive2.pl
@@ -47,19 +47,23 @@
# Change directory to our home
chdir($ENV{'HOME'}) if $ENV{'HOME'};
-# Read and execute the .cf file
-$cf = $ENV{"MAJORDOMO_CF"} || "/etc/majordomo.cf";
+# Read and execute the .cf file. For security reasons, let the environment win
+$cf = "/etc/majordomo.cf";
if ($ARGV[0] eq "-C") {
$cf = $ARGV[1];
shift(@ARGV);
shift(@ARGV);
}
+if ($ENV{"MAJORDOMO_CF"}) {
+ $cf = $ENV{"MAJORDOMO_CF"};
+}
if (! -r $cf) {
die("$cf not readable; stopped");
}
require "$cf";
# All these should be in the standard PERL library
+unshift(@INC, $bindir);
unshift(@INC, $homedir);
require "ctime.pl"; # To get MoY definitions for month abbrevs
require "majordomo_version.pl"; # What version of Majordomo is this?
|