$ # on archlinux
$ sudo pacman -S gitolite
$ cp ~/.ssh/id_rsa.pub /tmp/admin.pub
$ sudo -u gitolite gitolite setup -pk /tmp/admin.pub
$ sudo wget -O /usr/lib/gitolite/commands/ukm https://raw.githubusercontent.com/sitaramc/gitolite/master/contrib/commands/ukm
$ sudo chmod +x /usr/lib/gitolite/commands/ukm
$ sudo -u gitolite vi ~gitolite/.gitolite.rc # -> add 'ukm', to ENABLE array
Verify it is enabled:
$ ssh gitolite@localhost help
Enter passphrase for key '/home/kousu/.ssh/id_rsa':
hello admin, this is gitolite@requiem running gitolite3 3.6.11 on git 2.27.0
list of remote commands available:
desc
help
info
perms
sskm
ukm
writable
But when I try to use it:
$ ssh gitolite@localhost ukm
Enter passphrase for key '/home/kousu/.ssh/id_rsa':
FATAL: Can't use global $_ in "my" at /usr/lib/gitolite/commands/ukm line 296, near "($_"
Execution of /usr/lib/gitolite/commands/ukm aborted due to compilation errors.
I'm using the perl given by ArchLinux:
$ pacman -Qi perl
Name : perl
Version : 5.32.0-1
Description : A highly capable, feature-rich programming language
Architecture : x86_64
URL : https://www.perl.org
Licenses : GPL PerlArtistic
Groups : None
Provides : [...]
Depends On : gdbm>=1.17 db glibc
Optional Deps : None
Required By : autoconf automake ghc-libs git gitolite gperftools groff hspell hyphen libwpg lm_sensors lxc netpbm ntp openssl
perl-common-sense perl-error perl-image-exiftool perl-json perl-json-xs perl-lchown perl-timedate perl-uri rlwrap
rsnapshot rsync strace texinfo valgrind
Optional For : aspell gd graphviz hexchat hunspell i3-wm insight-toolkit jemalloc libproxy qt5-base
Conflicts With : None
Replaces : None
Installed Size : 57.60 MiB
Packager : Florian Pritz <blue...@xinu.at>
Build Date : Sun 21 Jun 2020 05:19:43 AM
Install Date : Sun 28 Jun 2020 06:48:35 PM
Install Reason : Explicitly installed
Install Script : No
Validated By : Signature
From 81ccd2ae7adfc2ab6af37753d817200203d5137b Mon Sep 17 00:00:00 2001
From: Nick <ngue...@uwaterloo.ca>
Date: Thu, 30 Jul 2020 14:22:34 -0400
Subject: [PATCH] Update ukm for modern perl
with perl 5.32.0 trying to use ukm gives:
```
$ ssh gitolite@localhost ukm
Enter passphrase for key '/home/kousu/.ssh/id_rsa':
FATAL: Can't use global $_ in "my" at /usr/lib/gitolite/commands/ukm line 296, near "($_"
Execution of /usr/lib/gitolite/commands/ukm aborted due to compilation errors.
```
This fixes it
```
$ ssh gitolite@localhost ukm list
Enter passphrase for key '/home/kousu/.ssh/id_rsa':
Hello alice, you manage the following keys:
fingerprint userid keyid
SHA256:VxHhqhOq5GxpPPUrYMeFMly4Mdc3YlP40qkLX4gr5fI alice alice
```
---
contrib/commands/ukm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/contrib/commands/ukm b/contrib/commands/ukm
index 3683154b9..4bb4f3eb2 100755
--- a/contrib/commands/ukm
+++ b/contrib/commands/ukm
@@ -293,7 +293,7 @@ sub sanitize_pubkeypath {
# This function is only relavant for guest key managers.
# It returns true if the pattern is OK and false otherwise.
sub required_guest_keyid {
- my ($_) = @_;
+ local ($_) = @_;
/$required_guest_pattern/ and ! /$forbidden_guest_pattern/;
}
Also available at
https://patch-diff.githubusercontent.com/raw/sitaramc/gitolite/pull/86.patch
July 29, 2020 6:54 PM, "Ralf Hemmecke" <ra...@hemmecke.org> wrote:
> Hi Sitaram, hi Nick,
>
> On 7/29/20 5:31 PM, Sitaram Chamarty wrote:
>
>> I'm sure Ralf will reply by and by, but looking at the code, I'm
>> pretty sure all you have to do is replace "my" with "local".
>
> Thank you for telling me directly, sometimes I might miss a ukm related
> message.
>
> Honestly, I know a bit of Perl, but I am certainly not as fluent in it
> as you are. I am currently on holiday, so it might take a while until I
> can check whether my vs. local solves the issue.
>
> I'll definitely will look into it (if it isn't resolved before that).
> I would, however, first have to setup an environment with a newer
> version of perl to be able to reproduce the problem.
>
> Ralf