From d745c522f462e01aa576c6f93b94cbad6c631f73 Mon Sep 17 00:00:00 2001 From: Sergey Poznyakoff Date: Tue, 29 Jul 2014 17:08:50 +0300 Subject: Change namespace for the configuration variables: hooks.acl.* --- lib/GitACL.pm | 14 +++++++------- lib/GitACL/File.pm | 2 +- lib/GitACL/LDAP.pm | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) (limited to 'lib') diff --git a/lib/GitACL.pm b/lib/GitACL.pm index 9cd381d..cde9624 100644 --- a/lib/GitACL.pm +++ b/lib/GitACL.pm @@ -73,7 +73,7 @@ sub allow($$) { sub default_rule($) { my $self = shift; - my $def = GitACL::git_value('config', 'hooks.acldefault'); + my $def = GitACL::git_value('config', 'hooks.acl.default'); my $msg = "default rule"; if (defined($def)) { if ($def eq "allow") { @@ -110,7 +110,7 @@ sub git_value(@) { sub match_primary_group($$) { my ($user_name,$group_name) = @_; - my ($name,$passwd,$uid,$gid,$members) = getpwnam($user_name) or return 0; + my ($name,$passwd,$uid,$gid) = getpwnam($user_name) or return 0; ($name) = getgrgid($gid) or return 0; return 1 if $name eq $group_name; return 0; @@ -190,14 +190,14 @@ sub new { if (defined($args{debug})) { $obj->{debug} = $args{debug}; } else { - $obj->{debug} = git_value('config', '--bool', 'hooks.acldebug') || + $obj->{debug} = git_value('config', '--bool', 'hooks.acl.debug') || $ENV{GIT_UPDATE_DEBUG} > 0; } if (defined($args{logfile})) { $obj->{logfile} = $args{logfile}; } else { - $obj->{logfile} = git_value('config', 'hooks.acllog'); + $obj->{logfile} = git_value('config', 'hooks.acl.log'); } if ($obj->{logfile} && $obj->{logfile} !~ /[>|]/) { $obj->{logfile} = ">>$obj->{logfile}"; @@ -206,7 +206,7 @@ sub new { if (defined($args{quiet})) { $obj->{quiet} = $args{quiet}; } elsif (!$obj->{debug}) { - $obj->{quiet} = git_value('config', 'hooks.aclquiet'); + $obj->{quiet} = git_value('config', 'hooks.acl.quiet'); } if (defined($args{user})) { @@ -216,7 +216,7 @@ sub new { $obj->{user_name} = $u; } $obj->deny("no such user") unless $obj->{user_name}; - my $httpdusr = git_value('config', 'hooks.httpd-user'); + my $httpdusr = git_value('config', 'hooks.acl.httpd-user'); if (defined($httpdusr) and $obj->{user_name} eq $httpdusr) { $obj->deny("need authenticated user") unless $ENV{AUTH_TYPE}; $obj->{user_name} = $ENV{REMOTE_USER}; @@ -261,7 +261,7 @@ sub check { $self->info("$self->{user_name} requested $opstr{$self->{op}} ". "on $self->{ref} in $self->{project_name}"); - my $type = git_value('config', 'hooks.acltype'); + my $type = git_value('config', 'hooks.acl.type'); $type = "File" unless $type; my $r = eval("use GitACL::$type; GitACL::$type->new(\$self);"); diff --git a/lib/GitACL/File.pm b/lib/GitACL/File.pm index efabfd4..f72c16d 100644 --- a/lib/GitACL/File.pm +++ b/lib/GitACL/File.pm @@ -23,7 +23,7 @@ sub check_acl { my $line = 0; my @ret; - my $filename = GitACL::git_value('config', 'hooks.aclfile'); + my $filename = GitACL::git_value('config', 'hooks.acl.file'); $self->allow("no ACL configured for ".$self->{project_name}) unless defined($filename); diff --git a/lib/GitACL/LDAP.pm b/lib/GitACL/LDAP.pm index 22bfd8d..ac8fd06 100644 --- a/lib/GitACL/LDAP.pm +++ b/lib/GitACL/LDAP.pm @@ -21,7 +21,7 @@ use Net::LDAP; sub parse_ldap_conf { my $self = shift; - my $filename = GitACL::git_value('config', 'hooks.aclldapconf') || + my $filename = GitACL::git_value('config', 'hooks.acl.ldapconf') || "/etc/ldap.conf"; my $fd; -- cgit v1.2.1