]> oss.titaniummirror.com Git - repo_shell.git/blobdiff - repo_shell.c
git_acl_file is always {git_root}/.gitacls
[repo_shell.git] / repo_shell.c
index f6ef69fe6211438fdac72dc388422419a17b24ab..f5ec2680fdcf9e2f408a860cfc5eddff30a0365a 100644 (file)
@@ -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