From: Greg Brockman Date: Sun, 22 Aug 2010 06:00:22 GMT Subject: Re: [PATCH] shell: Rewrite documentation and improve error message Message-ID: In-Reply-To: <1282333452-25278-1-git-send-email-artagnon@gmail.com> 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 non-interactively; > + 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.