* Changing the MIT-MAGIC-COOKIE-1 used by emacs --server
@ 2009-03-24 11:06 Sascha Wilde
2009-03-24 11:33 ` Stefan Monnier
0 siblings, 1 reply; 9+ messages in thread
From: Sascha Wilde @ 2009-03-24 11:06 UTC (permalink / raw)
To: emacs-devel
Hi *,
The problem in short:
- start an X11 server with -auth
(which is what most display-managers or startx do nowadays)
- start `emacs --server'
=> `emacsclient -c' can create a new X11-frame
- quit the X11 server (but leave the emacs server)
- start a new X11 server with -auth
=> `emacsclient -c' can't create a new frame anymore
I guess the problem is due to the changed authorization information
(cookie). Is there a way to tell the emacs server to use new
authorization data for a given display?
I made a naive attempt by
(setenv "XAUTHORITY" "/path/to/new/xauth-file")
but this didn't work...
cheers
sascha
--
Sascha Wilde
We're Germans and we use Unix. That's a combination of two
demographic groups known to have no sense of humour whatsoever.
-- Hanno Mueller in de.comp.os.unix.programming
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Changing the MIT-MAGIC-COOKIE-1 used by emacs --server
2009-03-24 11:06 Changing the MIT-MAGIC-COOKIE-1 used by emacs --server Sascha Wilde
@ 2009-03-24 11:33 ` Stefan Monnier
2009-03-24 16:44 ` Sascha Wilde
0 siblings, 1 reply; 9+ messages in thread
From: Stefan Monnier @ 2009-03-24 11:33 UTC (permalink / raw)
To: Sascha Wilde; +Cc: emacs-devel
> I made a naive attempt by
> (setenv "XAUTHORITY" "/path/to/new/xauth-file")
> but this didn't work...
The way it is expected to work is: XAUTHORITY is unset (i.e. points to
~/.Xauthority) and all keys are stored in ~/.Xauthority. The `xauth'
command is used to add/remove keys to/from it.
> - start an X11 server with -auth
> (which is what most display-managers or startx do nowadays)
Yes, most display managers do that to start the display, but when
someone logs in they also adds the display's key to the user's
~/.Xauthority file, so the XAUTHORITY var doesn't need to be set.
Stefan
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Changing the MIT-MAGIC-COOKIE-1 used by emacs --server
2009-03-24 11:33 ` Stefan Monnier
@ 2009-03-24 16:44 ` Sascha Wilde
2009-03-24 16:59 ` Sascha Wilde
2009-03-25 1:11 ` Stefan Monnier
0 siblings, 2 replies; 9+ messages in thread
From: Sascha Wilde @ 2009-03-24 16:44 UTC (permalink / raw)
To: Stefan Monnier; +Cc: emacs-devel
Stefan Monnier <monnier@iro.umontreal.ca> wrote:
>> I made a naive attempt by
>> (setenv "XAUTHORITY" "/path/to/new/xauth-file")
>> but this didn't work...
>
> The way it is expected to work is: XAUTHORITY is unset (i.e. points to
> ~/.Xauthority) and all keys are stored in ~/.Xauthority. The `xauth'
> command is used to add/remove keys to/from it.
>> - start an X11 server with -auth
>> (which is what most display-managers or startx do nowadays)
>
> Yes, most display managers do that to start the display, but when
> someone logs in they also adds the display's key to the user's
> ~/.Xauthority file, so the XAUTHORITY var doesn't need to be set.
Thanks for your reply. Unfortunately the gdm from Debain Etch in the
setup here does not do so, but only sets XAUTHORITY. I'll try to fix it
in my .xsession file. But I still think that it would be handy if one
could tell emacs to reevaluate XAUTHORITY or to change the used xauth
file by any other means... :)
cheers
sascha
--
Sascha Wilde
... mein Opa [...] würde an dieser Stelle zu Dir sagen: Junge, such Dir
ne Frau, bau Dir ein Haus, mach ein Kind und laß' die Finger von dem Zeug,
das Du gerade machst. -- Michael Winklhofer in d.a.e.auktionshaeuser
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Changing the MIT-MAGIC-COOKIE-1 used by emacs --server
2009-03-24 16:44 ` Sascha Wilde
@ 2009-03-24 16:59 ` Sascha Wilde
2009-03-25 1:11 ` Stefan Monnier
1 sibling, 0 replies; 9+ messages in thread
From: Sascha Wilde @ 2009-03-24 16:59 UTC (permalink / raw)
To: Stefan Monnier; +Cc: emacs-devel
Sascha Wilde <wilde@sha-bang.de> wrote:
> Stefan Monnier <monnier@iro.umontreal.ca> wrote:
>>> - start an X11 server with -auth
>>> (which is what most display-managers or startx do nowadays)
>>
>> Yes, most display managers do that to start the display, but when
>> someone logs in they also adds the display's key to the user's
>> ~/.Xauthority file, so the XAUTHORITY var doesn't need to be set.
>
> Thanks for your reply. Unfortunately the gdm from Debain Etch in the
> setup here does not do so, but only sets XAUTHORITY. I'll try to fix it
> in my .xsession file.
For the records: I've put
xauth -f ~/.Xauthority merge $XAUTHORITY
unset XAUTHORITY
to my ~/.xsession and now everything works as expected.
Thanks again for putting me on the right track!
cheers
sascha
--
Sascha Wilde
"Gimme about 10 seconds to think for a minute..."
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Changing the MIT-MAGIC-COOKIE-1 used by emacs --server
2009-03-24 16:44 ` Sascha Wilde
2009-03-24 16:59 ` Sascha Wilde
@ 2009-03-25 1:11 ` Stefan Monnier
2009-03-25 1:15 ` Samuel Bronson
2009-03-25 9:07 ` Sascha Wilde
1 sibling, 2 replies; 9+ messages in thread
From: Stefan Monnier @ 2009-03-25 1:11 UTC (permalink / raw)
To: Sascha Wilde; +Cc: emacs-devel
> Thanks for your reply. Unfortunately the gdm from Debain Etch in the
> setup here does not do so, but only sets XAUTHORITY.
That's very odd. I've been using Debian's gdm since Sarge and it's
never done that to me.
> I'll try to fix it in my .xsession file. But I still think that it
> would be handy if one could tell emacs to reevaluate XAUTHORITY or to
> change the used xauth file by any other means... :)
You have the source so you can make it do that, but I don't think it's
worth the trouble, since it's a lot easier to solve it outside Emacs.
Stefan
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Changing the MIT-MAGIC-COOKIE-1 used by emacs --server
2009-03-25 1:11 ` Stefan Monnier
@ 2009-03-25 1:15 ` Samuel Bronson
2009-03-25 1:57 ` Stefan Monnier
2009-03-25 9:07 ` Sascha Wilde
1 sibling, 1 reply; 9+ messages in thread
From: Samuel Bronson @ 2009-03-25 1:15 UTC (permalink / raw)
To: Stefan Monnier; +Cc: Sascha Wilde, emacs-devel
>> I'll try to fix it in my .xsession file. But I still think that it
>> would be handy if one could tell emacs to reevaluate XAUTHORITY or to
>> change the used xauth file by any other means... :)
>
> You have the source so you can make it do that, but I don't think it's
> worth the trouble, since it's a lot easier to solve it outside Emacs.
Is that even possible?
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Changing the MIT-MAGIC-COOKIE-1 used by emacs --server
2009-03-25 1:15 ` Samuel Bronson
@ 2009-03-25 1:57 ` Stefan Monnier
0 siblings, 0 replies; 9+ messages in thread
From: Stefan Monnier @ 2009-03-25 1:57 UTC (permalink / raw)
To: Samuel Bronson; +Cc: Sascha Wilde, emacs-devel
>>> I'll try to fix it in my .xsession file. But I still think that it
>>> would be handy if one could tell emacs to reevaluate XAUTHORITY or to
>>> change the used xauth file by any other means... :)
>> You have the source so you can make it do that, but I don't think it's
>> worth the trouble, since it's a lot easier to solve it outside Emacs.
> Is that even possible?
Yes, as explained in the rest of the thread.
Stefan
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Changing the MIT-MAGIC-COOKIE-1 used by emacs --server
2009-03-25 1:11 ` Stefan Monnier
2009-03-25 1:15 ` Samuel Bronson
@ 2009-03-25 9:07 ` Sascha Wilde
2009-03-25 11:54 ` Sascha Wilde
1 sibling, 1 reply; 9+ messages in thread
From: Sascha Wilde @ 2009-03-25 9:07 UTC (permalink / raw)
To: Stefan Monnier; +Cc: emacs-devel
Stefan Monnier <monnier@iro.umontreal.ca> wrote:
>> Thanks for your reply. Unfortunately the gdm from Debain Etch in the
>> setup here does not do so, but only sets XAUTHORITY.
>
> That's very odd. I've been using Debian's gdm since Sarge and it's
> never done that to me.
This might be due to my setup (I'm using a custom, $HOME/.xsession to
start my window manager and some other stuff). Anyway the problem seems
to be not too seldom, as gpg-agent -- which has the same problem of
being an daemon running an xclient (pinentry) on changing displays -- is
able to update not only the DISPLAY but XAUTHORITY, too.
>> I'll try to fix it in my .xsession file. But I still think that it
>> would be handy if one could tell emacs to reevaluate XAUTHORITY or to
>> change the used xauth file by any other means... :)
>
> You have the source so you can make it do that,
:)
> but I don't think it's worth the trouble, since it's a lot easier to
> solve it outside Emacs.
Would it be that much trouble? DISPLAY is already communicated to the
server and used, why would it be especially hard to do the same for
XAUTHORITY?
cheers
sascha
--
Sascha Wilde
"Structure is _nothing_ if it is all you got. Skeletons _spook_ people if
thwy try to walk around on their own. I really wonder why XML does
not." -- Erik Naggum <erik@naggum.net> in comp.lang.lisp
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Changing the MIT-MAGIC-COOKIE-1 used by emacs --server
2009-03-25 9:07 ` Sascha Wilde
@ 2009-03-25 11:54 ` Sascha Wilde
0 siblings, 0 replies; 9+ messages in thread
From: Sascha Wilde @ 2009-03-25 11:54 UTC (permalink / raw)
To: Stefan Monnier; +Cc: emacs-devel
Sascha Wilde <wilde@sha-bang.de> wrote:
> Stefan Monnier <monnier@iro.umontreal.ca> wrote:
[...]
>> but I don't think it's worth the trouble, since it's a lot easier to
>> solve it outside Emacs.
>
> Would it be that much trouble? DISPLAY is already communicated to the
> server and used, why would it be especially hard to do the same for
> XAUTHORITY?
Just had a short glance at the code and realized why this would be
really troublesome. So I agree, it's most probably not worth it.
sascha
--
Sascha Wilde : "There are 10 types of people in the world.
: Those who understand binary and those who don't."
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2009-03-25 11:54 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-24 11:06 Changing the MIT-MAGIC-COOKIE-1 used by emacs --server Sascha Wilde
2009-03-24 11:33 ` Stefan Monnier
2009-03-24 16:44 ` Sascha Wilde
2009-03-24 16:59 ` Sascha Wilde
2009-03-25 1:11 ` Stefan Monnier
2009-03-25 1:15 ` Samuel Bronson
2009-03-25 1:57 ` Stefan Monnier
2009-03-25 9:07 ` Sascha Wilde
2009-03-25 11:54 ` Sascha Wilde
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).