Commit 255a443b authored by Erik Enge's avatar Erik Enge

*** empty log message ***

parents
# CVS default ignores begin
tags
TAGS
.make.state
.nse_depinfo
*~
#*
.#*
,*
_$*
*$
*.old
*.bak
*.BAK
*.orig
*.rej
.del-*
*.a
*.olb
*.o
*.obj
*.so
*.exe
*.Z
*.elc
*.ln
core
# CVS default ignores end
(This is the MIT / X Consortium license as taken from
http://www.opensource.org/licenses/mit-license.html)
Copyright (c) 2003 Erik Enge
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# $Id$
# $Source$
clean:
find -name "*.fasl" -o -name "*.faslmt" -o -name "*~" -o -name "*.err" -o -name "*.x86f" | xargs rm
commit:
make clean; cvs up; cvs ci
cl-cracklib, a Common Lisp interface to libcrack.
Installation
1) Make sure you have libcrack installed.
2) Make sure you have linked cl-cracklib.asd somewhere where your
ASDF installation knows about it.
3a) under SBCL: (require :cl-cracklib)
3b) others: (load "/path/to/cl-cracklib.asd")
(asdf:oos 'asdf:load-op :cl-cracklib)
Usage:
* (cracklib:fascistcheck "mypassword")
NIL
"it is based on a dictionary word"
For more information, see <http://common-lisp.net/project/cl-cracklib>.
Erik Enge.
\ No newline at end of file
;;;; $Id$
;;;; $Source$
;;;; See the LICENSE file for licensing information.
(in-package #:cl-user)
(defpackage #:cl-cracklib-system
(:use #:cl #:asdf))
(in-package #:cl-cracklib-system)
(defsystem cl-cracklib
:name "cl-cracklib"
:author "Erik Enge"
:version "0.1.0"
:licence "MIT"
:description "Common Lisp interface to cracklib"
:depends-on (:uffi)
:components ((:file "package")
(:file "cl-cracklib"
:depends-on ("package"))))
;;;; $Id$
;;;; $Source$
;;;; See LICENSE for licensing information.
(in-package :cl-cracklib)
(defvar *dictionary-path* "/var/cache/cracklib/cracklib_dict")
(uffi:load-foreign-library
(uffi:find-foreign-library '("libcrack") '("/usr/lib/" "/usr/local/lib/")
:types '("so" "a")))
(uffi:def-function ("FascistCheck" %FascistCheck%)
((passwd :cstring)
(dictpath :cstring))
:returning :cstring)
(defun fascistcheck (password &optional (dictionary-path *dictionary-path*))
"Return t if `password' is a good password and nil if it is not.
When nil is returned, the second value of fascistcheck an error
diagnostics string."
(uffi:with-cstring (c-password password)
(let ((diag-string (%fascistcheck% c-password dictionary-path)))
(if diag-string ; then the password is not good
(values nil diag-string)
(values t nil)))))
\ No newline at end of file
;;;; $Id$
;;;; $Source$
;;;; See the LICENSE file for licensing information.
(in-package :cl-user)
(eval-when (:execute :load-toplevel :compile-toplevel)
(defpackage :cl-cracklib
(:use :cl)
(:nicknames :cracklib)
(:export :fascistcheck
:*dictionary-path*)))
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment