diff options
author | Volker Lendecke <vl@samba.org> | 2009-12-30 10:25:41 +0100 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2010-01-02 12:09:05 +0100 |
commit | d05e17f875300615c0b8543291e7e021448ddff1 (patch) | |
tree | 4e25e85095f2bcabd3248c3a894a101305a80a7f /source3/winbindd/winbindd_util.c | |
parent | 504754856eed363dde28cdff821c086754deb7f8 (diff) | |
download | samba-d05e17f875300615c0b8543291e7e021448ddff1.tar.gz samba-d05e17f875300615c0b8543291e7e021448ddff1.tar.bz2 samba-d05e17f875300615c0b8543291e7e021448ddff1.zip |
s3: Introduce domain_is_forest_root() helper function
Hopefully this makes the flag tests a bit more understandable
Diffstat (limited to 'source3/winbindd/winbindd_util.c')
-rw-r--r-- | source3/winbindd/winbindd_util.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/source3/winbindd/winbindd_util.c b/source3/winbindd/winbindd_util.c index 17603820d4..5442a90cdf 100644 --- a/source3/winbindd/winbindd_util.c +++ b/source3/winbindd/winbindd_util.c @@ -223,6 +223,14 @@ done: return domain; } +bool domain_is_forest_root(const struct winbindd_domain *domain) +{ + const uint32_t fr_flags = + (NETR_TRUST_FLAG_TREEROOT|NETR_TRUST_FLAG_IN_FOREST); + + return ((domain->domain_flags & fr_flags) == fr_flags); +} + /******************************************************************** rescan our domains looking for new trusted domains ********************************************************************/ @@ -243,8 +251,6 @@ static void add_trusted_domains( struct winbindd_domain *domain ) TALLOC_CTX *mem_ctx; struct winbindd_request *request; struct winbindd_response *response; - uint32 fr_flags = (NETR_TRUST_FLAG_TREEROOT|NETR_TRUST_FLAG_IN_FOREST); - struct trustdom_state *state; mem_ctx = talloc_init("add_trusted_domains"); @@ -269,7 +275,7 @@ static void add_trusted_domains( struct winbindd_domain *domain ) /* Flags used to know how to continue the forest trust search */ state->primary = domain->primary; - state->forest_root = ((domain->domain_flags & fr_flags) == fr_flags ); + state->forest_root = domain_is_forest_root(domain); request->length = sizeof(*request); request->cmd = WINBINDD_LIST_TRUSTDOM; |