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
This commit is contained in:
Devin Carraway 2005-07-31 08:48:04 +00:00
parent 4cdae6bf05
commit 4a6f5dd2f0

View File

@ -116,6 +116,10 @@ sub config_dir {
my $configdir = ($ENV{QMAIL} || '/var/qmail') . '/control'; my $configdir = ($ENV{QMAIL} || '/var/qmail') . '/control';
my ($name) = ($0 =~ m!(.*?)/([^/]+)$!); my ($name) = ($0 =~ m!(.*?)/([^/]+)$!);
$configdir = "$name/config" if (-e "$name/config/$config"); $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; return $configdir;
} }