[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Google
  Web www.spinics.net

Allowing "su" to write to own X display



I recently moved to SuSE Linux (9.2) from Alpha Tru64 Unix.

I've been used since ages to be able to log in in at console under X with
my personal username, then issue a "su" command, and being able to issue
then (from root) any X command (say "xev" for the purpose of testing)
WITHOUT ANY NEED of setting the DISPLAY or issuing the xhost command.

When this is not the default behaviour, I usually found ways of doing it
(on Alpha for instance I edited the xdm or the CDE configuration files
and set the appropriate authorize resource to false ; in some cases I also
used the X0.hosts file). After that I could get rid of any .Xauthority
file and they were never recreated.

I am now looking for a way to do that under SuSE Linux. The login manager
is kdm, although my own X session runs under fvwm.

I found the following behaviour :

  - if I do "su" from an X window, I have no DISPLAY, and an X application
    like "xev" gives an error like

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

    even if I try a setenv DISPLAY :0.0 or a setenv DISPLAY machine:0.0
    *and* from another window I issue xhost machine

  - If however I issue "xhost local:" (since xhost tells me otherwise
    it's implying INET protocol) and from the "su" do setenv DISPLAY :0.0
    I can work

  - I also tried an rlogin on my machine as a normal user. If this user
    is the same logged in at console a setenv DISPLAY :0.0 is OK to
    have "xev" displayed in the console. If this user is another one,
    it behaves instead like "su" on the console (i.e. wants the xhost)

    this made me think it was a matter of "authorize", I tried in kdmrc
    to set Authorize=false, but it seems to have no effect.

    I see from ps that the X server is started with a -auth string

    worse than that, if I delete the .Xauthority file midway during a
    session I get a screwup.

  - now I could be content to have "xhost" automatically setup (for the
    DISPLAY I could find a way).

    I tried to insert "local:" in /etc/X0.hosts.

    This way when I log in and issue xhost it tells me it's already OK

    ... BUT IT DOES NOT WORK ...

    I do "su", "setenv DISPLAY" and "xev" and get an error.

    However if I issue "xhost local:" MANUALLY (it won't change the
    output of xhost w.r.t. what X0.hosts has already done) THEN it
    works.

What is the correct way of having "su" being able to access its own X
console without issuing any xhost or other command manually ?

----------------------------------------------------------------------------
Lucio Chiappetti - INAF/IASF - via Bassini 15 - I-20133 Milano (Italy)
For more info : http://www.mi.iasf.cnr.it/~lucio/personal.html
----------------------------------------------------------------------------
_______________________________________________
LinuxManagers mailing list - http://www.linuxmanagers.org
submissions: LinuxManagers@xxxxxxxxxxxxxxxxx
subscribe/unsubscribe: http://www.linuxmanagers.org/mailman/listinfo/linuxmanagers

[Home]     [Kernel List]     [Linux SCSI]     [Video 4 Linux]     [Linux Admin]     [Yosemite News]     [Motherboards]

Powered by Linux