nsjail: save console just before we're prepared to run commands

This commit is contained in:
Robert Swiecki 2018-05-25 01:06:05 +02:00
parent 2470635c7c
commit 0b8e927aed

View File

@ -183,8 +183,6 @@ void nsjailSetTC(int fd, std::unique_ptr<struct termios>& trm) {
}
int main(int argc, char* argv[]) {
std::unique_ptr<struct termios> trm = nsjailGetTC(STDIN_FILENO);
std::unique_ptr<nsjconf_t> nsjconf = cmdline::parseArgs(argc, argv);
if (!nsjconf) {
LOG_F("Couldn't parse cmdline options");
@ -206,6 +204,8 @@ int main(int argc, char* argv[]) {
LOG_F("Couldn't prepare sandboxing policy");
}
std::unique_ptr<struct termios> trm = nsjailGetTC(STDIN_FILENO);
int ret = 0;
if (nsjconf->mode == MODE_LISTEN_TCP) {
nsjailListenMode(nsjconf.get());