From 0a084d3c8afb7592d35a82cd2535fd1dc1c767bf Mon Sep 17 00:00:00 2001 From: feiniks <36756310+feiniks@users.noreply.github.com> Date: Wed, 31 Jul 2024 11:49:45 +0800 Subject: [PATCH] Don't print log when db password is ! (#673) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: 杨赫然 --- common/user-mgr.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/common/user-mgr.c b/common/user-mgr.c index 74d14d1..18b680e 100644 --- a/common/user-mgr.c +++ b/common/user-mgr.c @@ -847,8 +847,13 @@ validate_passwd_pbkdf2_sha256 (const char *passwd, const char *db_passwd) guint8 salt[SHA256_DIGEST_LENGTH]; char hashed_passwd[SHA256_DIGEST_LENGTH*2+1]; + if (g_strcmp0 (db_passwd, "!") == 0) + return FALSE; + tokens = g_strsplit (db_passwd, "$", -1); if (!tokens || g_strv_length (tokens) != 4) { + if (tokens) + g_strfreev (tokens); ccnet_warning ("Invalide db passwd format %s.\n", db_passwd); return FALSE; }