diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2014-07-29 17:08:50 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2014-07-29 18:16:23 +0300 |
commit | d745c522f462e01aa576c6f93b94cbad6c631f73 (patch) | |
tree | 854738e411b0f993ecaea3d5d3fb05280a621642 /lib | |
parent | ba7a48a2b88b33c6c49511fd4422d255264fac98 (diff) | |
download | gitaclhook-d745c522f462e01aa576c6f93b94cbad6c631f73.tar.gz gitaclhook-d745c522f462e01aa576c6f93b94cbad6c631f73.tar.bz2 |
Change namespace for the configuration variables: hooks.acl.*
Diffstat (limited to 'lib')
-rw-r--r-- | lib/GitACL.pm | 14 | ||||
-rw-r--r-- | lib/GitACL/File.pm | 2 | ||||
-rw-r--r-- | lib/GitACL/LDAP.pm | 2 |
3 files changed, 9 insertions, 9 deletions
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($$) { | |||
73 | 73 | ||
74 | sub default_rule($) { | 74 | sub default_rule($) { |
75 | my $self = shift; | 75 | my $self = shift; |
76 | my $def = GitACL::git_value('config', 'hooks.acldefault'); | 76 | my $def = GitACL::git_value('config', 'hooks.acl.default'); |
77 | my $msg = "default rule"; | 77 | my $msg = "default rule"; |
78 | if (defined($def)) { | 78 | if (defined($def)) { |
79 | if ($def eq "allow") { | 79 | if ($def eq "allow") { |
@@ -110,7 +110,7 @@ sub git_value(@) { | |||
110 | 110 | ||
111 | sub match_primary_group($$) { | 111 | sub match_primary_group($$) { |
112 | my ($user_name,$group_name) = @_; | 112 | my ($user_name,$group_name) = @_; |
113 | my ($name,$passwd,$uid,$gid,$members) = getpwnam($user_name) or return 0; | 113 | my ($name,$passwd,$uid,$gid) = getpwnam($user_name) or return 0; |
114 | ($name) = getgrgid($gid) or return 0; | 114 | ($name) = getgrgid($gid) or return 0; |
115 | return 1 if $name eq $group_name; | 115 | return 1 if $name eq $group_name; |
116 | return 0; | 116 | return 0; |
@@ -190,14 +190,14 @@ sub new { | |||
190 | if (defined($args{debug})) { | 190 | if (defined($args{debug})) { |
191 | $obj->{debug} = $args{debug}; | 191 | $obj->{debug} = $args{debug}; |
192 | } else { | 192 | } else { |
193 | $obj->{debug} = git_value('config', '--bool', 'hooks.acldebug') || | 193 | $obj->{debug} = git_value('config', '--bool', 'hooks.acl.debug') || |
194 | $ENV{GIT_UPDATE_DEBUG} > 0; | 194 | $ENV{GIT_UPDATE_DEBUG} > 0; |
195 | } | 195 | } |
196 | 196 | ||
197 | if (defined($args{logfile})) { | 197 | if (defined($args{logfile})) { |
198 | $obj->{logfile} = $args{logfile}; | 198 | $obj->{logfile} = $args{logfile}; |
199 | } else { | 199 | } else { |
200 | $obj->{logfile} = git_value('config', 'hooks.acllog'); | 200 | $obj->{logfile} = git_value('config', 'hooks.acl.log'); |
201 | } | 201 | } |
202 | if ($obj->{logfile} && $obj->{logfile} !~ /[>|]/) { | 202 | if ($obj->{logfile} && $obj->{logfile} !~ /[>|]/) { |
203 | $obj->{logfile} = ">>$obj->{logfile}"; | 203 | $obj->{logfile} = ">>$obj->{logfile}"; |
@@ -206,7 +206,7 @@ sub new { | |||
206 | if (defined($args{quiet})) { | 206 | if (defined($args{quiet})) { |
207 | $obj->{quiet} = $args{quiet}; | 207 | $obj->{quiet} = $args{quiet}; |
208 | } elsif (!$obj->{debug}) { | 208 | } elsif (!$obj->{debug}) { |
209 | $obj->{quiet} = git_value('config', 'hooks.aclquiet'); | 209 | $obj->{quiet} = git_value('config', 'hooks.acl.quiet'); |
210 | } | 210 | } |
211 | 211 | ||
212 | if (defined($args{user})) { | 212 | if (defined($args{user})) { |
@@ -216,7 +216,7 @@ sub new { | |||
216 | $obj->{user_name} = $u; | 216 | $obj->{user_name} = $u; |
217 | } | 217 | } |
218 | $obj->deny("no such user") unless $obj->{user_name}; | 218 | $obj->deny("no such user") unless $obj->{user_name}; |
219 | my $httpdusr = git_value('config', 'hooks.httpd-user'); | 219 | my $httpdusr = git_value('config', 'hooks.acl.httpd-user'); |
220 | if (defined($httpdusr) and $obj->{user_name} eq $httpdusr) { | 220 | if (defined($httpdusr) and $obj->{user_name} eq $httpdusr) { |
221 | $obj->deny("need authenticated user") unless $ENV{AUTH_TYPE}; | 221 | $obj->deny("need authenticated user") unless $ENV{AUTH_TYPE}; |
222 | $obj->{user_name} = $ENV{REMOTE_USER}; | 222 | $obj->{user_name} = $ENV{REMOTE_USER}; |
@@ -261,7 +261,7 @@ sub check { | |||
261 | $self->info("$self->{user_name} requested $opstr{$self->{op}} ". | 261 | $self->info("$self->{user_name} requested $opstr{$self->{op}} ". |
262 | "on $self->{ref} in $self->{project_name}"); | 262 | "on $self->{ref} in $self->{project_name}"); |
263 | 263 | ||
264 | my $type = git_value('config', 'hooks.acltype'); | 264 | my $type = git_value('config', 'hooks.acl.type'); |
265 | $type = "File" unless $type; | 265 | $type = "File" unless $type; |
266 | 266 | ||
267 | my $r = eval("use GitACL::$type; GitACL::$type->new(\$self);"); | 267 | 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 { | |||
23 | my $line = 0; | 23 | my $line = 0; |
24 | my @ret; | 24 | my @ret; |
25 | 25 | ||
26 | my $filename = GitACL::git_value('config', 'hooks.aclfile'); | 26 | my $filename = GitACL::git_value('config', 'hooks.acl.file'); |
27 | $self->allow("no ACL configured for ".$self->{project_name}) | 27 | $self->allow("no ACL configured for ".$self->{project_name}) |
28 | unless defined($filename); | 28 | unless defined($filename); |
29 | 29 | ||
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; | |||
21 | 21 | ||
22 | sub parse_ldap_conf { | 22 | sub parse_ldap_conf { |
23 | my $self = shift; | 23 | my $self = shift; |
24 | my $filename = GitACL::git_value('config', 'hooks.aclldapconf') || | 24 | my $filename = GitACL::git_value('config', 'hooks.acl.ldapconf') || |
25 | "/etc/ldap.conf"; | 25 | "/etc/ldap.conf"; |
26 | 26 | ||
27 | my $fd; | 27 | my $fd; |