X-Git-Url: https://oss.titaniummirror.com/gitweb?a=blobdiff_plain;f=repo_shell.c;h=ecce7d3aebc8229f6bbee4e3cfe3ed7bc0ead514;hb=961cb65d693c36d7811b15a2023a35b9c5413044;hp=1b06ec3eefbee2c2c49968db9ef61fc5f05af5f7;hpb=8684056349dcadb86b2bf47a5538df90022ab094;p=repo_shell.git diff --git a/repo_shell.c b/repo_shell.c index 1b06ec3..ecce7d3 100644 --- a/repo_shell.c +++ b/repo_shell.c @@ -348,8 +348,10 @@ int main(int argc, char **argv) return 0; } - if (argc == 1 && check_ssh_interactive(getuid())) + if (argc == 1 && check_ssh_interactive(getuid())) { + setuid(getuid()); execvp(shell_argv[0], (char *const *) shell_argv); + } #ifdef USE_DEFAULTS ini_parse("repo_shell.cfg", handler, &cfg); @@ -388,6 +390,7 @@ int main(int argc, char **argv) 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) {