Hi Karl,
> ... both xterms have DISPLAY set to 😮.0, yet the X11
displays are independent.
That's incredible! Are you sure? Maybe Apple did it differently in Panther but it's hard to imagine that writes to a socket can be "pipelined" to correct "screen" according to username. Can your users write to each other's X11 display with sudo? That would seem rather unlikely to be considered a satisfactory implementation.
It would seem more likely that your sockets behave in a rather unPOSIX manner with respect to Mach namespaces. (as described in
Technical Note TN2083: Daemons and Agents) It would be possible to use the socket independently in different per-session namespaces. The socket would act like a number of sockets, one for each per-session bootstrap namespace.
It's done rather differently in Tiger, if my system is generic in that regard. The display is different for each different Xsession. With both me and my testuser, kerby, (the virtual crash-test dummy) running X11, I get the following outputs in the main user's shell:
% ls -lhAF /tmp/.X*
-r--r--r-- 1 kerbaugh wheel 11B Dec 5 04:20 /tmp/.X0-lock
-r--r--r-- 1 kerby wheel 11B Dec 5 04:20 /tmp/.X1-lock
/tmp/.X11-unix:
total 0
srwxrwxrwx 1 kerbaugh wheel 0B Dec 5 04:20 X0=
srwxrwxrwx 1 kerby wheel 0B Dec 5 04:20 X1=
% export DISPLAY=:1.0
% xeyes
Xlib: connection to ":1.0" refused by server
Xlib: Invalid MIT-MAGIC-COOKIE-1 key
Error: Can't open display: :1.0
% sudo -u kerby xeyes
Password:
Xlib: connection to ":1.0" refused by server
Xlib: No protocol specified
Error: Can't open display: :1.0
Thus, the main user cannot access the socket of the testuser but both can see both sockets. Out of curiosity, what do you get when you execute:
ls -lhAF /tmp/.X*
Maybe your other user's shell startup script sets the DISPLAY variable to a static value. (like mine, unfortunately) However, my poor testuser has no shell environment. (I love a good crash) Thus, the DISPLAY variable was set correctly in the xterm window.
--
Gary
~~~~
Never put off till tomorrow what you can avoid all together.