From b83626676ca37437e62b826923fbd1d985eb7ce6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnther=20Deschner?= Date: Wed, 29 Aug 2007 10:12:43 +0000 Subject: [PATCH] r24769: Merge error handling for locator plugin. Guenther --- source/libads/smb_krb5_locator.c | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/source/libads/smb_krb5_locator.c b/source/libads/smb_krb5_locator.c index 33f2a414d0a..5f90c71a2bd 100644 --- a/source/libads/smb_krb5_locator.c +++ b/source/libads/smb_krb5_locator.c @@ -24,10 +24,14 @@ #endif #if defined(HAVE_KRB5) && defined(HAVE_KRB5_LOCATE_PLUGIN_H) -BOOL winbind_env_set( void ); +BOOL winbind_env_set(void); #include +#ifndef KRB5_PLUGIN_NO_HANDLE +#define KRB5_PLUGIN_NO_HANDLE KRB5_KDC_UNREACH /* Heimdal */ +#endif + static const char *get_service_from_locate_service_type(enum locate_service_type svc) { switch (svc) { @@ -123,11 +127,7 @@ static int smb_krb5_locator_lookup_sanity_check(enum locate_service_type svc, break; case locate_service_kadmin: case locate_service_krb524: -#ifdef KRB5_PLUGIN_NO_HANDLE return KRB5_PLUGIN_NO_HANDLE; -#else - return KRB5_KDC_UNREACH; /* Heimdal */ -#endif default: return EINVAL; } @@ -137,11 +137,7 @@ static int smb_krb5_locator_lookup_sanity_check(enum locate_service_type svc, case AF_INET: break; case AF_INET6: /* not yet */ -#ifdef KRB5_PLUGIN_NO_HANDLE return KRB5_PLUGIN_NO_HANDLE; -#else - return KRB5_KDC_UNREACH; /* Heimdal */ -#endif default: return EINVAL; } @@ -198,11 +194,7 @@ static krb5_error_code smb_krb5_locator_call_cbfunc(const char *name, (unsigned int)getpid(), gai_strerror(ret), ret); #endif -#ifdef KRB5_PLUGIN_NO_HANDLE return KRB5_PLUGIN_NO_HANDLE; -#else - return KRB5_KDC_UNREACH; /* Heimdal */ -#endif } ret = cbfunc(cbdata, out->ai_socktype, out->ai_addr); @@ -365,11 +357,7 @@ krb5_error_code smb_krb5_locator_lookup(void *private_data, return ret; failed: -#ifdef KRB5_PLUGIN_NO_HANDLE return KRB5_PLUGIN_NO_HANDLE; -#else - return KRB5_KDC_UNREACH; /* Heimdal */ -#endif } #ifdef HEIMDAL_KRB5_LOCATE_PLUGIN_H