log message changes (warning: minor backward compat breakage)
The log message format has changed. All log messages now have a common prefix (timestamp, user, IP). This is followed by $SSH_ORIGINAL_COMMAND (or, in one special case, the name of the user's login shell). Any further text appears after this (currently this only happens in the case of a successful push -- one for each ref pushed successfully)
This commit is contained in:
parent
1ecc7ae74e
commit
0f5f82e4f5
5 changed files with 22 additions and 11 deletions
|
@ -102,7 +102,7 @@ unless ($ENV{SSH_ORIGINAL_COMMAND}) {
|
|||
if ($shell_allowed) {
|
||||
my $shell = $ENV{SHELL};
|
||||
$shell =~ s/.*\//-/; # change "/bin/bash" to "-bash"
|
||||
&log_it("$ENV{GL_TS}\t$shell\t$user\n");
|
||||
&log_it($shell);
|
||||
exec { $ENV{SHELL} } $shell;
|
||||
}
|
||||
# otherwise, pretend he typed in "info" and carry on...
|
||||
|
@ -119,7 +119,7 @@ if ($GL_ADC_PATH and -d $GL_ADC_PATH) {
|
|||
if (-x "$GL_ADC_PATH/$cmd") {
|
||||
# yes this is rather strict, sorry.
|
||||
do { die "I don't like $_\n" unless $_ =~ $REPOPATT_PATT } for ($cmd, @args);
|
||||
&log_it("$ENV{GL_TS}\t$GL_ADC_PATH/$ENV{SSH_ORIGINAL_COMMAND}\t$ENV{GL_USER}\n");
|
||||
&log_it("$GL_ADC_PATH/$ENV{SSH_ORIGINAL_COMMAND}");
|
||||
exec("$GL_ADC_PATH/$cmd", @args);
|
||||
}
|
||||
}
|
||||
|
@ -208,7 +208,7 @@ die "$aa access for $repo DENIED to $user\n" unless $perm =~ /$aa/;
|
|||
# over to git now
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
&log_it("$ENV{GL_TS}\t$ENV{SSH_ORIGINAL_COMMAND}\t$ENV{GL_USER}\n");
|
||||
&log_it();
|
||||
|
||||
$repo = "'$REPO_BASE/$repo.git'";
|
||||
exec("git", "shell", "-c", "$verb $repo") unless $verb eq 'git-init';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue