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

emacs/gnuserv via MIT-MAGIC-COOKIE-1 authentication fails



Hello,

more out of interest than real need I tried to use
gnuserv+emacs-22 and gnuclient. After "hand installing"
gnuserv for emacs-snapshot

# apt-get install gnuserv
# dpkg -l emacs-snapshot gnuserv
emacs-snapshot              20060908-1
gnuserv                     3.12.7-2.2
# /usr/lib/emacsen-common/packages/install/gnuserv \
    emacs-snapshot
# cp  /etc/emacs21/site-start.d/50gnuserv.el \
    ../../emacs-snapshot/site-start.d

I can start gnuserv from within emacs. And connecting via
$ gnuclient file.txt
from the same machine/DISPLAY works fine.

Working on a different client, logging into the "server"
machine via "ssh -X" and calling gnuclient works fine, too.


However, I'm also trying to get a connection from the remote
client without logging into the server. This involves quite
a few things to be done:

On the "server"

1.  disable the firewall --- which is ok in this setup

2.  make X server listen on tcp! (normally it doesn't)

    # netstat -pltun | grep X
    tcp 0 0 0.0.0.0:6001 0.0.0.0:* LISTEN 3981/X

    this corresponds to DISPLAY :1.

3.  start emacs, start gnuserv from within emacs
    M-x gnuserv-start

    # ps aux | grep -E 'emacs|gnuserv|X' | grep -v grep
    xx        3938  0.0  0.0   2408   668 tty4     S+   11:35   0:00
/usr/bin/xinit /home/ew/.xsession -- /usr/bin/X :1 vt4
    root      3981  0.9  3.3  32052 25736 ?        S<s  11:35   1:48
/usr/bin/X :1 vt4
    xx        4037  0.1  2.0  20064 15828 tty4     S    11:36   0:13
emacs-snapshot-x -geometry 91x47+1024+0 -fn 7x13bold -title Emacs
    xx        4200  0.0  0.0   1708   648 pts/4    Ss+  11:36   0:00
/usr/bin/gnuserv

    # netstat -pltun
    tcp   0  0 0.0.0.0:6001  0.0.0.0:*  LISTEN  3981/X
    tcp   0  0 0.0.0.0:22490 0.0.0.0:*  LISTEN  4200/gnuserv


4.  create a MIT-MAGIC-COOKIE-1 as normal user

    $ xauth add $(hostname):999 MIT-MAGIC-COOKIE-1 $(mcookie)
    $ xauth list
    ...
    host.domain:999  MIT-MAGIC-COOKIE-1  12345678901234567890...

    It seems to me that I have to restart gnuserv at this
    point, and it may not show in netstat -pltun before. Or
    alternatively run step 3 after this one.

5.  transfer the cookie to the client.

    $ xauth extract Foo $(hostname):999
    $ scp Foo user@client:


---

On the client system

6.  Import the cookie, allow server to use this DISPLAY
    $ xauth -f .Xauthority merge ./Foo
    $ xhost + server

7.  call gnuclient

    $ gnuclient -h server file.txt


Now this call returns without creating a frame. On the
server, emacs issues the following error messages:

error in process filter: Symbol's function definition is void:
make-gtk-device

Digging into gnuserv/devices.el I found that make-gtk-device
is only called after make-x-device has returned an error.

Any idea how to proceed?
Did I overlook something?
Is this supposed not to work, maybe due to security restrictions?
Is it simply broken?
None of the above?


Cheers,
Erich



Reply to: