aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--MANIFEST1
-rw-r--r--Makefile.PL3
-rw-r--r--gitacl.schema49
-rwxr-xr-xgitaclhook2
-rw-r--r--lib/GitACL.pm8
5 files changed, 58 insertions, 5 deletions
diff --git a/MANIFEST b/MANIFEST
index c89e6ca..be26d52 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -4,3 +4,4 @@ gitaclhook
lib/GitACL.pm
lib/GitACL/File.pm
lib/GitACL/LDAP.pm
+gitacl.schema
diff --git a/Makefile.PL b/Makefile.PL
index 0d5e8b3..db3859d 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -22,6 +22,9 @@ my %pm = ('lib/GitACL.pm' => '$(INST_LIBDIR)/GitACL.pm',
WriteMakefile(
'NAME' => 'gitaclhook',
+ 'ABSTRACT_FROM' => 'gitaclhook',
+ 'AUTHOR' => 'Sergey Poznyakoff <gray@gnu.org>',
+ 'LICENSE' => 'gpl',
'FIRST_MAKEFILE' => 'Makefile',
'VERSION' => '1.00',
'PM' => \%pm,
diff --git a/gitacl.schema b/gitacl.schema
new file mode 100644
index 0000000..d8083e5
--- /dev/null
+++ b/gitacl.schema
@@ -0,0 +1,49 @@
+# Git LDAP schema items
+#
+# depends upon:
+# nis.schema
+
+attributetype ( 1.3.6.1.4.1.9163.2.3.1.0 NAME 'gitAclProject'
+ DESC 'Project for which the ACL entry is defined'
+ EQUALITY caseExactMatch
+ SUBSTR caseExactSubstringsMatch
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{256}
+ SINGLE-VALUE )
+
+attributetype ( 1.3.6.1.4.1.9163.2.3.1.1 NAME 'gitAclVerb'
+ DESC 'ACL verb'
+ EQUALITY caseExactMatch
+ SUBSTR caseExactSubstringsMatch
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{256}
+ SINGLE-VALUE )
+
+attributetype ( 1.3.6.1.4.1.9163.2.3.1.2 NAME 'gitAclOp'
+ DESC 'ACL opcode: any combination of C, D, U or R'
+ EQUALITY caseExactMatch
+ SUBSTR caseExactSubstringsMatch
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{256} )
+
+attributetype ( 1.3.6.1.4.1.9163.2.3.1.3 NAME 'gitAclRef'
+ DESC 'Git ref'
+ EQUALITY caseExactMatch
+ SUBSTR caseExactSubstringsMatch
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{256} )
+
+attributetype ( 1.3.6.1.4.1.9163.2.3.1.4 NAME 'gitAclOrder'
+ DESC 'an integer to order ACL entries'
+ EQUALITY integerMatch
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.27
+ SINGLE-VALUE )
+
+attributetype ( 1.3.6.1.4.1.9163.2.3.1.5 NAME 'gitAclUser'
+ DESC 'Git username'
+ EQUALITY caseExactMatch
+ SUBSTR caseExactSubstringsMatch
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{256} )
+
+objectclass ( 1.3.6.1.4.1.9163.2.3.2.0 NAME 'gitACL'
+ DESC 'Git Access Control List Entry'
+ SUP top STRUCTURAL
+ MUST ( cn $ gitAclProject $ gitAclVerb )
+ MAY ( gitAclUser $ gitAclOp $ gitAclRef $ gitAclOrder $ description ) )
+
diff --git a/gitaclhook b/gitaclhook
index 61b6d0f..5d0d79b 100755
--- a/gitaclhook
+++ b/gitaclhook
@@ -336,7 +336,7 @@ unless ($ENV{GIT_DIR}) {
if ($test) {
abend("--test requires four arguments") unless ($#ARGV == 3);
$args{git_dir} = $ENV{GIT_DIR} = $ARGV[0];
- $args{user_name} = $ARGV[1];
+ $args{user} = $ARGV[1];
$args{op} = $ARGV[2];
$args{ref} = $ARGV[3];
$args{old} = '0000000000000000000000000000000000000000';
diff --git a/lib/GitACL.pm b/lib/GitACL.pm
index 51024ac..57b38b8 100644
--- a/lib/GitACL.pm
+++ b/lib/GitACL.pm
@@ -40,7 +40,7 @@ sub logmsg($$$;$) {
my $loc = shift;
my $fd;
- open($fd, $self->logfile);
+ open($fd, $self->{logfile});
if ($loc) {
print $fd "$status:$loc: $message\n";
} else {
@@ -54,7 +54,7 @@ sub deny($$;$) {
$self->logmsg("DENY",
"$self->{project_name}:$self->{user_name}:".
- "opstr{$self->{op}}:$self->{ref}:$self->{old}:$self->{new}: $msg",
+ "$opstr{$self->{op}}:$self->{ref}:$self->{old}:$self->{new}: $msg",
$loc);
$self->debug(1, "denied by $loc") if $loc;
@@ -176,8 +176,8 @@ sub new {
} else {
$obj->{logfile} = git_value('config', 'hooks.acllog');
}
- if ($obj->{logfile} && $obj->logfile !~ /[>|]/) {
- $obj->{logfile} = ">>${obj->logfile}";
+ if ($obj->{logfile} && $obj->{logfile} !~ /[>|]/) {
+ $obj->{logfile} = ">>$obj->{logfile}";
}
if (defined($args{quiet})) {

Return to:

Send suggestions and report system problems to the System administrator.