From f2582fa1b78e219188a9fce96fa4b29dc4c34915 Mon Sep 17 00:00:00 2001 From: "R. Steve McKown" Date: Thu, 27 Sep 2012 22:37:37 -0600 Subject: [PATCH] No need for sections in repo_shell.cfg --- README | 13 ++++++------- repo_shell.c | 9 ++++----- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/README b/README index b20c859..5226c0e 100644 --- a/README +++ b/README @@ -36,7 +36,6 @@ To install repo_shell: The /etc/repo_shell.cfg configuration file is straightforward: - [core] owner=repo git_root=/var/lib/git svn_root=/var/lib/svn/repositories @@ -85,9 +84,9 @@ svnserve.conf set a global authz.conf file, using the standard hooks and activating svnperms.conf for branch-based commit control. These are suggestions outside the scope of the repo_shell program itself. -Access controls for git repositories uses a feature built-into repo_shell. -The /etc/repo_shell.cfg file lists a core parameter git_acl_file, which -should be set to the name of the git acl file. A recommended name is -/var/lib/git/.gitacls, with permissions 0400. See git_acl.cfg.example for -information on the format of this file, which is similar in concept, but -different, than subversion's authz.conf file format. +Access controls for git repositories uses a feature built-into repo_shell. The +/etc/repo_shell.cfg file lists a parameter git_acl_file, which should be set to +the name of the git acl file. A recommended name is /var/lib/git/.gitacls, with +permissions 0400. See git_acl.cfg.example for information on the format of this +file, which is similar in concept, but different, than subversion's authz.conf +file format. diff --git a/repo_shell.c b/repo_shell.c index 24eb6e2..9d77559 100644 --- a/repo_shell.c +++ b/repo_shell.c @@ -153,14 +153,13 @@ static int ini_handler(void* user, const char* section, const char* name, { cfg_t* pconfig = (cfg_t*)user; - #define MATCH(s, n) strcmp(section, s) == 0 && strcmp(name, n) == 0 - if (MATCH("core", "svn_root")) + if (!strcmp(name, "svn_root")) pconfig->svn_root = xstrdup(value); - else if (MATCH("core", "git_root")) + else if (!strcmp(name, "git_root")) pconfig->git_root = xstrdup(value); - else if (MATCH("core", "owner")) + else if (!strcmp(name, "owner")) pconfig->owner = xstrdup(value); - else if (MATCH("core", "git_acl_file")) + else if (!strcmp(name, "git_acl_file")) pconfig->git_acl_file = xstrdup(value); else return 0; /* unknown section/name, error */ -- 2.39.2