From 63c9a7bb616f65a939cde6031b71e7d494b3f626 Mon Sep 17 00:00:00 2001 From: "Kyle J. McKay" Date: Sat, 6 Jul 2013 17:55:04 -0700 Subject: [PATCH] Restore https mob push access The mob user certificate does not have a UUID dnQualifier nor does it need one. If mob is enabled, do not attempt to verify the mob certificate's dnQualifier. Also make sure the computed authuuid variable ends up empty if there is no dnQualifier. --- bin/git-http-backend-verify | 4 +++- hooks/update | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/bin/git-http-backend-verify b/bin/git-http-backend-verify index c27d9cd..a7d43e3 100755 --- a/bin/git-http-backend-verify +++ b/bin/git-http-backend-verify @@ -131,7 +131,8 @@ fi authuser="${REMOTE_USER#/UID=}" authuuid="${authuser}" authuser="${authuser%/dnQualifier=*}" -authuuid="${authuuid#$authuser/dnQualifier=}" +authuuid="${authuuid#$authuser}" +authuuid="${authuuid#/dnQualifier=}" if [ -z "$authuser" ]; then needsauth "Only authenticated users may push, sorry" exit 1 @@ -140,6 +141,7 @@ fi if perl -I@basedir@ -MGirocco::Project -MGirocco::User <load('$projbare'); exit 1 unless \$p && \$p->can_user_push('$authuser'); + exit 0 if \$Girocco::Config::mob eq 'mob' && '$authuser' eq 'mob'; my \$u = Girocco::User->load('$authuser'); exit 2 unless \$u && \$u->{uuid} eq '$authuuid'; exit 0 diff --git a/hooks/update b/hooks/update index b11c1ca..3b79095 100755 --- a/hooks/update +++ b/hooks/update @@ -71,7 +71,8 @@ if [ -n "$GIT_PROJECT_ROOT" ]; then authuser="${REMOTE_USER#/UID=}" authuuid="${authuser}" authuser="${authuser%/dnQualifier=*}" - authuuid="${authuuid#$authuser/dnQualifier=}" + authuuid="${authuuid#$authuser}" + authuuid="${authuuid#/dnQualifier=}" if [ -z "$authuser" ]; then echo "Only authenticated users may push, sorry" >&2 exit 3 @@ -80,6 +81,7 @@ if [ -n "$GIT_PROJECT_ROOT" ]; then if perl -I@basedir@ -MGirocco::Project -MGirocco::User <load('$projbare'); exit 1 unless \$p && \$p->can_user_push('$authuser'); + exit 0 if \$Girocco::Config::mob eq 'mob' && '$authuser' eq 'mob'; my \$u = Girocco::User->load('$authuser'); exit 2 unless \$u && \$u->{uuid} eq '$authuuid'; exit 0 -- 2.11.4.GIT