r21001: * Use a simple '#define LDAPMessage void' to fix the build
authorGerald Carter <jerry@samba.org>
Wed, 24 Jan 2007 14:39:46 +0000 (14:39 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:17:25 +0000 (12:17 -0500)
  problems in the nss_info interface when HAVE_LDAP is undefined.
* Revert previous ifdef HAVE_ADS brakets
* Remove an unused init function wrapper.

source/include/includes.h
source/include/nss_info.h
source/nsswitch/nss_info.c
source/nsswitch/nss_info_template.c
source/nsswitch/winbindd_ads.c

index da390c87ea983c61ad82923c02ac72f5a8f4cbd9..84bd90cc27f7eef83cf9af3a879273b52a160f6b 100644 (file)
@@ -777,9 +777,6 @@ enum flush_reason_enum {
 
 #ifdef HAVE_LDAP
 #include "ads_protos.h"
-#else
-struct _LDAPMessage;
-typedef struct _LDAPMessage *LDAPMessage;
 #endif
 
 /* We need this after proto.h to reference GetTimeOfDay(). */
index 2d7a5682e2f2bc325608180c11f7682ddfb2e7d1..50e5e8182a1bb835413a57335c8e9a44dfdcc6dc 100644 (file)
    Boston, MA  02111-1307, USA.   
 */
 
-#ifdef WITH_ADS
-
 #ifndef _IDMAP_NSS_H
 #define _IDMAP_NSS_H
 
+#ifndef HAVE_LDAP
+#  ifndef LDAPMessage
+#    define LDAPMessage void
+#  endif
+#endif
+
 /* The interface version specifier */
 
 #define SMB_NSS_INFO_INTERFACE_VERSION   1
@@ -84,9 +88,5 @@ NTSTATUS nss_get_info( const char *domain, const DOM_SID *user_sid,
 
 NTSTATUS nss_close( const char *parameters );
 
-NTSTATUS idmap_nss_init_domain( const char *domain );
-
-
 #endif /* _IDMAP_NSS_H_ */
 
-#endif /* WITH_ADS */
index 747de4a2ba801543e653956dc2d2664f871dc065..0b0caeee0222799fc1225b933c98ee86b791f346 100644 (file)
@@ -20,8 +20,6 @@
    Boston, MA  02111-1307, USA.   
 */
 
-#ifdef WITH_ADS
-
 #include "includes.h"
 #include "nss_info.h"
 
@@ -266,27 +264,3 @@ static BOOL parse_nss_parm( const char *config, char **backend, char **domain )
        return NT_STATUS_OK;
 }
 
-/********************************************************************
- Invoke the init function for a given domain's backend
- *******************************************************************/
-
- NTSTATUS idmap_nss_init_domain( const char *domain )
-{
-       struct nss_domain_entry *p;
-       
-       DEBUG(10,("idmap_nss_init_domain: Searching for %s's init() function\n", 
-                 domain));
-       
-       for ( p=nss_domain_list; p; p=p->next ) {
-               if ( strequal( p->domain, domain ) ) {
-                       DEBUG(10,("idmap_nss_init_domain: Calling init function for %s\n",
-                                 domain));                     
-                       return p->backend->methods->init( p );
-               }
-       }
-       
-       return NT_STATUS_NO_SUCH_DOMAIN;        
-}
-
-#endif /* WITH_ADS */
-
index 1b644d7b357a235f72954df515e65253b0fbb523..2a144288021ed03a232a34606732587c8563ee71 100644 (file)
@@ -20,8 +20,6 @@
    Boston, MA  02111-1307, USA.   
 */
 
-#ifdef WITH_ADS 
-
 #include "includes.h"
 #include "nss_info.h"
 
@@ -73,9 +71,9 @@ static NTSTATUS nss_template_close( void )
  ***********************************************************************/
 
 static struct nss_info_methods nss_template_methods = {
-       nss_template_init,
-       nss_template_get_info,
-       nss_template_close
+       .init         = nss_template_init,
+       .get_nss_info = nss_template_get_info,
+       .close_fn     = nss_template_close
 };
                
 NTSTATUS nss_info_template_init( void )
@@ -85,4 +83,3 @@ NTSTATUS nss_info_template_init( void )
                                      &nss_template_methods);   
 }
 
-#endif /* WITH_ADS */
index fc6308deedbde054948914d679ca9cf6a5b1a724..f572dd08ffa756526293849bfefad52747807f3b 100644 (file)
@@ -125,10 +125,6 @@ static ADS_STRUCT *ads_cached_connection(struct winbindd_domain *domain)
                return NULL;
        }
 
-       /* initialize the nss backend for this domain */
-
-       idmap_nss_init_domain( domain->name );
-
        /* set the flag that says we don't own the memory even 
           though we do so that ads_destroy() won't destroy the 
           structure we pass back by reference */