diff options
-rw-r--r-- | MANIFEST | 1 | ||||
-rw-r--r-- | Makefile.PL | 3 | ||||
-rw-r--r-- | gitacl.schema | 49 | ||||
-rwxr-xr-x | gitaclhook | 2 | ||||
-rw-r--r-- | lib/GitACL.pm | 8 |
5 files changed, 58 insertions, 5 deletions
@@ -6 +6,2 @@ 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 @@ -24,2 +24,5 @@ WriteMakefile( 'NAME' => 'gitaclhook', + 'ABSTRACT_FROM' => 'gitaclhook', + 'AUTHOR' => 'Sergey Poznyakoff <gray@gnu.org>', + 'LICENSE' => 'gpl', 'FIRST_MAKEFILE' => 'Makefile', 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 ) ) + @@ -338,3 +338,3 @@ unless ($ENV{GIT_DIR}) { $args{git_dir} = $ENV{GIT_DIR} = $ARGV[0]; - $args{user_name} = $ARGV[1]; + $args{user} = $ARGV[1]; $args{op} = $ARGV[2]; diff --git a/lib/GitACL.pm b/lib/GitACL.pm index 51024ac..57b38b8 100644 --- a/lib/GitACL.pm +++ b/lib/GitACL.pm @@ -42,3 +42,3 @@ sub logmsg($$$;$) { - open($fd, $self->logfile); + open($fd, $self->{logfile}); if ($loc) { @@ -56,3 +56,3 @@ sub 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); @@ -178,4 +178,4 @@ sub new { } - if ($obj->{logfile} && $obj->logfile !~ /[>|]/) { - $obj->{logfile} = ">>${obj->logfile}"; + if ($obj->{logfile} && $obj->{logfile} !~ /[>|]/) { + $obj->{logfile} = ">>$obj->{logfile}"; } |