Revert "allow setperms to override config file permissions"

This reverts commit 9612e3a4cc, since it
is no longer needed as of the rule sequencing changes we just made.

Conflicts:

	src/gl-compile-conf
This commit is contained in:
Sitaram Chamarty 2010-05-18 16:15:23 +05:30
parent 32056e0b7f
commit be3d00079a
2 changed files with 2 additions and 19 deletions

View file

@ -119,7 +119,6 @@ $GL_NO_DAEMON_NO_GITWEB = 0;
$GL_GITCONFIG_KEYS = "";
#
# The second choice is to give it a space separated list of settings you
# consider safe. (These are actually treated as a set of regular expression
# patterns, and any one of them must match). For example:
@ -190,20 +189,6 @@ $SVNSERVE = "";
$GL_WILDREPOS = 0;
# --------------------------------------
# ALLOW SETPERMS TO OVERRIDE gitolite.conf
# A user can be given permissions to use a "wildcard created" repo using the
# "setperms" command run by the creator. However, if that same user is also
# explicitly listed in the config file as having a specific permission, and if
# that permission is different from what was specified using `setperms`, there
# is a conflict.
# Default behaviour is to let the config file permissions override the
# "setperms" permissions, but if you want it the other way, set this to 1.
$GL_SETPERMS_OVERRIDES_CONFIG = 0;
# --------------------------------------
# HOOK CHAINING

View file

@ -52,7 +52,7 @@ $Data::Dumper::Sortkeys = 1;
open STDOUT, ">", "/dev/null" if (@ARGV and shift eq '-q');
# these are set by the "rc" file
our ($GL_ADMINDIR, $GL_CONF, $GL_KEYDIR, $GL_CONF_COMPILED, $REPO_BASE, $REPO_UMASK, $PROJECTS_LIST, $GIT_PATH, $GL_WILDREPOS, $GL_GITCONFIG_KEYS, $GL_PACKAGE_HOOKS, $GL_SETPERMS_OVERRIDES_CONFIG, $GL_BIG_CONFIG, $GL_NO_DAEMON_NO_GITWEB);
our ($GL_ADMINDIR, $GL_CONF, $GL_KEYDIR, $GL_CONF_COMPILED, $REPO_BASE, $REPO_UMASK, $PROJECTS_LIST, $GIT_PATH, $GL_WILDREPOS, $GL_GITCONFIG_KEYS, $GL_PACKAGE_HOOKS, $GL_BIG_CONFIG, $GL_NO_DAEMON_NO_GITWEB);
# and these are set by gitolite.pm
our ($REPONAME_PATT, $REPOPATT_PATT, $USERNAME_PATT, $AUTH_COMMAND, $AUTH_OPTIONS, $ABRT, $WARN);
@ -227,8 +227,6 @@ sub parse_conf_file
s/\bCREAT[EO]R\b/~\$creator/g for @users;
s/\bREADERS\b/\$readers/g for @users;
s/\bWRITERS\b/\$writers/g for @users;
# and double it up if $GL_SETPERMS_OVERRIDES_CONFIG
do { s/\$(creator|readers|writers)\b/~\$$1/g for @users } if $GL_SETPERMS_OVERRIDES_CONFIG;
# ok, we can finally populate the %repos hash
for my $repo (@repos) # each repo in the current stanza
@ -378,7 +376,7 @@ my $dumped_data = Data::Dumper->Dump([\%repos], [qw(*repos)]);
# the dump uses single quotes, but we convert any strings containing $creator,
# $readers, $writers, to double quoted strings. A wee bit sneaky, but not too
# much...
$dumped_data =~ s/'(?=[^']*\$(?:creator|readers|writers|gl_user))~*(.*?)'/"$1"/g;
$dumped_data =~ s/'(?=[^']*\$(?:creator|readers|writers|gl_user))~?(.*?)'/"$1"/g;
print $compiled_fh $dumped_data;
print $compiled_fh Data::Dumper->Dump([\%groups], [qw(*groups)]) if $GL_BIG_CONFIG and %groups;
close $compiled_fh or die "$ABRT close compiled-conf failed: $!\n";