# HG changeset patch # User Olaf Wintermann # Date 1763906392 -3600 # Node ID a95045234b9b1b7e0d9e8d78e3c2544059a256c7 # Parent 1e8416350254e625935b1d30e1ee146b63797906 implement Location AddACL directive diff -r 1e8416350254 -r a95045234b9b src/server/daemon/location.c --- a/src/server/daemon/location.c Sun Nov 23 13:48:29 2025 +0100 +++ b/src/server/daemon/location.c Sun Nov 23 14:59:52 2025 +0100 @@ -33,6 +33,7 @@ #include "../util/pblock.h" #include "vserver.h" #include +#include #define DIR_CHECK_ARGC(n) if(argc != n) { \ log_ereport(LOG_FAILURE, "%s directive argc != %d", name.ptr, n); \ @@ -57,6 +58,19 @@ } else if(!cx_strcasecmp(name, "DocumentRoot")) { DIR_CHECK_ARGC(1); location->config.docroot = cx_strdup_a(a, dir->args->value); + } else if(!cx_strcasecmp(name, "AddACL")) { + DIR_CHECK_ARGC(1); + if(!location->config.acls) { + CxList *aclList = cxLinkedListCreate(cfg->a, NULL, CX_STORE_POINTERS); + if(!aclList) { + return 1; + } + location->config.acls = aclList; + cxmutstr aclName = dir->args->value; + if(cxListAdd(aclList, aclName.ptr)) { + return 1; + } + } } else if(!cx_strcasecmp(name, "Location")) { WSLocation *sub_location = cfg_location_get(cfg, dir); if(!sub_location) {