>>>>> "ecm" == Eric Marsden <[EMAIL PROTECTED]> writes:
>>>>> "cb" == Chris Baker <[EMAIL PROTECTED]> writes:

  cb> I'm running debian unstable, and I recently upgraded to the latest
  cb> ssh.  Unfortunately, it looks like CLX no longer works over ssh via X
  cb> forwarding.  Has anyone else encountered this problem?  (Debugging
  cb> output below).

actually, this is the same problem that Scott Fahlman reported here a
few weeks ago. Try adding the following to your .cmucl-init file,
after having loaded CLX.

(in-package "XLIB")

(defun get-best-authorization (host display protocol)
  (labels ((read-short (stream &optional (eof-errorp t))
             (let ((high-byte (read-byte stream eof-errorp)))
               (and high-byte
                    (dpb high-byte (byte 8 8) (read-byte stream)))))
           (read-short-length-string (stream)
             (let ((length (read-short stream)))
               (let ((string (make-string length)))
                 (dotimes (k length)
                   (setf (schar string k) (card8->char (read-byte stream))))
                 string)))
           (read-short-length-vector (stream)
             (let ((length (read-short stream)))
               (let ((vector (make-array length :element-type '(unsigned-byte 8))))
                 (dotimes (k length)
                   (setf (aref vector k) (read-byte stream)))
                 vector))))
    ;; Original version didn't handle "localhost" correctly -- SEF.
    (if (string= host "localhost")
        (setq host (machine-instance)))
    (let ((pathname (authority-pathname)))
      (when pathname
        (with-open-file (stream pathname :element-type '(unsigned-byte 8)
                                :if-does-not-exist nil)
          (when stream
            (let* ((host-family (ecase protocol
                                  ((:tcp :internet nil) 0)
                                  ;; The remaining protocols are not really supported 
-- SEF.
                                  ((:dna :DECnet) 1)
                                  ((:chaos) 2)))
                   (host-address (rest (host-address host host-family))))
              (loop
               (let ((family (read-short stream nil)))
                 (cond ((null family) (return (values "" "")))    ; No useful entry 
found. -- SEF
                       ((eql family 0)
                        (let* ((address (read-short-length-vector stream))
                               (number (parse-integer (read-short-length-string 
stream)))
                               (auth-name (read-short-length-string stream))
                               (auth-data (read-short-length-vector stream)))
                          (when (and (= family host-family)
                                     (equal host-address (coerce address 'list))
                                     (= number display)
                                     (string= auth-name "MIT-MAGIC-COOKIE-1"))
                            (return (values auth-name auth-data)))))
                       ;; This is the new case.  The cookie contains a string naming 
the
                       ;; host, then the display number, auth-name and auth-data. -- 
SEF
                       ((eql family 256)
                        (let* ((hname (read-short-length-string stream))
                               (number (parse-integer (read-short-length-string 
stream)))
                               (auth-name (read-short-length-string stream))
                               (auth-data (read-short-length-vector stream)))
                          (when (and (string= hname host)
                                (= number display)
                                (string= auth-name "MIT-MAGIC-COOKIE-1"))
                            (return (values auth-name auth-data)))))))))))))))

-- 
Eric Marsden                          <URL:http://www.laas.fr/~emarsden/>

Reply via email to