diff options
author | Gerald Carter <jerry@samba.org> | 2006-02-03 22:19:41 +0000 |
---|---|---|
committer | Gerald Carter <jerry@samba.org> | 2006-02-03 22:19:41 +0000 |
commit | 5831715049f2d460ce42299963a5defdc160891b (patch) | |
tree | 19a0c31c817c9bc26fd53485b5348ab4af127a23 /source/nsswitch/winbindd_misc.c | |
parent | e24ac859e7964714ed3b543300aadf77955af5bf (diff) | |
download | samba-5831715049f2d460ce42299963a5defdc160891b.tar.gz samba-5831715049f2d460ce42299963a5defdc160891b.tar.xz samba-5831715049f2d460ce42299963a5defdc160891b.zip |
r13316: Let the carnage begin....
Sync with trunk as off r13315
Diffstat (limited to 'source/nsswitch/winbindd_misc.c')
-rw-r--r-- | source/nsswitch/winbindd_misc.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/source/nsswitch/winbindd_misc.c b/source/nsswitch/winbindd_misc.c index 1fbf4b33df2..b6aecae3930 100644 --- a/source/nsswitch/winbindd_misc.c +++ b/source/nsswitch/winbindd_misc.c @@ -115,6 +115,7 @@ enum winbindd_result winbindd_dual_list_trusted_domains(struct winbindd_domain * int extra_data_len = 0; char *extra_data; NTSTATUS result; + BOOL have_own_domain = False; DEBUG(3, ("[%5lu]: list trusted domains\n", (unsigned long)state->pid)); @@ -137,6 +138,22 @@ enum winbindd_result winbindd_dual_list_trusted_domains(struct winbindd_domain * names[i], alt_names[i] ? alt_names[i] : names[i], sid_string_static(&sids[i])); + /* add our primary domain */ + + for (i=0; i<num_domains; i++) { + if (strequal(names[i], domain->name)) { + have_own_domain = True; + break; + } + } + + if (state->request.data.list_all_domains && !have_own_domain) { + extra_data = talloc_asprintf(state->mem_ctx, "%s\n%s\\%s\\%s", + extra_data, + domain->name, + domain->alt_name ? domain->alt_name : domain->name, + sid_string_static(&domain->sid)); + } /* This is a bit excessive, but the extra data sooner or later will be talloc'ed */ |