X-Git-Url: https://git.distorted.org.uk/~mdw/userv-utils/blobdiff_plain/5f3e811b5415dcff74f82bdd2f26d3af1f73c555..3fc5563cc0f31659d09a6cdfd0fd1c7fdb6ed85d:/git-daemon/git-daemon-service.pl diff --git a/git-daemon/git-daemon-service.pl b/git-daemon/git-daemon-service.pl deleted file mode 100755 index f848db8..0000000 --- a/git-daemon/git-daemon-service.pl +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/perl -# -# userv-git-daemon service script -# -# This was written by Tony Finch -# You may do anything with it, at your own risk. -# http://creativecommons.org/publicdomain/zero/1.0/ - -use strict; -use warnings; - -use Sys::Syslog; - -${$::{$_}} = $ENV{"USERV_U_$_"} - for grep s|^USERV_U_([a-z_]+)$|$1|, keys %ENV; - -our ($client,$service,$path,$host); - -openlog "userv-$service", 'pid', 'daemon'; -sub fail { syslog 'err', "$client @_"; exit } - -our ($check_repo,$check_export,$dir,$repo) = (1,0); -our $uri = $_ = "git://$host/$path"; -for my $cf (@ARGV) { do $cf } - -my $home = (getpwuid $<)[7]; -$dir = "$home/$dir" if $dir =~ m|^[^/]| - or $dir =~ s|^~/||; -fail "Bad filename $repo" if $check_repo - and $repo !~ m|^\w[\w.=+-]*\.git$|; -$dir = "$dir/$repo" if defined $repo; -$path = $check_export ? "$dir/git-daemon-export-ok" : $dir; -fail "$! $path" unless -e $path; -syslog 'notice', "$client $dir"; - -my @cmd = ($service, '--strict', '--timeout=30', $dir); -no warnings; # suppress errors to stderr -exec @cmd or fail "exec $service: $!"; - -# end