This function is called once the server is already running, modules are * loaded, and we are ready to start, in order to load the ACLs either from * the pending list of users defined in redis.conf, or from the ACL file. * The function will just exit with an error if the user is trying to mix * both the loading methods. */
| 1718 | * The function will just exit with an error if the user is trying to mix |
| 1719 | * both the loading methods. */ |
| 1720 | void ACLLoadUsersAtStartup(void) { |
| 1721 | if (server.acl_filename[0] != '\0' && listLength(UsersToLoad) != 0) { |
| 1722 | serverLog(LL_WARNING, |
| 1723 | "Configuring Redis with users defined in redis.conf and at " |
| 1724 | "the same setting an ACL file path is invalid. This setup " |
| 1725 | "is very likely to lead to configuration errors and security " |
| 1726 | "holes, please define either an ACL file or declare users " |
| 1727 | "directly in your redis.conf, but not both."); |
| 1728 | exit(1); |
| 1729 | } |
| 1730 | |
| 1731 | if (ACLLoadConfiguredUsers() == C_ERR) { |
| 1732 | serverLog(LL_WARNING, |
| 1733 | "Critical error while loading ACLs. Exiting."); |
| 1734 | exit(1); |
| 1735 | } |
| 1736 | |
| 1737 | if (server.acl_filename[0] != '\0') { |
| 1738 | sds errors = ACLLoadFromFile(server.acl_filename); |
| 1739 | if (errors) { |
| 1740 | serverLog(LL_WARNING, |
| 1741 | "Aborting Redis startup because of ACL errors: %s", errors); |
| 1742 | sdsfree(errors); |
| 1743 | exit(1); |
| 1744 | } |
| 1745 | } |
| 1746 | } |
| 1747 | |
| 1748 | /* ============================================================================= |
| 1749 | * ACL log |
no test coverage detected