Re: [PATCH] shell: Rewrite documentation and improve error message

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Warning: the following email contains lots of nitpicks.  Proceed at
your own risk.

> +A login shell for SSH accounts to provide restricted Git access. When
> +'-c' is given, the program executes <command> non-interactively;
> +<command> can be one of 'git receive-pack', 'git upload-pack', 'git
> +upload-archive', 'cvs server', or a command in COMMAND_DIR. The shell
> +is started in interactive mode when no arguments are given; in this
> +case, COMMAND_DIR must exist, and any of the executables in them can
s/in them/in it/

> +COMMAND_DIR is the path 'git-shell-commands' in the user's home
> +directory. The user must have read and execute permissions to the
- Maybe instead 'COMMAND_DIR is the path "$HOME/git-shell-commands"'?
> +directory for it to be useful.
- I would be more specific here, and instead change this insertion to
something like: "directory in order to execute commands in it."
- What about adding something like 'Commands in COMMAND_DIR are run
with a cwd of $HOME'
- Perhaps note that if a COMMAND_DIR program is invoked, 'argument' is
parsed as a command-line?

>
>  Author
>  ------
> diff --git a/shell.c b/shell.c
> index ffed615..3fb804e 100644
> --- a/shell.c
> +++ b/shell.c
> @@ -152,8 +152,11 @@ int main(int argc, char **argv)
>        } else if (argc == 1) {
>                /* Allow the user to run an interactive shell */
>                cd_to_homedir();
> -               if (access(COMMAND_DIR, R_OK | X_OK) == -1)
> -                       die("Sorry, the interactive git-shell is not enabled");
> +               if (access(COMMAND_DIR, R_OK | X_OK) == -1) {
> +                       die("Inteactive git shell is not enabled.\n"
s/Inteactive/Interactive/

> +                           "hint: " COMMAND_DIR " should exist "
I would recommend displaying ~/$COMMAND_DIR instead, or
$HOME/COMMAND_DIR.  The latter could be considered an information leak
though.

> +                           "and have read and execute access.");

Sounds fine to me otherwise.  Thanks for starting on this.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]