mirror of
https://github.com/samba-team/samba.git
synced 2024-12-25 23:21:54 +03:00
Added free_domain_info() function.
Get list of trusted domains if we haven't fetched them yet.
This commit is contained in:
parent
1a9a361591
commit
ed16aa88a4
@ -118,6 +118,27 @@ BOOL get_domain_info(void)
|
||||
return rv;
|
||||
}
|
||||
|
||||
/* Free global domain info */
|
||||
|
||||
void free_domain_info(void)
|
||||
{
|
||||
struct winbindd_domain *domain;
|
||||
|
||||
/* Free list of domains */
|
||||
|
||||
if (domain_list) {
|
||||
struct winbindd_domain *next_domain;
|
||||
|
||||
domain = domain_list;
|
||||
|
||||
while(domain) {
|
||||
next_domain = domain->next;
|
||||
free(domain);
|
||||
domain = next_domain;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Connect to a domain controller using get_any_dc_name() to discover
|
||||
the domain name and sid */
|
||||
|
||||
@ -420,6 +441,9 @@ struct winbindd_domain *find_domain_from_name(char *domain_name)
|
||||
{
|
||||
struct winbindd_domain *tmp;
|
||||
|
||||
if (domain_list == NULL)
|
||||
get_domain_info();
|
||||
|
||||
/* Search through list */
|
||||
|
||||
for (tmp = domain_list; tmp != NULL; tmp = tmp->next) {
|
||||
@ -438,6 +462,9 @@ struct winbindd_domain *find_domain_from_sid(DOM_SID *sid)
|
||||
{
|
||||
struct winbindd_domain *tmp;
|
||||
|
||||
if (domain_list == NULL)
|
||||
get_domain_info();
|
||||
|
||||
/* Search through list */
|
||||
|
||||
for (tmp = domain_list; tmp != NULL; tmp = tmp->next) {
|
||||
|
Loading…
Reference in New Issue
Block a user