Re: [RFC/PATCH] shell: allow 'help' command to disable interactive shell
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 11, 2013, 03:44 UTC
- Message-ID
- <7v7gmfqzt1.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <20130211012016.GA13243@elie.Belkin>
Jonathan Nieder <jrnieder@gmail.com> writes:
> How about this? > > A patch on top could change the default "git-shell-commands is not > present" message if that seems worthwhile.
Hmph.
I wonder if rewording the message when git-shell-commmands directory is not there may be a better first step (which actually could be the last step)?
That is, showing something like this,
> +printf '%s\n' "Hi $USER! You've successfully authenticated, but I do not" > +printf '%s\n' "provide interactive shell access."
but rephrased with a reference to "git help shell" for people preparing their own server when ~/git-shell-commands/ in good order?
Something like
diff --git a/shell.c b/shell.c index 84b237f..71ff04f 100644 --- a/shell.c +++ b/shell.c @@ -162,9 +162,11 @@ int main(int argc, char **argv) /* Allow the user to run an interactive shell */ cd_to_homedir(); if (access(COMMAND_DIR, R_OK | X_OK) == -1) { - die("Interactive git shell is not enabled.\n" + die("The user has been recognized as '%s' but " + "interactive git shell is not enabled.\n" "hint: ~/" COMMAND_DIR " should exist " - "and have read and execute access."); + "and have read and execute access.", + get_user_name()); } run_shell(); exit(0);