wOmbad wrote:

Hi

Rotatin my desktop orientation via the xrandr command (p.e. xrandr -o
left) works perfectly from a konsol within the running kde-3.4.2!
Unfortunately the equivalent command - xrandr -display :0.0 -o left -
from a virtual terminal strikes with the following output message:

Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified

kwin: can't connect to X server :0.0

Obviously there is a Xserver running with the specified displayname.
The "-(-)display"-option of serveral commands(like kwin, etc.) refused
to work as well with almost the same error.

I think it's a problem with my xserver config but sadly i haven't found
a solution on the internet.


Nothing to do with your xorg.conf, but with the X security mechanisms.

By default X uses magic cookies to authenticate clients...any client that knows the magic password can access the display.

One of the jobs of kdm is that once you have logged into the display, it creates ~/.Xauthority so that the programs that are run under your login know the password. But it only does this _after_ you login. While the login window is displayed, the magic file is /var/run/xauth/A:0-??????, and is owned by root.

So to run an xclient (like xrandr, xlogo, or xconsole), you need to point them to the correct xauthority file, and also run them as root. The tricky part is that the name of the file changes each time kdm is run. The following commands, run as root, should do the trick though:

   export XAUTHORITY=/var/run/xauth/`ls -rt /var/run/xauth/ | tail -n 1`
   xlogo -display :0

You can replace xlogo with xrandr or any other client you want to run.

If this seems like too much work, you can add a "xhost localhost" to /usr/kde/3.4/share/config/kdm/Xsetup, but then you have no security at all for locally run clients. All of this only applies if you are using kdm as your login manager. If you are using gdm, xdm, or another login manager, you'll have to figure out how they handle xauth security.

Anyway, you may want to read up on the ACCESS CONTROL section in the X man page, or read the Xsecurity man page.

HTH,
-Richard

--
gentoo-user@gentoo.org mailing list

Reply via email to