summaryrefslogtreecommitdiffstats
path: root/source/smbd/chgpasswd.c
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2004-09-14 00:21:11 +0000
committerSimo Sorce <idra@samba.org>2004-09-14 00:21:11 +0000
commit395461d3679d11732f979f60134b65c1e8bb7b92 (patch)
tree9cfab7fe569ab297cc93a2264a267340feb44c10 /source/smbd/chgpasswd.c
parentb59cda5176c0c7e9a1da466eecd80959dd282c85 (diff)
downloadsamba-395461d3679d11732f979f60134b65c1e8bb7b92.tar.gz
samba-395461d3679d11732f979f60134b65c1e8bb7b92.tar.xz
samba-395461d3679d11732f979f60134b65c1e8bb7b92.zip
r2331: check password script code and example from trunk
Diffstat (limited to 'source/smbd/chgpasswd.c')
-rw-r--r--source/smbd/chgpasswd.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/source/smbd/chgpasswd.c b/source/smbd/chgpasswd.c
index 8ea5b9c60a3..7d3ffedec0e 100644
--- a/source/smbd/chgpasswd.c
+++ b/source/smbd/chgpasswd.c
@@ -1046,6 +1046,19 @@ NTSTATUS change_oem_password(SAM_ACCOUNT *hnd, char *old_passwd, char *new_passw
return NT_STATUS_ACCESS_DENIED;
}
+ /* Use external script to check password complexity */
+ if (lp_check_password_script()) {
+ int check_ret;
+
+ check_ret = smbrunsecret(lp_check_password_script(), new_passwd);
+ DEBUG(5, ("change_oem_password: check password script (%s) returned [%d]\n", lp_check_password_script(), check_ret));
+
+ if (check_ret != 0) {
+ DEBUG(1, ("change_oem_password: check password script said new password is not good enough!\n"));
+ return NT_STATUS_PASSWORD_RESTRICTION;
+ }
+ }
+
/*
* If unix password sync was requested, attempt to change
* the /etc/passwd database first. Return failure if this cannot