From bb562d8077d0dac746c16e3826a5cf88eee59c9f Mon Sep 17 00:00:00 2001 From: Vilbrekin Date: Mon, 15 Dec 2014 01:58:16 +0100 Subject: [PATCH] Start tincd inside sub-shell to switch selinux context to "u:r:init_shell:s0". Fixes #26. --- src/org/poirsouille/tinc_gui/TincdService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/org/poirsouille/tinc_gui/TincdService.java b/src/org/poirsouille/tinc_gui/TincdService.java index 857cd6d..37633c2 100644 --- a/src/org/poirsouille/tinc_gui/TincdService.java +++ b/src/org/poirsouille/tinc_gui/TincdService.java @@ -207,7 +207,7 @@ public void run() // Register a broadcast receiver to get notified on network state change _broadcastReceiver.register(); // Use exec to replace shell with executable. umask is used to ensure pidfile will be world readable. - TincdService.this.run("umask 022; exec " + getFileStreamPath(TINCBIN) + " -D -d" + _debugLvl + " -c " + _configPath + " --pidfile=" + getFileStreamPath(PIDFILE), TincdService.this); + TincdService.this.run("sh -c'umask 022; id; exec " + getFileStreamPath(TINCBIN) + " -D -d" + _debugLvl + " -c " + _configPath + " --pidfile=" + getFileStreamPath(PIDFILE) + "'", TincdService.this); // Process returns only when ended _started = false; _broadcastReceiver.unregister();