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
29c88a9c
Commit
29c88a9c
authored
Jan 10, 2019
by
antirez
Browse files
ACL: initialization function.
parent
e9a902a9
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/acl.c
View file @
29c88a9c
...
@@ -29,6 +29,12 @@
...
@@ -29,6 +29,12 @@
#include "server.h"
#include "server.h"
/* =============================================================================
* Global state for ACLs
* ==========================================================================*/
rax
*
Users
;
/* Table mapping usernames to user structures. */
/* =============================================================================
/* =============================================================================
* Helper functions for the rest of the ACL implementation
* Helper functions for the rest of the ACL implementation
* ==========================================================================*/
* ==========================================================================*/
...
@@ -79,6 +85,11 @@ int time_independent_strcmp(char *a, char *b) {
...
@@ -79,6 +85,11 @@ int time_independent_strcmp(char *a, char *b) {
* Low level ACL API
* Low level ACL API
* ==========================================================================*/
* ==========================================================================*/
/* Initialization of the ACL subsystem. */
void
ACLInit
(
void
)
{
Users
=
raxNew
();
}
/* Check the username and password pair and return C_OK if they are valid,
/* Check the username and password pair and return C_OK if they are valid,
* otherwise C_ERR is returned and errno is set to:
* otherwise C_ERR is returned and errno is set to:
*
*
...
...
src/server.c
View file @
29c88a9c
...
@@ -2185,6 +2185,7 @@ void initServer(void) {
...
@@ -2185,6 +2185,7 @@ void initServer(void) {
if
(
server
.
cluster_enabled
)
clusterInit
();
if
(
server
.
cluster_enabled
)
clusterInit
();
replicationScriptCacheInit
();
replicationScriptCacheInit
();
scriptingInit
(
1
);
scriptingInit
(
1
);
ACLInit
();
slowlogInit
();
slowlogInit
();
latencyMonitorInit
();
latencyMonitorInit
();
bioInit
();
bioInit
();
...
...
src/server.h
View file @
29c88a9c
...
@@ -1682,6 +1682,7 @@ void sendChildInfo(int process_type);
...
@@ -1682,6 +1682,7 @@ void sendChildInfo(int process_type);
void
receiveChildInfo
(
void
);
void
receiveChildInfo
(
void
);
/* acl.c -- Authentication related prototypes. */
/* acl.c -- Authentication related prototypes. */
void
ACLInit
(
void
);
int
ACLCheckUserCredentials
(
robj
*
username
,
robj
*
password
);
int
ACLCheckUserCredentials
(
robj
*
username
,
robj
*
password
);
unsigned
long
ACLGetCommandID
(
const
char
*
cmdname
);
unsigned
long
ACLGetCommandID
(
const
char
*
cmdname
);
user
*
ACLGetUserByName
(
const
char
*
name
,
size_t
namelen
);
user
*
ACLGetUserByName
(
const
char
*
name
,
size_t
namelen
);
...
...
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