*/
#include <stdbool.h>
-//#include <stdio.h>
-//#include <errno.h>
-//#include <stdlib.h>
-//#include <sys/types.h>
-//#include <fcntl.h>
-//#include <unistd.h>
-//#include <pwd.h>
+#include <stdlib.h>
#include <string.h>
#include "ini.h"
#include "utility.h"
-#include "mystrtok.h"
+#include "stringutils.h"
#include "stra.h"
#include "git_acl.h"
stra_destroy(&acl->userids);
}
-static bool str_has_word(const char* string, const char* word)
-{
- char *_s = xstrdup(string);
- char *s = _s;
- char *p = my_strtok(&s, " \t\n");
-
- while (p) {
- if (!strcmp(p, word)) {
- free(_s);
- return true;
- }
- p = my_strtok(&s, " \t\n");
- }
- free(_s);
- return false;
-}
-
static int acl_handler(void* user, const char* section, const char* name,
const char* value)
{
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 (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);