char *owner;
} cfg_t;
+static const char* shell_argv[] = { "/bin/bash", NULL };
+
#undef USE_DEFAULTS
#ifdef USE_DEFAULTS /* perhaps we want defaults? Not sure */
static cfg_t cfg {
!strcmp(argv[1], "--version"))) {
fprintf(stderr, "%s\n", version);
return 0;
+ }
+
+ if (argc == 1 && check_ssh_interactive(getuid())) {
+ setuid(getuid());
+ execvp(shell_argv[0], (char *const *) shell_argv);
}
- if (argc < 3)
- die("invalid arguments");
#ifdef USE_DEFAULTS
ini_parse("repo_shell.cfg", handler, &cfg);
if (!check_ssh_interactive(getuid()))
die("only repository access is allowed");
+ setuid(getuid());
cd_to_homedir();
count = split_cmdline(prog, &user_argv);
if (count >= 0) {