e-smith-samba/root/sbin/e-smith/samba_check_password

19 lines
401 B
Plaintext
Raw Normal View History

#!/usr/bin/perl -T
use strict;
use warnings;
use esmith::ConfigDB;
use esmith::util;
our $db = esmith::ConfigDB->open or
die "Couldn't open configuration database (permissions problems?)";
my $strength = $db->get_prop('passwordstrength', 'Users');
my $password = <>;
chomp $password;
my $reason = esmith::util::validatePassword($password, $strength);
exit 0 if (lc($reason) eq "ok");
exit 1;