From 72650150d05bd2361449a147925f99f5be95db92 Mon Sep 17 00:00:00 2001 From: Michal Fox Date: Fri, 2 Oct 2026 16:51:16 +0200 Subject: [PATCH] fix #5368: pam: say that a failed password change is about the host user Users of the PAM realm are users of the host system, and setting their password runs usermod on the node handling the request. If the user only got added to the PAM realm, but does not exist on the host, this failed with: change password failed: user 'jdoe' does not exist which is confusing, as the user is shown in the user list of the web UI and the message does not say that the user on the host is meant. Mention the PAM user and the host system in the error message, so that it reads: changing the password of the PAM user 'jdoe' on the host system failed: user 'jdoe' does not exist The output of usermod is still added at the end, so this helps with its other errors too. Signed-off-by: Michal Fox --- src/PVE/Auth/PAM.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/PVE/Auth/PAM.pm b/src/PVE/Auth/PAM.pm index 8586da5..c2b767d 100644 --- a/src/PVE/Auth/PAM.pm +++ b/src/PVE/Auth/PAM.pm @@ -89,7 +89,10 @@ sub store_password { push @$cmd, '-p', $epw, $username; - run_command($cmd, errmsg => 'change password failed'); + run_command( + $cmd, + errmsg => "changing the password of the PAM user '$username' on the host system failed", + ); } 1;