1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

s3: Simplify trustdom_state

Don't store information explicitly as boolean flags that can be easily
retrieved from the domain when it's actually needed.
This commit is contained in:
Volker Lendecke 2010-04-25 10:36:58 +02:00
parent 13cdaf9417
commit d41836fb62

View File

@ -237,8 +237,7 @@ bool domain_is_forest_root(const struct winbindd_domain *domain)
********************************************************************/
struct trustdom_state {
bool primary;
bool forest_root;
struct winbindd_domain *domain;
struct winbindd_response *response;
};
@ -267,11 +266,7 @@ static void add_trusted_domains( struct winbindd_domain *domain )
return;
}
state->response = response;
/* Flags used to know how to continue the forest trust search */
state->primary = domain->primary;
state->forest_root = domain_is_forest_root(domain);
state->domain = domain;
request->length = sizeof(*request);
request->cmd = WINBINDD_LIST_TRUSTDOM;
@ -363,16 +358,16 @@ static void trustdom_recv(void *private_data, bool success)
&& !forest_root)
*/
if ( state->primary ) {
if (state->domain->primary) {
/* If this is our primary domain and we are not in the
forest root, we have to scan the root trusts first */
if ( !state->forest_root )
if (!domain_is_forest_root(state->domain))
rescan_forest_root_trusts();
else
rescan_forest_trusts();
} else if ( state->forest_root ) {
} else if (domain_is_forest_root(state->domain)) {
/* Once we have done root forest trust search, we can
go on to search the trusted forests */