Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(115)

Unified Diff: remoting/tools/me2me_virtual_host.py

Issue 11715003: Improve xsession execution (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Run xsession using /bin/sh -c Created 7 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/tools/me2me_virtual_host.py
diff --git a/remoting/tools/me2me_virtual_host.py b/remoting/tools/me2me_virtual_host.py
index eda56485241f35cd9d8ddc310a0f40da2423b34e..86d68205bac8aa96b2345c2faafc3f562ea61614 100755
--- a/remoting/tools/me2me_virtual_host.py
+++ b/remoting/tools/me2me_virtual_host.py
@@ -17,6 +17,7 @@ import json
import logging
import optparse
import os
+import pipes
import signal
import socket
import subprocess
@@ -349,7 +350,7 @@ class Desktop:
devnull.close()
def _launch_x_session(self):
- # Start desktop session
+ # Start desktop session.
# The /dev/null input redirection is necessary to prevent the X session
# reading from stdin. If this code runs as a shell background job in a
# terminal, any reading from stdin causes the job to be suspended.
@@ -498,7 +499,10 @@ def choose_x_session():
# (see /etc/X11/Xsession.d/50x11-common_determine-startup), to determine
# exactly how to run this file.
if os.access(startup_file, os.X_OK):
- return startup_file
+ # "/bin/sh -c" is smart about how to execute the session script and
+ # works in cases where plain exec() fails (for example, if the file is
+ # marked executable, but is a plain script with no shebang line).
+ return ["/bin/sh", "-c", pipes.quote(startup_file)]
else:
shell = os.environ.get("SHELL", "sh")
return [shell, startup_file]
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698