configs/bash: add noexec/nodev/nosuid to a mount
authorRobert Swiecki <robert@swiecki.net>
Fri, 27 Jul 2018 20:54:28 +0000 (22:54 +0200)
committerRobert Swiecki <robert@swiecki.net>
Fri, 27 Jul 2018 20:54:28 +0000 (22:54 +0200)
configs/bash-with-fake-geteuid.cfg
subproc.cc

index 4743619..660cb4d 100644 (file)
@@ -121,6 +121,9 @@ mount {
        fstype: "tmpfs"
        rw: true
        is_bind: false
+       noexec: true
+       nodev: true
+       nosuid: true
 }
 
 mount {
index 1502026..339b5bf 100644 (file)
@@ -301,18 +301,15 @@ static int reapProc(nsjconf_t* nsjconf, pid_t pid, bool should_wait = false) {
                }
 
                if (WIFEXITED(status)) {
-                       LOG_I("PID: %d (%s) exited with status: %d, (PIDs left: %d)",
-                           pid, remote_txt.c_str(), WEXITSTATUS(status),
-                           countProc(nsjconf) - 1);
+                       LOG_I("PID: %d (%s) exited with status: %d, (PIDs left: %d)", pid,
+                           remote_txt.c_str(), WEXITSTATUS(status), countProc(nsjconf) - 1);
                        removeProc(nsjconf, pid);
                        return WEXITSTATUS(status);
                }
                if (WIFSIGNALED(status)) {
-                       LOG_I(
-                           "PID: %d (%s) terminated with signal: %s (%d), (PIDs left: %d)",
-                           pid, remote_txt.c_str(),
-                           util::sigName(WTERMSIG(status)).c_str(), WTERMSIG(status),
-                           countProc(nsjconf) - 1);
+                       LOG_I("PID: %d (%s) terminated with signal: %s (%d), (PIDs left: %d)", pid,
+                           remote_txt.c_str(), util::sigName(WTERMSIG(status)).c_str(),
+                           WTERMSIG(status), countProc(nsjconf) - 1);
                        removeProc(nsjconf, pid);
                        return 128 + WTERMSIG(status);
                }