X-Git-Url: https://git.proxmox.com/?p=pve-access-control.git;a=blobdiff_plain;f=PVE%2FAuth%2FPVE.pm;h=8714a6b6a5131a47ab65942c9402d9025736f20f;hp=7f771fafde56c74e4241ce73f99dcdd1e5177f0f;hb=8978ab373c63fe92e4bfe17cc64fe593b3fd27f1;hpb=5bb4e06a6440c8b67e67e14de9e42ba17a966b23 diff --git a/PVE/Auth/PVE.pm b/PVE/Auth/PVE.pm index 7f771fa..8714a6b 100755 --- a/PVE/Auth/PVE.pm +++ b/PVE/Auth/PVE.pm @@ -1,6 +1,8 @@ package PVE::Auth::PVE; use strict; +use warnings; + use PVE::Auth::Plugin; use PVE::Cluster qw(cfs_register_file cfs_read_file cfs_write_file cfs_lock_file); @@ -17,10 +19,10 @@ sub parse_shadow_passwd { my $shadow = {}; - while ($raw && $raw =~ s/^(.*?)(\n|$)//) { - my $line = $1; + return $shadow if !defined($raw); - next if $line =~ m/^\s*$/; # skip empty lines + while ($raw =~ /^\s*(.+?)\s*$/gm) { + my $line = $1; if ($line !~ m/^\S+:\S+:$/) { warn "pve shadow password: ignore invalid line $.\n"; @@ -60,10 +62,11 @@ sub type { return 'pve'; } -sub defaults { +sub options { return { default => { optional => 1 }, comment => { optional => 1 }, + tfa => { optional => 1 }, }; }