X-Git-Url: https://oss.titaniummirror.com/gitweb/?a=blobdiff_plain;f=git_acl.c;h=ea171feedf2ba521cf9cf9995961e3b4769cacdf;hb=23709023139b1aab626f7ff01d364e254771c78f;hp=6af2c2c03bd0ec896004f1e5d366d2d562f88cb2;hpb=324d66c100a844c9554e676bb4ca18109f609b04;p=repo_shell.git diff --git a/git_acl.c b/git_acl.c index 6af2c2c..ea171fe 100644 --- a/git_acl.c +++ b/git_acl.c @@ -30,6 +30,8 @@ #include "stra.h" #include "git_acl.h" +#define ANYID "*" + enum { DFLT_IDS_SZ = 32 }; @@ -121,7 +123,7 @@ static bool str_has_word(const char* string, const char* word) char *p = my_strtok(&s, " \t\n"); while (p) { - if (!strcmp(p, word)) { + if (!strcmp(p, word) || !strcmp(p, ANYID)) { free(_s); return true; } @@ -159,8 +161,8 @@ static int acl_handler(void* user, const char* section, const char* name, 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 (stra_find(&acl->repoids, repo) >= 0 && - stra_find(&acl->userids, name) >= 0) { + if ((!strcmp(repo, ANYID) || stra_find(&acl->repoids, repo) >= 0) && + (!strcmp(name, ANYID) || stra_find(&acl->userids, name) >= 0)) { acl->perms = perms_from_str(value); set_lm_repoid(repo); set_lm_userid(name);