summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2007-11-03 11:21:04 +0100
committerStefan Metzmacher <metze@samba.org>2007-12-21 05:44:13 +0100
commit1e14ad7cfeb6a416991da87b7d137dc9b89ef74f (patch)
treeb908c9ece490337bbc1d3154eed1d372fe95c40a
parent7fdf5656046653cca8a4870bf02bc1e2beadccc1 (diff)
downloadsamba-1e14ad7cfeb6a416991da87b7d137dc9b89ef74f.tar.gz
samba-1e14ad7cfeb6a416991da87b7d137dc9b89ef74f.tar.bz2
samba-1e14ad7cfeb6a416991da87b7d137dc9b89ef74f.zip
r25823: remove unneeded nesting by using error and out logic
metze (This used to be commit 86db839382a6cf92e659abb9e8e51ef828e1e422)
-rw-r--r--source4/libnet/libnet_vampire.c42
1 files changed, 21 insertions, 21 deletions
diff --git a/source4/libnet/libnet_vampire.c b/source4/libnet/libnet_vampire.c
index dff915df71..09163f6507 100644
--- a/source4/libnet/libnet_vampire.c
+++ b/source4/libnet/libnet_vampire.c
@@ -73,31 +73,31 @@ static NTSTATUS fix_user(TALLOC_CTX *mem_ctx,
user->user_private_info.DataLength = data.length;
nt_status = ndr_pull_struct_blob(&data, mem_ctx, &keys, (ndr_pull_flags_fn_t)ndr_pull_netr_USER_KEYS);
- if (NT_STATUS_IS_OK(nt_status)) {
- if (keys.keys.keys2.lmpassword.length == 16) {
- if (rid_crypt) {
- sam_rid_crypt(rid, keys.keys.keys2.lmpassword.pwd.hash, lm_hash.hash, 0);
- user->lmpassword = lm_hash;
- } else {
- user->lmpassword = keys.keys.keys2.lmpassword.pwd;
- }
- user->lm_password_present = true;
- }
- if (keys.keys.keys2.ntpassword.length == 16) {
- if (rid_crypt) {
- sam_rid_crypt(rid, keys.keys.keys2.ntpassword.pwd.hash, nt_hash.hash, 0);
- user->ntpassword = nt_hash;
- } else {
- user->ntpassword = keys.keys.keys2.ntpassword.pwd;
- }
- user->nt_password_present = true;
- }
- /* TODO: rid decrypt history fields */
- } else {
+ if (!NT_STATUS_IS_OK(nt_status)) {
*error_string = talloc_asprintf(mem_ctx, "Failed to parse Sensitive Data for %s:", username);
dump_data(10, data.data, data.length);
return nt_status;
}
+
+ if (keys.keys.keys2.lmpassword.length == 16) {
+ if (rid_crypt) {
+ sam_rid_crypt(rid, keys.keys.keys2.lmpassword.pwd.hash, lm_hash.hash, 0);
+ user->lmpassword = lm_hash;
+ } else {
+ user->lmpassword = keys.keys.keys2.lmpassword.pwd;
+ }
+ user->lm_password_present = true;
+ }
+ if (keys.keys.keys2.ntpassword.length == 16) {
+ if (rid_crypt) {
+ sam_rid_crypt(rid, keys.keys.keys2.ntpassword.pwd.hash, nt_hash.hash, 0);
+ user->ntpassword = nt_hash;
+ } else {
+ user->ntpassword = keys.keys.keys2.ntpassword.pwd;
+ }
+ user->nt_password_present = true;
+ }
+ /* TODO: rid decrypt history fields */
}
return NT_STATUS_OK;
}