Index: remoting/tools/me2me_virtual_host.py |
diff --git a/remoting/tools/me2me_virtual_host.py b/remoting/tools/me2me_virtual_host.py |
index c1eaa99b7cb9a59de5b2b79660e60c7014f5e7dd..ad322d4f1b1d417e145cd45977068fc676ad0b09 100755 |
--- a/remoting/tools/me2me_virtual_host.py |
+++ b/remoting/tools/me2me_virtual_host.py |
@@ -192,6 +192,7 @@ class Desktop: |
self.pulseaudio_pipe = None |
self.server_supports_exact_resize = False |
self.host_ready = False |
+ self.ssh_auth_sockname = None |
g_desktops.append(self) |
@staticmethod |
@@ -292,6 +293,10 @@ class Desktop: |
return True |
+ def _setup_gnubby(self): |
+ self.ssh_auth_sockname = ("/tmp/chromoting.%s.ssh_auth_sock" % |
+ os.environ["USER"]) |
+ |
def _launch_x_server(self, extra_x_args): |
x_auth_file = os.path.expanduser("~/.Xauthority") |
self.child_env["XAUTHORITY"] = x_auth_file |
@@ -349,6 +354,10 @@ class Desktop: |
chrome_profile = os.path.join(CONFIG_DIR, "chrome-profile") |
self.child_env["CHROME_USER_DATA_DIR"] = chrome_profile |
+ # Set SSH_AUTH_SOCK to the file name to listen on. |
+ if self.ssh_auth_sockname: |
+ self.child_env["SSH_AUTH_SOCK"] = self.ssh_auth_sockname |
+ |
# Wait for X to be active. |
for _test in range(5): |
proc = subprocess.Popen("xdpyinfo", env=self.child_env, stdout=devnull) |
@@ -421,6 +430,7 @@ class Desktop: |
def launch_session(self, x_args): |
self._init_child_env() |
self._setup_pulseaudio() |
+ self._setup_gnubby() |
self._launch_x_server(x_args) |
self._launch_x_session() |
@@ -431,6 +441,8 @@ class Desktop: |
args.append("--audio-pipe-name=%s" % self.pulseaudio_pipe) |
if self.server_supports_exact_resize: |
args.append("--server-supports-exact-resize") |
+ if self.ssh_auth_sockname: |
+ args.append("--ssh-auth-sockname=%s" % self.ssh_auth_sockname) |
# Have the host process use SIGUSR1 to signal a successful start. |
def sigusr1_handler(signum, frame): |