/[cl-cracklib]/cl-cracklib/cl-cracklib.lisp
ViewVC logotype

Contents of /cl-cracklib/cl-cracklib.lisp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1.1.1 - (show annotations) (vendor branch)
Tue Dec 2 10:45:59 2003 UTC (10 years, 4 months ago) by eenge
Branch: init, MAIN
CVS Tags: eenge, HEAD
Changes since 1.1: +0 -0 lines
initial import
1 ;;;; $Id: cl-cracklib.lisp,v 1.1.1.1 2003/12/02 10:45:59 eenge Exp $
2 ;;;; $Source: /tiger/var/lib/cvsroots/cl-cracklib/cl-cracklib/cl-cracklib.lisp,v $
3
4 ;;;; See LICENSE for licensing information.
5
6 (in-package :cl-cracklib)
7
8 (defvar *dictionary-path* "/var/cache/cracklib/cracklib_dict")
9
10 (uffi:load-foreign-library
11 (uffi:find-foreign-library '("libcrack") '("/usr/lib/" "/usr/local/lib/")
12 :types '("so" "a")))
13
14 (uffi:def-function ("FascistCheck" %FascistCheck%)
15 ((passwd :cstring)
16 (dictpath :cstring))
17 :returning :cstring)
18
19 (defun fascistcheck (password &optional (dictionary-path *dictionary-path*))
20 "Return t if `password' is a good password and nil if it is not.
21 When nil is returned, the second value of fascistcheck an error
22 diagnostics string."
23 (uffi:with-cstring (c-password password)
24 (let ((diag-string (%fascistcheck% c-password dictionary-path)))
25 (if diag-string ; then the password is not good
26 (values nil diag-string)
27 (values t nil)))))

  ViewVC Help
Powered by ViewVC 1.1.5