From 60a8040e3115f3fac5eabc4b3cebfda4dec654bf Mon Sep 17 00:00:00 2001 From: "Kevin M. Rosenberg" Date: Fri, 23 Mar 2007 13:44:17 +0000 Subject: [PATCH] r11597: 23 Mar 2007 Kevin Rosenberg * Version 3.8.2 * sql/db-postgresql-socket-api.lisp: Change read-socket-sequence to disable wide characters for crypt salt sequence on SBCL, based on patch from Lars Nostdal. --- ChangeLog | 6 ++++++ db-postgresql-socket/postgresql-socket-api.lisp | 12 ++++++------ debian/changelog | 6 ++++++ 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5e08782..4f30468 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +23 Mar 2007 Kevin Rosenberg + * Version 3.8.2 + * sql/db-postgresql-socket-api.lisp: Change read-socket-sequence to + disable wide characters for crypt salt sequence on SBCL, based + on patch from Lars Nostdal. + 26 Jan 2007 Kevin Rosenberg * Version 3.8.1 * sql/pool.lisp: Test pooled connection when popped from diff --git a/db-postgresql-socket/postgresql-socket-api.lisp b/db-postgresql-socket/postgresql-socket-api.lisp index e9d23f3..3ca868a 100644 --- a/db-postgresql-socket/postgresql-socket-api.lisp +++ b/db-postgresql-socket/postgresql-socket-api.lisp @@ -213,8 +213,7 @@ socket interface" (int32 key)) -(defun read-socket-sequence (stream length) - "KMR -- Added to support reading from binary stream into a string" +(defun read-socket-sequence (stream length &optional (allow-wide t)) (declare (stream stream) (optimize (speed 3) (safety 0))) #-sb-unicode @@ -226,8 +225,9 @@ socket interface" (let ((bytes (make-array length :element-type '(unsigned-byte 8)))) (declare (type (simple-array (unsigned-byte 8) (*)) bytes)) (read-sequence bytes stream) - (sb-ext:octets-to-string bytes))) - + (if allow-wide + (sb-ext:octets-to-string bytes) + (map 'string #'code-char bytes)))) ;;; Support for encrypted password transmission @@ -496,14 +496,14 @@ connection, if it is still open." (postgresql-connection-password connection)) (force-output socket)) (4 - (let ((salt (read-socket-sequence socket 2))) + (let ((salt (read-socket-sequence socket 2 nil))) (send-encrypted-password-message socket (crypt-password (postgresql-connection-password connection) salt))) (force-output socket)) (5 - (let ((salt (read-socket-sequence socket 4))) + (let ((salt (read-socket-sequence socket 4 nil))) (let* ((pwd2 (encrypt-md5 (postgresql-connection-password connection) (postgresql-connection-user connection))) (pwd (encrypt-md5 pwd2 salt))) diff --git a/debian/changelog b/debian/changelog index 43328c6..3ad78b5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +cl-sql (3.8.2-1) unstable; urgency=low + + * New upstream + + -- Kevin M. Rosenberg Fri, 23 Mar 2007 07:37:15 -0600 + cl-sql (3.8.1-1) unstable; urgency=low * New upstream -- 2.34.1