summaryrefslogtreecommitdiff
path: root/source3/nsswitch
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2001-11-15 03:34:27 +0000
committerTim Potter <tpot@samba.org>2001-11-15 03:34:27 +0000
commitc5ceae9dc95bb8e0e8a2067c481f394b752f46e7 (patch)
tree2351bf9106020e07037ccf4e8774192ea516bfcc /source3/nsswitch
parent6121a6c9e4f11e3204e3092eec99665c81960aea (diff)
downloadsamba-c5ceae9dc95bb8e0e8a2067c481f394b752f46e7.tar.gz
samba-c5ceae9dc95bb8e0e8a2067c481f394b752f46e7.tar.bz2
samba-c5ceae9dc95bb8e0e8a2067c481f394b752f46e7.zip
Added free_domain_info() function.
Get list of trusted domains if we haven't fetched them yet. (This used to be commit ed16aa88a422e759d27dbfae39afc72250c80e8d)
Diffstat (limited to 'source3/nsswitch')
-rw-r--r--source3/nsswitch/winbindd_util.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/source3/nsswitch/winbindd_util.c b/source3/nsswitch/winbindd_util.c
index 6a0a5389ef..1b63cd2810 100644
--- a/source3/nsswitch/winbindd_util.c
+++ b/source3/nsswitch/winbindd_util.c
@@ -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) {