From 62754faedf1e5d205d654e37b6ea5e8aa2e4c3a4 Mon Sep 17 00:00:00 2001 From: buzhimingyonghu <1512049108@qq.com> Date: Thu, 31 Oct 2024 09:25:39 +0000 Subject: [PATCH] fix InitUser --- src/pika_client_conn.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pika_client_conn.cc b/src/pika_client_conn.cc index 2643cd30a..35e71e752 100644 --- a/src/pika_client_conn.cc +++ b/src/pika_client_conn.cc @@ -543,8 +543,9 @@ bool PikaClientConn::IsAuthed() const { return authenticated_; } void PikaClientConn::InitUser() { if (g_pika_conf->requirepass().empty()) { user_ = g_pika_server->Acl()->GetUserLock(Acl::DefaultUser); + } else { + user_ = g_pika_server->Acl()->GetUserLock(Acl::DefaultLimitUser); } - user_ = g_pika_server->Acl()->GetUserLock(Acl::DefaultLimitUser); authenticated_ = user_->HasFlags(static_cast(AclUserFlag::NO_PASS)) && !user_->HasFlags(static_cast(AclUserFlag::DISABLED)); }