src/server/config/acl.c

changeset 97
09fbefc0e6a9
parent 91
fac51f87def0
child 101
7fbcdbad0baa
equal deleted inserted replaced
96:0185b13bf41f 97:09fbefc0e6a9
62 62
63 int acl_parse(void *p, ConfigLine *begin, ConfigLine *end, sstr_t line) { 63 int acl_parse(void *p, ConfigLine *begin, ConfigLine *end, sstr_t line) {
64 ACLFile *aclf = p; 64 ACLFile *aclf = p;
65 UcxAllocator *mp = aclf->parser.mp; 65 UcxAllocator *mp = aclf->parser.mp;
66 66
67 if(sstrsuffix(line, sstr("ACL "))) { 67 if(sstrprefix(line, sstr("ACL "))) {
68 sstr_t param = sstrsubs(line, 4); 68 sstr_t param = sstrsubs(line, 4);
69 UcxList *plist = cfg_param_list(param, mp); 69 UcxList *plist = cfg_param_list(param, mp);
70 ACLConfig *acl = OBJ_NEW(mp, ACLConfig); 70 ACLConfig *acl = OBJ_NEW(mp, ACLConfig);
71 acl->type.ptr = NULL; 71 acl->type.ptr = NULL;
72 acl->authparam = NULL; 72 acl->authparam = NULL;
90 } 90 }
91 91
92 if(type.ptr) { 92 if(type.ptr) {
93 acl->type = type; 93 acl->type = type;
94 } 94 }
95 } else if(sstrsuffix(line, sstr("Authenticate "))) { 95 } else if(sstrprefix(line, sstr("Authenticate "))) {
96 sstr_t param = sstrsubs(line, 13); 96 sstr_t param = sstrsubs(line, 13);
97 UcxList *plist = cfg_param_list(param, mp); 97 UcxList *plist = cfg_param_list(param, mp);
98 aclf->cur->authparam = plist; 98 aclf->cur->authparam = plist;
99 } else { 99 } else {
100 if(parse_ace(aclf, line)) { 100 if(parse_ace(aclf, line)) {

mercurial