Unfortunately, not directly. What we do with our gitolite server is use
the following wrapper around the gitolite hooks to establish the user from
the gitolite perspective:
#!/usr/bin/perl -w
#
# gitolite-wrapper - wrapper file to hand gitolite a kerberos user
#
# Written by Jon Robertson <
jonr...@stanford.edu>
# Copyright 2011 Board of Trustees, Leland Stanford Jr. University
use strict;
sub get_principal {
my $klist = `/usr/bin/klist`;
my $principal = '';
foreach my $line (split (/[\r\n]+/, $klist)) {
if ($line =~ /^Default principal: (.+)\@stanford\.edu$/) {
$principal = $1;
$principal =~ tr%/%_%;
}
}
return $principal;
}
my $principal = get_principal;
die "$0: could not find principal name\n" unless $principal;
exec ('/usr/share/gitolite/gl-auth-command', $principal);
This doesn't really help with a regular account, though, and it requires
that you forward tickets, and is in general somewhat unsatisfactory.
I wonder if it would be worth adding an option to the pam-krb5 session
module to set an environment variable containing the authenticated
principal used to access the account.
--
Russ Allbery (
r...@stanford.edu) <
http://www.eyrie.org/~eagle/>