]> git.proxmox.com Git - pve-access-control.git/blobdiff - PVE/Auth/PVE.pm
improve parse_user_config, parse_shadow_config
[pve-access-control.git] / PVE / Auth / PVE.pm
index 7f03b9e531881dd976499353975437bec04aaaa3..71479979eea163f47787f9d2e96fe0d869121f55 100755 (executable)
@@ -19,11 +19,9 @@ sub parse_shadow_passwd {
 
     my $shadow = {};
 
-    while ($raw && $raw =~ s/^(.*?)(\n|$)//) {
+    while ($raw =~ /^\s*(.+?)\s*$/gm) {
        my $line = $1;
 
-       next if $line =~ m/^\s*$/; # skip empty lines
-
        if ($line !~ m/^\S+:\S+:$/) {
            warn "pve shadow password: ignore invalid line $.\n";
            next;