#include "utility.h"
#include "mystrtok.h"
#include "stra.h"
+#include "match.h"
#include "git_acl.h"
-#define ANYID "*"
-
enum {
DFLT_IDS_SZ = 32
};
char *p = my_strtok(&s, " \t\n");
while (p) {
- if (!strcmp(p, word) || !strcmp(p, ANYID)) {
+ if (match(p, word)) {
free(_s);
return true;
}
if (!repo || my_strtok(&p, " \t\n"))
die("acl_handler: badly formatted section '%s'", section);
/* repo is repo name, name is userid, value is permission */
- if ((!strcmp(repo, ANYID) || stra_find(&acl->repoids, repo) >= 0) &&
- (!strcmp(name, ANYID) || stra_find(&acl->userids, name) >= 0)) {
+ if (stra_match(&acl->repoids, repo) >= 0 &&
+ stra_match(&acl->userids, name) >= 0) {
acl->perms = perms_from_str(value);
set_lm_repoid(repo);
set_lm_userid(name);