summaryrefslogtreecommitdiff
path: root/mail/majordomo/patches/patch-ah
blob: 66d13029620f52dbccd7572b8ee7335f2da22267 (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
$NetBSD: patch-ah,v 1.2 2011/01/29 17:16:33 spz Exp $

--- request-answer.orig	2000-01-07 11:10:18.000000000 +0000
+++ request-answer
@@ -13,19 +13,24 @@
 # PATH it is set in the wrapper, so there is no need to set it here.
 #$ENV{'PATH'} = "/bin:/usr/bin:/usr/ucb";
 
-# 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";
 
 chdir($homedir) || die("Can't chdir(\"$homedir\"): $!");
+unshift(@INC, $bindir);
 unshift(@INC, $homedir);
 require "shlock.pl";
 require "majordomo.pl";