From: R. Steve McKown Date: Fri, 28 Sep 2012 04:39:10 +0000 (-0600) Subject: Correctly exit on interactive shell request when not allowed X-Git-Tag: 0.4~2 X-Git-Url: https://oss.titaniummirror.com/gitweb?p=repo_shell.git;a=commitdiff_plain;h=0e5498d31186907cd4287d9bf84c05b8aa295f97 Correctly exit on interactive shell request when not allowed --- diff --git a/repo_shell.c b/repo_shell.c index 1361bf2..4d9f79b 100644 --- a/repo_shell.c +++ b/repo_shell.c @@ -191,10 +191,13 @@ int main(int argc, char **argv) return 0; } - if (argc == 1 && check_ssh_interactive(getuid())) { + if (argc == 1) { + if (!check_ssh_interactive(getuid())) + die("only repository access is allowed"); setuid(getuid()); argv[0] = SHELL; execvp(argv[0], (char *const *) argv); + return 1; } if (ini_parse(CFG_FILE, ini_handler, &cfg) < 0)