]> oss.titaniummirror.com Git - repo_shell.git/commitdiff
Correctly exit on interactive shell request when not allowed
authorR. Steve McKown <rsmckown@gmail.com>
Fri, 28 Sep 2012 04:39:10 +0000 (22:39 -0600)
committerR. Steve McKown <rsmckown@gmail.com>
Fri, 28 Sep 2012 04:43:45 +0000 (22:43 -0600)
repo_shell.c

index 1361bf2e84e85960e3c44ac9ad095cb1394044dd..4d9f79b8325fa0626efbaccafe0214fdb9379ff0 100644 (file)
@@ -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)