Add new LIBROOT env var

This commit is contained in:
iliajie
2022-12-05 19:03:10 +02:00
parent 9f0d9a967b
commit a9349c7fe5
2 changed files with 4 additions and 1 deletions

View File

@@ -13,7 +13,7 @@ Full function documentation is in web-lib-funcs.pl.
=cut
package WebminCore;
use lib ("$ENV{'PERLLIB'}/vendor_perl");
use lib ("$ENV{'LIBROOT'}/vendor_perl");
require Exporter;
@ISA = qw(Exporter);

View File

@@ -27,6 +27,7 @@ else {
$config_file = "$pwd/$ARGV[0]";
}
%config = &read_config_file($config_file);
$ENV{'LIBROOT'} = $config{'root'};
if ($config{'perllib'}) {
push(@INC, split(/:/, $config{'perllib'}));
push(@INC, "$config{'root'}/vendor_perl");
@@ -2395,6 +2396,7 @@ if (&get_type($full) eq "internal/cgi" && $validated != 4) {
$envlang = $ENV{"LANG"};
$envroot = $ENV{"SystemRoot"};
$envperllib = $ENV{'PERLLIB'};
$envdoclroot = $ENV{'LIBROOT'};
foreach my $k (keys %ENV) {
delete($ENV{$k});
}
@@ -2403,6 +2405,7 @@ if (&get_type($full) eq "internal/cgi" && $validated != 4) {
$ENV{"USER"} = $envuser if ($envuser);
$ENV{"OLD_LANG"} = $envlang if ($envlang);
$ENV{"SystemRoot"} = $envroot if ($envroot);
$ENV{'LIBROOT'} = $envdoclroot if ($envdoclroot);
$ENV{'PERLLIB'} = $envperllib if ($envperllib);
$ENV{"HOME"} = $user_homedir;
$ENV{"SERVER_SOFTWARE"} = $config{"server"};