I have used this functionality extensively, and wrote a few scripts to
make it easier to run programs as other users. So I ran into this rather
quickly on 15.04. As a workaround, you can use xauth instead. For
example, as a script:

#!/bin/sh
OTHER_USER=user2

echo "Giving $OTHER_USER xauth key"
XAUTH_KEY=$(xauth list | grep $(uname -n) | sed -n '1,1p' | cut -d ' ' -f 5)

#If XAUTHORITY is set, it probably won't be a file writable by the other user
unset XAUTHORITY

sudo -Hu  $OTHER_USER xauth add $DISPLAY . $XAUTH_KEY

sudo -Hu  $OTHER_USER xclock

echo "Taking $OTHER_USER xauth key"
sudo -Hu  $OTHER_USER xauth remove $DISPLAY

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1448431

Title:
  xhost access control fails to add other users

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/x11-xserver-utils/+bug/1448431/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to