mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-08-14 07:44:54 +00:00
cloud-init: replace password parameter in log messages
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
parent
3c23aa808c
commit
cefb41fa76
@ -920,10 +920,16 @@ my $update_vm_api = sub {
|
|||||||
|
|
||||||
my $background_delay = extract_param($param, 'background_delay');
|
my $background_delay = extract_param($param, 'background_delay');
|
||||||
|
|
||||||
|
if (defined(my $cipassword = $param->{cipassword})) {
|
||||||
|
# Same logic as in cloud-init (but with the regex fixed...)
|
||||||
|
$param->{cipassword} = PVE::Tools::encrypt_pw($cipassword)
|
||||||
|
if $cipassword !~ /^\$(?:[156]|2[ay])(\$.+){2}/;
|
||||||
|
}
|
||||||
|
|
||||||
my @paramarr = (); # used for log message
|
my @paramarr = (); # used for log message
|
||||||
foreach my $key (sort keys %$param) {
|
foreach my $key (sort keys %$param) {
|
||||||
push @paramarr, "-$key", $param->{$key};
|
my $value = $key eq 'cipassword' ? '<hidden>' : $param->{$key};
|
||||||
|
push @paramarr, "-$key", $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
my $skiplock = extract_param($param, 'skiplock');
|
my $skiplock = extract_param($param, 'skiplock');
|
||||||
@ -941,12 +947,6 @@ my $update_vm_api = sub {
|
|||||||
PVE::Tools::validate_ssh_public_keys($ssh_keys);
|
PVE::Tools::validate_ssh_public_keys($ssh_keys);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (defined(my $cipassword = $param->{cipassword})) {
|
|
||||||
# Same logic as in cloud-init (but with the regex fixed...)
|
|
||||||
$param->{cipassword} = PVE::Tools::encrypt_pw($cipassword)
|
|
||||||
if $cipassword !~ /^\$(?:[156]|2[ay])(\$.+){2}/;
|
|
||||||
}
|
|
||||||
|
|
||||||
die "no options specified\n" if !$delete_str && !$revert_str && !scalar(keys %$param);
|
die "no options specified\n" if !$delete_str && !$revert_str && !scalar(keys %$param);
|
||||||
|
|
||||||
my $storecfg = PVE::Storage::config();
|
my $storecfg = PVE::Storage::config();
|
||||||
|
Loading…
Reference in New Issue
Block a user