ACL: split acl.c into clear sections.

This commit is contained in:
antirez 2019-01-10 16:35:55 +01:00
parent 4278104acc
commit e9a902a958

View File

@ -29,6 +29,10 @@
#include "server.h" #include "server.h"
/* =============================================================================
* Helper functions for the rest of the ACL implementation
* ==========================================================================*/
/* Return zero if strings are the same, non-zero if they are not. /* Return zero if strings are the same, non-zero if they are not.
* The comparison is performed in a way that prevents an attacker to obtain * The comparison is performed in a way that prevents an attacker to obtain
* information about the nature of the strings just monitoring the execution * information about the nature of the strings just monitoring the execution
@ -71,6 +75,10 @@ int time_independent_strcmp(char *a, char *b) {
return diff; /* If zero strings are the same. */ return diff; /* If zero strings are the same. */
} }
/* =============================================================================
* Low level ACL API
* ==========================================================================*/
/* 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:
* *
@ -115,3 +123,7 @@ unsigned long ACLGetCommandID(const char *cmdname) {
user *ACLGetUserByName(const char *name, size_t namelen) { user *ACLGetUserByName(const char *name, size_t namelen) {
return NULL; return NULL;
} }
/* =============================================================================
* ACL related commands
* ==========================================================================*/