diff options
author | lambroslambrou@chromium.org <lambroslambrou@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-27 19:56:17 +0000 |
---|---|---|
committer | lambroslambrou@chromium.org <lambroslambrou@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-27 19:56:17 +0000 |
commit | 5f061c2ccd015d5c62b0d95021383e53b47e04c5 (patch) | |
tree | 403c67450fb057ca49ef06408f6518093cbf5f26 /remoting/tools | |
parent | cde16868cb777d94b760d8a3e7b1fc4c4db4fa38 (diff) | |
download | chromium_src-5f061c2ccd015d5c62b0d95021383e53b47e04c5.zip chromium_src-5f061c2ccd015d5c62b0d95021383e53b47e04c5.tar.gz chromium_src-5f061c2ccd015d5c62b0d95021383e53b47e04c5.tar.bz2 |
Don't set XAUTHORITY in Virtual Me2Me parent process
Instead, pass the Xauthority filename directly to "xauth add" using
the -f option. Problem was that setting XAUTHORITY to a non-existent file
broke "gksudo" when the Me2Me script was run with "--add-user".
BUG=166948
TEST=Try to setup and start a Chromoting host on an account where ~/.Xauthority is not present.
NOTRY=true
Review URL: https://chromiumcodereview.appspot.com/11642057
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@174692 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/tools')
-rwxr-xr-x | remoting/tools/me2me_virtual_host.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/remoting/tools/me2me_virtual_host.py b/remoting/tools/me2me_virtual_host.py index c1e488c..eda5648 100755 --- a/remoting/tools/me2me_virtual_host.py +++ b/remoting/tools/me2me_virtual_host.py @@ -61,9 +61,6 @@ HOME_DIR = os.environ["HOME"] X_LOCK_FILE_TEMPLATE = "/tmp/.X%d-lock" FIRST_X_DISPLAY_NUMBER = 20 -X_AUTH_FILE = os.path.expanduser("~/.Xauthority") -os.environ["XAUTHORITY"] = X_AUTH_FILE - # Minimum amount of time to wait between relaunching processes. BACKOFF_TIME = 60 @@ -260,10 +257,15 @@ class Desktop: return True def _launch_x_server(self, extra_x_args): + x_auth_file = os.path.expanduser("~/.Xauthority") + self.child_env["XAUTHORITY"] = x_auth_file devnull = open(os.devnull, "rw") display = self.get_unused_display_number() + + # Run "xauth add" with |child_env| so that it modifies the same XAUTHORITY + # file which will be used for the X session. ret_code = subprocess.call("xauth add :%d . `mcookie`" % display, - shell=True) + env=self.child_env, shell=True) if ret_code != 0: raise Exception("xauth failed with code %d" % ret_code) @@ -286,7 +288,7 @@ class Desktop: screen_option = "%dx%dx24" % (max_width, max_height) self.x_proc = subprocess.Popen([xvfb, ":%d" % display, "-noreset", - "-auth", X_AUTH_FILE, + "-auth", x_auth_file, "-nolisten", "tcp", "-screen", "0", screen_option ] + extra_x_args) |