From d76a6fef95776e8741784b196fe7e3820ad845b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Love=20H=C3=B6rnquist=20=C3=85strand?= Date: Fri, 15 Apr 2005 12:29:51 +0000 Subject: [PATCH] external password verifier sample git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@14807 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/kadm5/check-cracklib.pl | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100755 lib/kadm5/check-cracklib.pl diff --git a/lib/kadm5/check-cracklib.pl b/lib/kadm5/check-cracklib.pl new file mode 100755 index 000000000..61a2c51ab --- /dev/null +++ b/lib/kadm5/check-cracklib.pl @@ -0,0 +1,35 @@ +#!/usr/pkg/bin/perl +# +# Sample cracklib password verifier for Heimdals external password +# verifier, see the chapter "Password changing" in the the info +# documentation for more information about the protocol used. +# +# $Id$ + +use strict; +use Crypt::Cracklib; + +my $database = '/usr/pkg/libdata/pw_dict'; + +my %params; + +while (<>) { + last if /^end$/; + if (!/^([^:]+): (.+)$/) { + die "key value pair not correct: $_"; + } + $params{$1} = $2; +} + +die "missing password" if (!defined $params{'new-password'}); + +my $reason = fascist_check($params{'new-password'}, $database); + +if ($reason eq "ok") { + print "APPROVED\n"; +} else { + print "$reason\n"; +} + +exit 0 +