X-Git-Url: https://oss.titaniummirror.com/gitweb?a=blobdiff_plain;f=repo_shell.c;h=f5ec2680fdcf9e2f408a860cfc5eddff30a0365a;hb=bcc0e47c0c7bebbcc6abc30390894fa2ca93f5c8;hp=f6ef69fe6211438fdac72dc388422419a17b24ab;hpb=b23a628665f06ad8954bb269d2552f63cb37dbac;p=repo_shell.git diff --git a/repo_shell.c b/repo_shell.c index f6ef69f..f5ec268 100644 --- a/repo_shell.c +++ b/repo_shell.c @@ -16,6 +16,7 @@ #define CFG_FILE "/etc/repo_shell.conf" #define SHELL "/bin/bash" +#define GIT_ACL_FILE ".gitacls" typedef struct { char *user; @@ -53,9 +54,9 @@ static char *dequote(char *arg) return narg; } -static char *add_prefix(char *prefix, char* arg) +static char *add_prefix(const char *prefix, const char* arg) { - char *narg = arg; + char *narg; int i; if (arg && prefix && (i = strlen(prefix))) { @@ -145,12 +146,11 @@ static int ini_handler(void* user, const char* section, const char* name, if (!strcmp(name, "svn_root")) pconfig->svn_root = xstrdup(value); - else if (!strcmp(name, "git_root")) + else if (!strcmp(name, "git_root")) { pconfig->git_root = xstrdup(value); - else if (!strcmp(name, "owner")) + pconfig->git_acl_file = add_prefix(value, GIT_ACL_FILE); + } else if (!strcmp(name, "owner")) pconfig->owner = xstrdup(value); - else if (!strcmp(name, "git_acl_file")) - pconfig->git_acl_file = xstrdup(value); else if (!strcmp(name, "allow_interactive")) pconfig->allow_interactive = str_has_word(value, pconfig->user); else