Alon Bar-Lev has uploaded a new change for review.

Change subject: packaging: engine-service: leave valid fd at stdin
......................................................................

packaging: engine-service: leave valid fd at stdin

Change-Id: Ib029542a45f7fa6e486ae3876b20d18c56374228
Signed-off-by: Alon Bar-Lev <alo...@redhat.com>
---
M packaging/fedora/engine-service.py.in
1 file changed, 6 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/17/13417/1

diff --git a/packaging/fedora/engine-service.py.in 
b/packaging/fedora/engine-service.py.in
index 8f1170d..163c4e9 100644
--- a/packaging/fedora/engine-service.py.in
+++ b/packaging/fedora/engine-service.py.in
@@ -568,8 +568,7 @@
     if engineUid != os.getuid():
         os.setuid(engineUid)
 
-    # Then close standard input and some other security measures:
-    os.close(0)
+    # free cwd
     os.chdir("/")
 
     # setsid fails if already group leader
@@ -578,6 +577,11 @@
     except OSError:
         pass
 
+    # redirect stdin to /dev/null
+    null = os.open(os.devnull, os.O_RDONLY)
+    os.dup2(null, 0)
+    os.close(null)
+
     # Then open the console log and redirect standard output and errors to it:
     engineConsoleFd = os.open(engineConsoleLogFile, os.O_CREAT | os.O_WRONLY | 
os.O_APPEND, 0660)
     os.dup2(engineConsoleFd, 1)


--
To view, visit http://gerrit.ovirt.org/13417
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib029542a45f7fa6e486ae3876b20d18c56374228
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Alon Bar-Lev <alo...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to