Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
0db42d4b
Commit
0db42d4b
authored
Jan 16, 2019
by
antirez
Browse files
ACL: implement the key match opcode in ACLSetUser().
parent
ff92c069
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/acl.c
View file @
0db42d4b
...
...
@@ -203,6 +203,12 @@ int ACLSetUser(user *u, const char *op, ssize_t oplen) {
listNode
*
ln
=
listSearchKey
(
u
->
passwords
,
delpass
);
if
(
ln
)
listDelNode
(
u
->
passwords
,
ln
);
sdsfree
(
delpass
);
}
else
if
(
op
[
0
]
==
'~'
)
{
sds
newpat
=
sdsnewlen
(
op
+
1
,
oplen
-
1
);
listNode
*
ln
=
listSearchKey
(
u
->
patterns
,
newpat
);
/* Avoid re-adding the same pattern multiple times. */
if
(
ln
==
NULL
)
listAddNodeTail
(
u
->
patterns
,
newpat
);
u
->
flags
&=
~
USER_FLAG_ALLKEYS
;
}
else
{
return
C_ERR
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment