Skip to content

fix: requirepass allows connection with any non-empty password (unstable)#3114

Merged
Mixficsol merged 1 commit intoOpenAtomFoundation:unstablefrom
YuCai18:hotfixuns/fix_requirepass
Jun 20, 2025
Merged

fix: requirepass allows connection with any non-empty password (unstable)#3114
Mixficsol merged 1 commit intoOpenAtomFoundation:unstablefrom
YuCai18:hotfixuns/fix_requirepass

Conversation

@YuCai18
Copy link
Copy Markdown
Collaborator

@YuCai18 YuCai18 commented Jun 20, 2025

修复bug #3085 :解决requirepass是非空的但可通过任意密码连接(unstable版本)

requirepass 为非空时填写任意字符串即可连接的原因

image

因为src/acl.cc文件中的Acl::InitLimitUser()函数的没有设置else分支,若 userpass 为空且requirepass不为空,limit 用户就会被设置为 nopass(免密),任何密码都能通过;若userpass 和 requirepass 都为空,所有用户都是管理员;若userpass 不为空且requirepass为空就会报(error) ERR Client sent AUTH, but no password is set的错误。

修改后的运行截图

image

image

@github-actions github-actions Bot added the ☢️ Bug Something isn't working label Jun 20, 2025
@Mixficsol Mixficsol merged commit 8b077fc into OpenAtomFoundation:unstable Jun 20, 2025
11 checks passed
byseea11 pushed a commit to byseea11/pikiwidb that referenced this pull request Sep 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

☢️ Bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants