diff options
author | antirez <antirez@gmail.com> | 2019-01-10 16:39:32 +0100 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2019-01-10 16:39:32 +0100 |
commit | 29c88a9ce593639599076bd1f564306e38ea7428 (patch) | |
tree | 58c4c835ced9df0f016af237ba867fb3b29451ca | |
parent | e9a902a95802367462cf42d9f950498ccf00b74b (diff) | |
download | redis-29c88a9ce593639599076bd1f564306e38ea7428.tar.gz |
ACL: initialization function.
-rw-r--r-- | src/acl.c | 11 | ||||
-rw-r--r-- | src/server.c | 1 | ||||
-rw-r--r-- | src/server.h | 1 |
3 files changed, 13 insertions, 0 deletions
@@ -30,6 +30,12 @@ #include "server.h" /* ============================================================================= + * Global state for ACLs + * ==========================================================================*/ + +rax *Users; /* Table mapping usernames to user structures. */ + +/* ============================================================================= * Helper functions for the rest of the ACL implementation * ==========================================================================*/ @@ -79,6 +85,11 @@ int time_independent_strcmp(char *a, char *b) { * 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, * otherwise C_ERR is returned and errno is set to: * diff --git a/src/server.c b/src/server.c index c297e9122..48b4cdb47 100644 --- a/src/server.c +++ b/src/server.c @@ -2185,6 +2185,7 @@ void initServer(void) { if (server.cluster_enabled) clusterInit(); replicationScriptCacheInit(); scriptingInit(1); + ACLInit(); slowlogInit(); latencyMonitorInit(); bioInit(); diff --git a/src/server.h b/src/server.h index 22224f292..e120e9894 100644 --- a/src/server.h +++ b/src/server.h @@ -1682,6 +1682,7 @@ void sendChildInfo(int process_type); void receiveChildInfo(void); /* acl.c -- Authentication related prototypes. */ +void ACLInit(void); int ACLCheckUserCredentials(robj *username, robj *password); unsigned long ACLGetCommandID(const char *cmdname); user *ACLGetUserByName(const char *name, size_t namelen); |