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 keydb.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. */
| 1727 | * The function will just exit with an error if the user is trying to mix |
| 1728 | * both the loading methods. */ |
| 1729 | void ACLLoadUsersAtStartup(void) { |
| 1730 | if (g_pserver->acl_filename[0] != '\0' && listLength(UsersToLoad) != 0) { |
| 1731 | serverLog(LL_WARNING, |
| 1732 | "Configuring KeyDB with users defined in keydb.conf and at " |
| 1733 | "the same setting an ACL file path is invalid. This setup " |
| 1734 | "is very likely to lead to configuration errors and security " |
| 1735 | "holes, please define either an ACL file or declare users " |
| 1736 | "directly in your keydb.conf, but not both."); |
| 1737 | exit(1); |
| 1738 | } |
| 1739 | |
| 1740 | if (ACLLoadConfiguredUsers() == C_ERR) { |
| 1741 | serverLog(LL_WARNING, |
| 1742 | "Critical error while loading ACLs. Exiting."); |
| 1743 | exit(1); |
| 1744 | } |
| 1745 | |
| 1746 | if (g_pserver->acl_filename[0] != '\0') { |
| 1747 | sds errors = ACLLoadFromFile(g_pserver->acl_filename); |
| 1748 | if (errors) { |
| 1749 | serverLog(LL_WARNING, |
| 1750 | "Aborting KeyDB startup because of ACL errors: %s", errors); |
| 1751 | sdsfree(errors); |
| 1752 | exit(1); |
| 1753 | } |
| 1754 | } |
| 1755 | } |
| 1756 | |
| 1757 | /* ============================================================================= |
| 1758 | * ACL log |
no test coverage detected