r22392: Remove leftover potentially segfaulty code.
authorSimo Sorce <idra@samba.org>
Thu, 19 Apr 2007 23:15:33 +0000 (23:15 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:19:30 +0000 (12:19 -0500)
Check we are online before actually trying to connect anywhere

source/nsswitch/idmap_ad.c

index 9daa0024ea3bd562ed6823cfda7a3a6e66e9d2bd..e15e4b90fb8f7d71a2dd86968048620fa6e9bdf5 100644 (file)
@@ -695,9 +695,6 @@ static NTSTATUS nss_sfu_init( struct nss_domain_entry *e )
        
        ad_map_type =  WB_POSIX_MAP_SFU;        
 
-       if ( !ad_idmap_ads ) 
-               return idmap_ad_initialize(NULL);
-
        return NT_STATUS_OK;
 }
 
@@ -716,9 +713,6 @@ static NTSTATUS nss_rfc2307_init( struct nss_domain_entry *e )
        
        ad_map_type =  WB_POSIX_MAP_RFC2307;
 
-       if ( !ad_idmap_ads ) 
-               return idmap_ad_initialize(NULL);       
-
        return NT_STATUS_OK;
 }
 
@@ -737,6 +731,11 @@ static NTSTATUS nss_ad_get_info( struct nss_domain_entry *e,
 {
        ADS_STRUCT *ads_internal = NULL;
 
+       /* Only do query if we are online */
+       if (idmap_is_offline()) {
+               return NT_STATUS_FILE_IS_OFFLINE;
+       }
+
        /* We are assuming that the internal ADS_STRUCT is for the 
           same forest as the incoming *ads pointer */