[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Trouble w/sockets
From: |
mark |
Subject: |
Trouble w/sockets |
Date: |
Sat, 02 Mar 2013 22:38:12 -0500 |
Hi all,
I've made lots of progress on my Guile xcb code and it talks to the X
server now, send requests, receive replies and so forth.
However, if the X server requires authentication, there's trouble. I'm
able to send the authentication method's name over the socket that
connects to the X server, but as soon as I try to send the first byte of
the authentication value, Guile crashes.
This code should hopefully reproduce the issue (assuming you're on a
little-endian system and have an X server listening at the given
socket). The segment of data starting with 77 is the authentication
method's name; then there's an equally long sequence of zeros and the
remaining numbers are the authentication value and some more padding.
(define sock (socket AF_UNIX SOCK_STREAM 0))
(connect sock (make-socket-address AF_UNIX "/tmp/.X11-unix/X0"))
(for-each
(lambda (b)
(write-char (integer->char b) sock))
'(108 0 11 0 0 0 18 0 16 0 0 0 77 73 84 45 77 65 71 73 67 45 67 79
79 75 73 69 45 49 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 243 236 56
103 158 249 237 124 101 131 158 31 63 251 239 7 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0))
This will obviously be the wrong authentication data for anyone else's X
server; however, even if X closes the socket prematurely (not that it's
supposed to, but it might), Guile shouldn't just crash, should it?
Thanks
--
Mark Witmer
- Trouble w/sockets,
mark <=
- Re: Trouble w/sockets, Mike Gran, 2013/03/02
- Re: Trouble w/sockets, mark, 2013/03/03
- Re: Trouble w/sockets, Mike Gran, 2013/03/03
- Re: Trouble w/sockets, Thien-Thi Nguyen, 2013/03/03
- Re: Trouble w/sockets, mark . d . witmer, 2013/03/03
- Re: Trouble w/sockets, mark . d . witmer, 2013/03/03
- Re: Trouble w/sockets, Thien-Thi Nguyen, 2013/03/04
- Re: Trouble w/sockets, Chris Vine, 2013/03/03