]> git.proxmox.com Git - pmg-api.git/commitdiff
UserConfig: remove useless eval
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Fri, 9 Feb 2018 10:08:31 +0000 (11:08 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Thu, 15 Feb 2018 07:24:40 +0000 (08:24 +0100)
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
PMG/UserConfig.pm

index 8ccb8f5fc93921b5f4fbddfff5ce370c7203bb17..0b9a73da6850b16d92b590cc7b271fd4528df637 100644 (file)
@@ -241,19 +241,13 @@ sub write_user_conf {
        $d->{userid} = $userid;
 
        die "invalid userid '$userid'\n" if $userid eq 'root@pmg';
+       $verity_entry->($d);
+       $cfg->{$d->{userid}} = $d;
 
-       eval {
-           $verity_entry->($d);
-           $cfg->{$d->{userid}} = $d;
-
-           if ($d->{userid} ne 'root@pam') {
-               die "role 'root' is reserved\n" if $d->{role} eq 'root';
-               die "unable to add users for realm '$d->{realm}'\n"
-                   if $d->{realm} && $d->{realm} ne 'pmg';
-           }
-       };
-       if (my $err = $@) {
-           die $err;
+       if ($d->{userid} ne 'root@pam') {
+           die "role 'root' is reserved\n" if $d->{role} eq 'root';
+           die "unable to add users for realm '$d->{realm}'\n"
+               if $d->{realm} && $d->{realm} ne 'pmg';
        }
 
        my $line;