diff --git a/src/acl.c b/src/acl.c index 2202f293..269e4b40 100644 --- a/src/acl.c +++ b/src/acl.c @@ -29,6 +29,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 c297e912..48b4cdb4 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 22224f29..e120e989 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);