[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: another Xauthority problem?



Chris Evans wrote:

> Many, many thanks for your help...
>
> On 5 Aug 98, at 12:54, Jens B. Jorgensen wrote:
>
> > First thing is: are you su-ing and then running emacs? When you su you
> > lose your XAUTHORITY environment variable. The variables points to a file
> > which is used to authenticate you to the X server. What's more, the
> > permissions on xauthority files are set 600 so that only the user logged
> > in can access them (naturally). If you're su-ing to root this doesn't pose
> > a problem since root can read any file. If you're su-ing to another user
> > you'll have to extract the proper auth record and put it into the target
> > user's xauthority file (or disable X security--not recommended).
> >
> > So step by step: do you have an XAUTHORITY environment var?
> >
> > echo $XAUTHORITY
> >
> > If you don't, you need one. If you logged in with xdm then you should have
> > an xauthority file as ~/.Xauthority. Check to see if this file exists. Now
> > set
> >
> > export XAUTHORITY=<path to xauthority file>
> >
> > Try again to run program. If it doesn't work then perhaps you don't have
> > permission to the file or there's no entry for your display. Run 'xauth'
> > and at the prompt type 'list'. Do you see an entry for the DISPLAY you're
> > trying to use? If you're trying to reach the server running on same
> > machine you'll be interested in the '<machine name>/unix:0' entry most
> > likely. If this entry isn't there then you'll have to get it by exporting
> > the entry from the correct xauthority file and importing it into your
> > xauthority file.
> >
> Interesting thing is that someone else (Eric Marsden) put me onto
> xauth and I did the xauth merge to get the .Xauthority there for root
> and that's fixed the problem.  However, I don't seem to have an
> environment variable XAUTHORITY nor DISPLAY.  I have the sense
> that something, presumably a shell script (??) has got lost when
> Dselect set up my X system.  How should these variables be
> exported routinely and do I need them?

Hmmm. That shouldn't happen. Do you have them before you su? These variables are
set by xdm and your window manager. When you start up an xterm, it will inherit
the environment variables from the process which started it. If it's set to be a
login shell then /etc/profile and ~/.bash_profile will be read and processed.
These could also manipulate your environment. The shell will also process
~/.bashrc. I think I'm a little confused though on exactly when you experience
the problem. Does emacs fail only after you've su'd?

> Really appreciate your input on this.

Sure.

--
Jens B. Jorgensen
jjorgens@bdsinc.com



--  
Unsubscribe?  mail -s unsubscribe debian-user-request@lists.debian.org < /dev/null


Reply to: