From da84e2a7568eac084ad04793d60523c63ec664c3 Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Fri, 11 Jan 2002 05:33:45 +0000 Subject: Always query the PDC for the list of trusted domains rather than interating the list received at startup or we get an out of date list. I thought there might be some sequence number that is incremented when a trusted domain is added or removed - perhaps there is but I just haven't found it yet. - Renamed get_domain_info() to init_domain_list() - Made an accessor function to return the list of trusted domains rather than using a global so we don't have to remember to put a magic init function - The getent state can not keep a pointer to a winbind_domain structure as it may be freed if init_domain_list() is called again so we keep the domain name instead (This used to be commit 37216c649a394b449eaaaa6644709eafb3bf37ff) --- source3/nsswitch/winbindd.h | 43 ++++++++++++++++++++++++++----------------- 1 file changed, 26 insertions(+), 17 deletions(-) (limited to 'source3/nsswitch/winbindd.h') diff --git a/source3/nsswitch/winbindd.h b/source3/nsswitch/winbindd.h index 74206da9ef..a8b9980be3 100644 --- a/source3/nsswitch/winbindd.h +++ b/source3/nsswitch/winbindd.h @@ -52,7 +52,7 @@ struct getent_state { void *sam_entries; uint32 sam_entry_index, num_sam_entries; BOOL got_sam_entries; - struct winbindd_domain *domain; + fstring domain_name; }; /* Storage for cached getpwent() user entries */ @@ -82,6 +82,31 @@ typedef struct { uint32 group_rid; /* primary group */ } WINBIND_USERINFO; +/* Structures to hold per domain information */ + +struct winbindd_domain { + fstring name; /* Domain name */ + fstring full_name; /* full Domain name (realm) */ + DOM_SID sid; /* SID for this domain */ + + /* Lookup methods for this domain (LDAP or RPC) */ + + struct winbindd_methods *methods; + + /* Private data for the backends (used for connection cache) */ + + void *private; + + /* Sequence number stuff */ + + time_t last_seq_check; + uint32 sequence_number; + + /* Linked list info */ + + struct winbindd_domain *prev, *next; +}; + /* per-domain methods. This is how LDAP vs RPC is selected */ struct winbindd_methods { @@ -150,22 +175,6 @@ struct winbindd_methods { DOM_SID *sid); }; -/* Structures to hold per domain information */ -struct winbindd_domain { - fstring name; /* Domain name */ - fstring full_name; /* full Domain name (realm) */ - DOM_SID sid; /* SID for this domain */ - struct winbindd_methods *methods; /* lookup methods for - this domain (LDAP or - RPC) */ - void *private; /* private data for the backends (used for connection cache) */ - time_t last_seq_check; - uint32 sequence_number; - struct winbindd_domain *prev, *next; /* Linked list info */ -}; - -extern struct winbindd_domain *domain_list; /* List of domains we know */ - /* Used to glue a policy handle and cli_state together */ typedef struct { -- cgit