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
f099def7
Commit
f099def7
authored
Jul 04, 2019
by
antirez
Browse files
Merge branch 'unstable' of github.com:/antirez/redis into unstable
parents
3e43aed1
0cabe0cf
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/acl.c
View file @
f099def7
...
...
@@ -295,7 +295,7 @@ int ACLGetCommandBitCoordinates(uint64_t id, uint64_t *word, uint64_t *bit) {
* Note that this function does not check the ALLCOMMANDS flag of the user
* but just the lowlevel bitmask.
*
* If the bit overflows the user internal represetation, zero is returned
* If the bit overflows the user internal represe
n
tation, zero is returned
* in order to disallow the execution of the command in such edge case. */
int
ACLGetUserCommandBit
(
user
*
u
,
unsigned
long
id
)
{
uint64_t
word
,
bit
;
...
...
@@ -311,7 +311,7 @@ int ACLUserCanExecuteFutureCommands(user *u) {
}
/* Set the specified command bit for the specified user to 'value' (0 or 1).
* If the bit overflows the user internal represetation, no operation
* If the bit overflows the user internal represe
n
tation, no operation
* is performed. As a side effect of calling this function with a value of
* zero, the user flag ALLCOMMANDS is cleared since it is no longer possible
* to skip the command bit explicit test. */
...
...
@@ -350,7 +350,7 @@ int ACLSetUserCommandBitsForCategory(user *u, const char *category, int value) {
/* Return the number of commands allowed (on) and denied (off) for the user 'u'
* in the subset of commands flagged with the specified category name.
* If the catego
t
y name is not valid, C_ERR is retur
e
nd, otherwise C_OK is
* If the catego
r
y name is not valid, C_ERR is return
e
d, otherwise C_OK is
* returned and on and off are populated by reference. */
int
ACLCountCategoryBitsForUser
(
user
*
u
,
unsigned
long
*
on
,
unsigned
long
*
off
,
const
char
*
category
)
...
...
@@ -626,7 +626,7 @@ void ACLAddAllowedSubcommand(user *u, unsigned long id, const char *sub) {
* It is possible to specify multiple patterns.
* allkeys Alias for ~*
* resetkeys Flush the list of allowed keys patterns.
* ><password> Add this pass
o
wrd to the list of valid password for the user.
* ><password> Add this passw
o
rd to the list of valid password for the user.
* For example >mypass will add "mypass" to the list.
* This directive clears the "nopass" flag (see later).
* <<password> Remove this password from the list of valid passwords.
...
...
@@ -949,9 +949,9 @@ user *ACLGetUserByName(const char *name, size_t namelen) {
return
myuser
;
}
/* Check if the command ready to be excuted in the client 'c',
and
already
* referenced by c->cmd, can be executed by this client according to the
* AC
l
s associated to the client user c->user.
/* Check if the command
is
ready to be ex
e
cuted in the client 'c', already
* referenced by c->cmd,
and
can be executed by this client according to the
* AC
L
s associated to the client user c->user.
*
* If the user can execute the command ACL_OK is returned, otherwise
* ACL_DENIED_CMD or ACL_DENIED_KEY is returned: the first in case the
...
...
@@ -1122,7 +1122,7 @@ int ACLLoadConfiguredUsers(void) {
}
/* This function loads the ACL from the specified filename: every line
* is validated and shold be either empty or in the format used to specify
* is validated and sho
u
ld be either empty or in the format used to specify
* users in the redis.conf configuration or in the ACL file, that is:
*
* user <username> ... rules ...
...
...
@@ -1172,7 +1172,7 @@ sds ACLLoadFromFile(const char *filename) {
* to the real user mentioned in the ACL line. */
user
*
fakeuser
=
ACLCreateUnlinkedUser
();
/* We do all the loading in a fresh inst
e
ance of the Users radix tree,
/* We do all the loading in a fresh instance of the Users radix tree,
* so if there are errors loading the ACL file we can rollback to the
* old version. */
rax
*
old_users
=
Users
;
...
...
@@ -1248,7 +1248,7 @@ sds ACLLoadFromFile(const char *filename) {
}
/* Note that the same rules already applied to the fake user, so
* we just assert that everything goes
s
well: it should. */
* we just assert that everything goes well: it should. */
for
(
j
=
2
;
j
<
argc
;
j
++
)
serverAssert
(
ACLSetUser
(
u
,
argv
[
j
],
sdslen
(
argv
[
j
]))
==
C_OK
);
...
...
@@ -1611,7 +1611,7 @@ void addReplyCommandCategories(client *c, struct redisCommand *cmd) {
setDeferredSetLen
(
c
,
flaglen
,
flagcount
);
}
/* AUTH <pass
o
wrd>
/* AUTH <passw
o
rd>
* AUTH <username> <password> (Redis >= 6.0 form)
*
* When the user is omitted it means that we are trying to authenticate
...
...
src/redis-benchmark.c
View file @
f099def7
...
...
@@ -1540,7 +1540,10 @@ int main(int argc, const char **argv) {
if
(
node
->
name
)
printf
(
"%s "
,
node
->
name
);
printf
(
"%s:%d
\n
"
,
node
->
ip
,
node
->
port
);
node
->
redis_config
=
getRedisConfig
(
node
->
ip
,
node
->
port
,
NULL
);
if
(
node
->
redis_config
==
NULL
)
exit
(
1
);
if
(
node
->
redis_config
==
NULL
)
{
fprintf
(
stderr
,
"WARN: could not fetch node CONFIG %s:%d
\n
"
,
node
->
ip
,
node
->
port
);
}
}
printf
(
"
\n
"
);
/* Automatically set thread number to node count if not specified
...
...
@@ -1550,7 +1553,8 @@ int main(int argc, const char **argv) {
}
else
{
config
.
redis_config
=
getRedisConfig
(
config
.
hostip
,
config
.
hostport
,
config
.
hostsocket
);
if
(
config
.
redis_config
==
NULL
)
exit
(
1
);
if
(
config
.
redis_config
==
NULL
)
fprintf
(
stderr
,
"WARN: could not fetch server CONFIG
\n
"
);
}
if
(
config
.
num_threads
>
0
)
{
...
...
src/server.c
View file @
f099def7
...
...
@@ -3338,7 +3338,7 @@ int processCommand(client *c) {
if
(
acl_retval
==
ACL_DENIED_CMD
)
addReplyErrorFormat
(
c
,
"-NOPERM this user has no permissions to run "
"the '%s' command or its subcomm
n
ad"
,
c
->
cmd
->
name
);
"the '%s' command or its subcomma
n
d"
,
c
->
cmd
->
name
);
else
addReplyErrorFormat
(
c
,
"-NOPERM this user has no permissions to access "
...
...
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