Merge pull request #2277 from GNS3/fix/2276

Prevent X11 socket file to be modified by Docker container
This commit is contained in:
Jeremy Grossmann 2023-08-27 19:53:50 +10:00 committed by GitHub
commit d3d0cc039d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -406,7 +406,7 @@ class DockerVM(BaseNode):
await self._start_vnc()
params["Env"].append("QT_GRAPHICSSYSTEM=native") # To fix a Qt issue: https://github.com/GNS3/gns3-server/issues/556
params["Env"].append("DISPLAY=:{}".format(self._display))
params["HostConfig"]["Binds"].append("/tmp/.X11-unix/:/tmp/.X11-unix/")
params["HostConfig"]["Binds"].append("/tmp/.X11-unix/X{0}:/tmp/.X11-unix/X{0}:ro".format(self._display))
if self._extra_hosts:
extra_hosts = self._format_extra_hosts(self._extra_hosts)

View File

@ -182,7 +182,7 @@ async def test_create_vnc(compute_project, manager):
"Binds": [
"{}:/gns3:ro".format(get_resource("compute/docker/resources")),
"{}:/gns3volumes/etc/network".format(os.path.join(vm.working_dir, "etc", "network")),
'/tmp/.X11-unix/:/tmp/.X11-unix/'
"/tmp/.X11-unix/X{0}:/tmp/.X11-unix/X{0}:ro".format(vm._display)
],
"Privileged": True
},