summaryrefslogtreecommitdiff
path: root/source3/rpc_server
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2010-04-16 15:06:03 +0200
committerVolker Lendecke <vl@samba.org>2010-04-17 12:01:18 +0200
commit3a362b45c623afb031798570836cebef3e5ebc8a (patch)
treee4d697031f09c9835690c59ad977fe1af449b4a5 /source3/rpc_server
parent6f998b4b9a46f48b98b947f79bf9c83ec7a0b9fd (diff)
downloadsamba-3a362b45c623afb031798570836cebef3e5ebc8a.tar.gz
samba-3a362b45c623afb031798570836cebef3e5ebc8a.tar.bz2
samba-3a362b45c623afb031798570836cebef3e5ebc8a.zip
s3: Slightly simpify samr_ValidatePassword_Change
Diffstat (limited to 'source3/rpc_server')
-rw-r--r--source3/rpc_server/srv_samr_nt.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/source3/rpc_server/srv_samr_nt.c b/source3/rpc_server/srv_samr_nt.c
index 3626cbdf2a..c739de2acd 100644
--- a/source3/rpc_server/srv_samr_nt.c
+++ b/source3/rpc_server/srv_samr_nt.c
@@ -6697,19 +6697,20 @@ static enum samr_ValidationStatus samr_ValidatePassword_Change(TALLOC_CTX *mem_c
{
NTSTATUS status;
- if (req->password.string) {
- if (strlen(req->password.string) < dom_pw_info->min_password_length) {
+ if (req->password.string == NULL) {
+ SAMR_VALIDATION_STATUS_SUCCESS;
+ }
+ if (strlen(req->password.string) < dom_pw_info->min_password_length) {
+ ZERO_STRUCT(rep->info);
+ return SAMR_VALIDATION_STATUS_PWD_TOO_SHORT;
+ }
+ if (dom_pw_info->password_properties & DOMAIN_PASSWORD_COMPLEX) {
+ status = check_password_complexity(req->account.string,
+ req->password.string,
+ NULL);
+ if (!NT_STATUS_IS_OK(status)) {
ZERO_STRUCT(rep->info);
- return SAMR_VALIDATION_STATUS_PWD_TOO_SHORT;
- }
- if (dom_pw_info->password_properties & DOMAIN_PASSWORD_COMPLEX) {
- status = check_password_complexity(req->account.string,
- req->password.string,
- NULL);
- if (!NT_STATUS_IS_OK(status)) {
- ZERO_STRUCT(rep->info);
- return SAMR_VALIDATION_STATUS_NOT_COMPLEX_ENOUGH;
- }
+ return SAMR_VALIDATION_STATUS_NOT_COMPLEX_ENOUGH;
}
}