From 970ce1ae4e4b99f4f181d58c5c1e0eb6d3afe5b9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fabian=20Bl=C3=A4se?= Date: Tue, 17 Mar 2020 16:55:57 +0100 Subject: [PATCH] session: deny access if password login is disabled MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The special characters '!' and '*' in /etc/shadow are used to disable password login for a specific account. The character 'x' has no special meaning, but should not be interpreted as an empty password. However, rpcd did treat these special characters like no password was set, which allows access even though the account is disabled. By removing the additional checks for these characters, the encrypted password string is passed to crypt, which returns NULL if the salt has an invalid format and therefore access is denied. Fixes: FS#2634 Signed-off-by: Fabian Bläse (cherry picked from commit 3df62bcebd2caff47506ccffb42df8d2d2123c06) --- session.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/session.c b/session.c index 13a2ef3..908e298 100644 --- a/session.c +++ b/session.c @@ -795,7 +795,7 @@ rpc_login_test_password(const char *hash, const char *password) char *crypt_hash; /* password is not set */ - if (!hash || !*hash || !strcmp(hash, "!") || !strcmp(hash, "x")) + if (!hash || !*hash) { return true; } -- 2.30.2