Repository navigation
Reauthorize the X display when the server tig has to reach changes - #41
Conversation
Co-Authored-By: jason.han <jason.han@jpl.nasa.gov>
Original prompt from jason.han
|
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Co-Authored-By: jason.han <jason.han@jpl.nasa.gov>
Co-Authored-By: jason.han <jason.han@jpl.nasa.gov>
Runtime re-test after 832ba82 / 7332773 (Devin session)Linux end-to-end with the real
Precondition: access control enabled, no Repeated on a second, cookie-enforced X server ( Steady state: 1 xhost per command, overhead invisibleWith a logging shim ahead of the real TIG_NO_X11=1 still does not touch the displayOn a revoked, cookie-enforced Note on how much
|
Summary
Users were running
xhost + 127.0.0.1by hand beforexvd, typically after an XQuartz update. The cause: anxhostauthorization is state of the X server, but tig only ranxhostwhen it created a container. The container is deliberately long-lived, so once XQuartz restarted (update, logout, quit) nothing re-authorized it for the container's lifetime.ensure_x11_ready()is now per command instead of per container, and made cheap by remembering which server was authorized:None(no server recognized) always re-authorizes rather than assuming anything. Call sites:ContainerManager.execute_vicar_command(),fast.run()(before the claim, so the dispatcher path is covered too), and container creation as before.Two macOS specifics:
+localhost +inet:127.0.0.1, since the connection arrives from the runtime gateway on IPv4 loopback howeverlocalhosthappens to resolve;nolisten_tcpis only read at XQuartz startup, so when it is already running with TCP off — how it comes out of an update that reset the preference — tig writes the preference and tells the user to quit XQuartz, rather than quitting it under their other X clients.TIG_NO_X11=1opts out entirely. Docs updated intig-cli/README.mdanddocs/install-macos.md.Link to Devin session: https://nasa-jpl-demo.devinenterprise.com/sessions/50390f321d6648c4b813b55446f1def1
Open in Devin Desktop: https://nasa-jpl-demo.devinenterprise.com/desktop/session/50390f321d6648c4b813b55446f1def1?variant=devin
Requested by: @HuiJun