X-Git-Url: https://oss.titaniummirror.com/gitweb/?a=blobdiff_plain;f=git_acl.c;h=6af2c2c03bd0ec896004f1e5d366d2d562f88cb2;hb=324d66c100a844c9554e676bb4ca18109f609b04;hp=e077f785e54fd2a78e8e828ca1c3ab6a2e088068;hpb=2657b21c48ee21f9f1667be242d7e85be8161cf9;p=repo_shell.git diff --git a/git_acl.c b/git_acl.c index e077f78..6af2c2c 100644 --- a/git_acl.c +++ b/git_acl.c @@ -114,7 +114,7 @@ static acl_clear(acl_t *acl) stra_destroy(&acl->userids); } -static int str_has_word(const char* string, const char* word) +static bool str_has_word(const char* string, const char* word) { char *_s = xstrdup(string); char *s = _s; @@ -174,13 +174,11 @@ static int acl_handler(void* user, const char* section, const char* name, return 1; } -int git_acl(char *user, char *repo, char *file) +int git_acl(const char *user, const char *repo, const char *file) { acl_t acl; - if (!file || !*file) - file = GIT_ACL_FILE; - if (!user || !*user || !repo || !*repo) { + if (!file || !*file || !user || !*user || !repo || !*repo) { die("git_acl: invalid args user='%s', repo='%s', file='%s'", user, repo, file); } @@ -189,8 +187,8 @@ int git_acl(char *user, char *repo, char *file) set_lm_userid(NULL); lm_perms = PERMS_NOTFOUND; acl_init(&acl); - acl.user = user; - acl.repo = repo; + acl.user = (char*)user; + acl.repo = (char*)repo; stra_add(&acl.userids, acl.user); stra_add(&acl.repoids, acl.repo);