X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=interfaces%2Fpostgresql-socket%2Fpostgresql-socket-api.cl;h=e30584eac4d5ca08489444cf5b2010c44780d162;hb=22381785b1d80e90fc0099e13ad5c4798a89a94b;hp=0ee7d8a8fe0ee2911714260dee5288631cd67b4c;hpb=17c4d99ca97dbdec882028929d645e16164b4b0b;p=clsql.git diff --git a/interfaces/postgresql-socket/postgresql-socket-api.cl b/interfaces/postgresql-socket/postgresql-socket-api.cl index 0ee7d8a..e30584e 100644 --- a/interfaces/postgresql-socket/postgresql-socket-api.cl +++ b/interfaces/postgresql-socket/postgresql-socket-api.cl @@ -9,7 +9,7 @@ ;;;; ;;;; Date Started: Feb 2002 ;;;; -;;;; $Id: postgresql-socket-api.cl,v 1.12 2002/03/27 12:09:39 kevin Exp $ +;;;; $Id: postgresql-socket-api.cl,v 1.14 2002/04/07 15:10:01 kevin Exp $ ;;;; ;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; and Copyright (c) 1999-2001 by Pierre R. Mai @@ -219,24 +219,24 @@ socket interface" ;;; Support for encrypted password transmission -(defconstant +crypt-library+ "/usr/lib/libcrypt.so" - "Name of the shared library to load in order to access the crypt -function named by `*crypt-function-name*'.") - (defvar *crypt-library-loaded* nil) (defun crypt-password (password salt) "Encrypt a password for transmission to a PostgreSQL server." (unless *crypt-library-loaded* - (uffi:load-foreign-library +crypt-library+ :supporting-libaries '("c")) - (eval (uffi:def-function "crypt" - ((key :cstring) - (salt :cstring)) + (uffi:load-foreign-library + (uffi:find-foreign-library "libcrypt" + '("/usr/lib/" "/usr/local/lib/" "/lib/")) + :supporting-libaries '("c")) + (eval '(uffi:def-function "crypt" + ((key :cstring) + (salt :cstring)) :returning :cstring)) (setq *crypt-library-loaded* t)) (uffi:with-cstring (password-cstring password) (uffi:with-cstring (salt-cstring salt) - (uffi:convert-from-cstring (crypt password-cstring salt-cstring))))) + (uffi:convert-from-cstring + (funcall (fdefinition 'crypt) password-cstring salt-cstring))))) ;;; Condition hierarchy (define-condition postgresql-condition (condition)