From 66b7e98db9f59f79e3cd742fad8288e8baffcf3f Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Wed, 18 Jan 2012 07:06:16 +0100 Subject: [PATCH] add test if user exists --- PVE/API2/AccessControl.pm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/PVE/API2/AccessControl.pm b/PVE/API2/AccessControl.pm index 3d7c80d..f06a244 100644 --- a/PVE/API2/AccessControl.pm +++ b/PVE/API2/AccessControl.pm @@ -153,6 +153,10 @@ __PACKAGE__->register_method ({ ($tmp eq 'root@pam' || $tmp eq $username)) { # got valid ticket # Note: root@pam can create tickets for other users + + # test if user exists and is enabled + my $usercfg = cfs_read_file('user.cfg'); + die "no such user ('$username')\n" if !user_enabled($usercfg, $username); } else { $username = PVE::AccessControl::authenticate_user($username, $param->{password}); } -- 2.39.2