From 0e5498d31186907cd4287d9bf84c05b8aa295f97 Mon Sep 17 00:00:00 2001 From: "R. Steve McKown" Date: Thu, 27 Sep 2012 22:39:10 -0600 Subject: [PATCH] Correctly exit on interactive shell request when not allowed --- repo_shell.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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) -- 2.39.2