keep locale for vncshell and spiceshell

use the new keeplocale parameter from run_command and do not delete the
LANG and LANGUAGE variable for the vncshell

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak 2017-02-28 12:22:56 +01:00 committed by Dietmar Maurer
parent f536f691ab
commit b0d4b407d8
2 changed files with 3 additions and 5 deletions

View File

@ -702,12 +702,12 @@ __PACKAGE__->register_method ({
eval {
foreach my $k (keys %ENV) {
next if $k eq 'PVE_VNC_TICKET';
next if $k eq 'PATH' || $k eq 'TERM' || $k eq 'USER' || $k eq 'HOME';
next if $k eq 'PATH' || $k eq 'TERM' || $k eq 'USER' || $k eq 'HOME' || $k eq 'LANG' || $k eq 'LANGUAGE';
delete $ENV{$k};
}
$ENV{PWD} = '/';
PVE::Tools::run_command($cmd, errmsg => "vncterm failed");
PVE::Tools::run_command($cmd, errmsg => "vncterm failed", keeplocale => 1);
};
if (my $err = $@) {
syslog ('err', $err);

View File

@ -178,9 +178,7 @@ sub run_spiceterm {
$ENV{PWD} = '/';
$ENV{SPICE_TICKET} = $ticket;
# run_command sets LC_ALL, so we use system() instead
system(@$cmd) == 0 ||
die "spiceterm failed\n";
PVE::Tools::run_command($cmd, errmsg => 'spiceterm failed\n', keeplocale => 1);
};
if (my $err = $@) {
syslog ('err', $err);