diff options
author | Gerald Carter <jerry@samba.org> | 2003-08-10 22:01:11 +0000 |
---|---|---|
committer | Gerald Carter <jerry@samba.org> | 2003-08-10 22:01:11 +0000 |
commit | d5d9055b9be3960864ae479d52e587865648cbf0 (patch) | |
tree | 9e9e92f88c1e9cb52fb02bef45622f5776681bdf /source3/nsswitch/winbindd_group.c | |
parent | ce7d025b20bd444f2aace6f7ad719ac2702223a0 (diff) | |
download | samba-d5d9055b9be3960864ae479d52e587865648cbf0.tar.gz samba-d5d9055b9be3960864ae479d52e587865648cbf0.tar.bz2 samba-d5d9055b9be3960864ae479d52e587865648cbf0.zip |
add --domain=DOMAINNAME to wbinfo
Add support for geting the sequence number, list of users, and list
of groups for a specific domain (assuming on reported back by
wbinfo -m)
wbinfo -u --domain=DOA
(This used to be commit 34fc6e1bf97d514d3b1763a808d08d730191e03b)
Diffstat (limited to 'source3/nsswitch/winbindd_group.c')
-rw-r--r-- | source3/nsswitch/winbindd_group.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/source3/nsswitch/winbindd_group.c b/source3/nsswitch/winbindd_group.c index 96c121685a..fba427536c 100644 --- a/source3/nsswitch/winbindd_group.c +++ b/source3/nsswitch/winbindd_group.c @@ -821,17 +821,29 @@ enum winbindd_result winbindd_list_groups(struct winbindd_cli_state *state) { uint32 total_entries = 0; struct winbindd_domain *domain; + const char *which_domain; char *extra_data = NULL; char *ted = NULL; unsigned int extra_data_len = 0, i; DEBUG(3, ("[%5lu]: list groups\n", (unsigned long)state->pid)); + /* Ensure null termination */ + state->request.domain_name[sizeof(state->request.domain_name)-1]='\0'; + which_domain = state->request.domain_name; + /* Enumerate over trusted domains */ for (domain = domain_list(); domain; domain = domain->next) { struct getent_state groups; + /* if we have a domain name restricting the request and this + one in the list doesn't match, then just bypass the remainder + of the loop */ + + if ( *which_domain && !strequal(which_domain, domain->name) ) + continue; + ZERO_STRUCT(groups); /* Get list of sam groups */ |