]> git.proxmox.com Git - pve-access-control.git/blobdiff - PVE/Auth/PVE.pm
use new PVE::Tools::encrypt_pw, bump version to 5.0-3
[pve-access-control.git] / PVE / Auth / PVE.pm
index 71479979eea163f47787f9d2e96fe0d869121f55..6065df08411eb7e0d5c716b43abc78284821b428 100755 (executable)
@@ -3,6 +3,7 @@ package PVE::Auth::PVE;
 use strict;
 use warnings;
 
+use PVE::Tools;
 use PVE::Auth::Plugin;
 use PVE::Cluster qw(cfs_register_file cfs_read_file cfs_write_file cfs_lock_file);
 
@@ -19,6 +20,8 @@ sub parse_shadow_passwd {
 
     my $shadow = {};
 
+    return $shadow if !defined($raw);
+
     while ($raw =~ /^\s*(.+?)\s*$/gm) {
        my $line = $1;
 
@@ -90,7 +93,7 @@ sub store_password {
 
     lock_shadow_config(sub {
        my $shadow_cfg = cfs_read_file($shadowconfigfile);
-       my $epw = PVE::Auth::Plugin::encrypt_pw($password);
+       my $epw = PVE::Tools::encrypt_pw($password);
        $shadow_cfg->{users}->{$username}->{shadow} = $epw;
        cfs_write_file($shadowconfigfile, $shadow_cfg);
     });