From 4a6f5dd2f034a6397372bd894bfd62a27704c132 Mon Sep 17 00:00:00 2001 From: Devin Carraway Date: Sun, 31 Jul 2005 08:48:04 +0000 Subject: [PATCH] Merge r529 from 0.31 branch (explicit config dir via $QPSMTPD_CONFIG). git-svn-id: https://svn.perl.org/qpsmtpd/trunk@539 958fd67b-6ff1-0310-b445-bb7760255be9 --- lib/Qpsmtpd.pm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/Qpsmtpd.pm b/lib/Qpsmtpd.pm index 3af5ed6..99861d8 100644 --- a/lib/Qpsmtpd.pm +++ b/lib/Qpsmtpd.pm @@ -116,6 +116,10 @@ sub config_dir { my $configdir = ($ENV{QMAIL} || '/var/qmail') . '/control'; my ($name) = ($0 =~ m!(.*?)/([^/]+)$!); $configdir = "$name/config" if (-e "$name/config/$config"); + if (exists $ENV{QPSMTPD_CONFIG}) { + $ENV{QPSMTPD_CONFIG} =~ /^(.*)$/; # detaint + $configdir = $1 if -e "$1/$config"; + } return $configdir; }