diff options
author | Andrew Tridgell <tridge@samba.org> | 2011-09-30 09:03:39 +1000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2011-10-04 15:08:58 +1100 |
commit | 28a6881d4f4aac814cb01ca87e113caf4b1c8026 (patch) | |
tree | cd812cd9bd17c31322bdc4b3fabbe060bc381872 | |
parent | e9758ef94de98dd253a79547d2109bcd714f8517 (diff) | |
download | samba-28a6881d4f4aac814cb01ca87e113caf4b1c8026.tar.gz samba-28a6881d4f4aac814cb01ca87e113caf4b1c8026.tar.bz2 samba-28a6881d4f4aac814cb01ca87e113caf4b1c8026.zip |
s4-lsa: fixed set of trust password with old password
the calculation of add_incoming and add_outgoing was not correct when
a trust was already in place
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
-rw-r--r-- | source4/rpc_server/lsa/dcesrv_lsa.c | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/source4/rpc_server/lsa/dcesrv_lsa.c b/source4/rpc_server/lsa/dcesrv_lsa.c index d5c1b61f58..5acdfe8046 100644 --- a/source4/rpc_server/lsa/dcesrv_lsa.c +++ b/source4/rpc_server/lsa/dcesrv_lsa.c @@ -1736,7 +1736,6 @@ static NTSTATUS setInfoTrustedDomain_base(struct dcesrv_call_state *dce_call, if (info_ex) { uint32_t origattrs; uint32_t origdir; - uint32_t tmp; int origtype; nt_status = update_uint32_t_value(mem_ctx, p_state->sam_ldb, @@ -1748,20 +1747,20 @@ static NTSTATUS setInfoTrustedDomain_base(struct dcesrv_call_state *dce_call, return nt_status; } - tmp = info_ex->trust_direction ^ origdir; - if (tmp & LSA_TRUST_DIRECTION_INBOUND) { - if (origdir & LSA_TRUST_DIRECTION_INBOUND) { - del_incoming = true; - } else { - add_incoming = true; - } + if (info_ex->trust_direction & LSA_TRUST_DIRECTION_INBOUND) { + add_incoming = true; } - if (tmp & LSA_TRUST_DIRECTION_OUTBOUND) { - if (origdir & LSA_TRUST_DIRECTION_OUTBOUND) { - del_outgoing = true; - } else { - add_outgoing = true; - } + if (info_ex->trust_direction & LSA_TRUST_DIRECTION_OUTBOUND) { + add_outgoing = true; + } + + if ((origdir & LSA_TRUST_DIRECTION_INBOUND) && + !(info_ex->trust_direction & LSA_TRUST_DIRECTION_INBOUND)) { + del_incoming = true; + } + if ((origdir & LSA_TRUST_DIRECTION_OUTBOUND) && + !(info_ex->trust_direction & LSA_TRUST_DIRECTION_OUTBOUND)) { + del_outgoing = true; } origtype = ldb_msg_find_attr_as_int(dom_msg, "trustType", -1); |