mirror of
https://github.com/samba-team/samba.git
synced 2025-01-12 09:18:10 +03:00
r24769: Merge error handling for locator plugin.
Guenther
This commit is contained in:
parent
4ca43172d9
commit
b83626676c
@ -24,10 +24,14 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(HAVE_KRB5) && defined(HAVE_KRB5_LOCATE_PLUGIN_H)
|
#if defined(HAVE_KRB5) && defined(HAVE_KRB5_LOCATE_PLUGIN_H)
|
||||||
BOOL winbind_env_set( void );
|
BOOL winbind_env_set(void);
|
||||||
|
|
||||||
#include <krb5/locate_plugin.h>
|
#include <krb5/locate_plugin.h>
|
||||||
|
|
||||||
|
#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)
|
static const char *get_service_from_locate_service_type(enum locate_service_type svc)
|
||||||
{
|
{
|
||||||
switch (svc) {
|
switch (svc) {
|
||||||
@ -123,11 +127,7 @@ static int smb_krb5_locator_lookup_sanity_check(enum locate_service_type svc,
|
|||||||
break;
|
break;
|
||||||
case locate_service_kadmin:
|
case locate_service_kadmin:
|
||||||
case locate_service_krb524:
|
case locate_service_krb524:
|
||||||
#ifdef KRB5_PLUGIN_NO_HANDLE
|
|
||||||
return KRB5_PLUGIN_NO_HANDLE;
|
return KRB5_PLUGIN_NO_HANDLE;
|
||||||
#else
|
|
||||||
return KRB5_KDC_UNREACH; /* Heimdal */
|
|
||||||
#endif
|
|
||||||
default:
|
default:
|
||||||
return EINVAL;
|
return EINVAL;
|
||||||
}
|
}
|
||||||
@ -137,11 +137,7 @@ static int smb_krb5_locator_lookup_sanity_check(enum locate_service_type svc,
|
|||||||
case AF_INET:
|
case AF_INET:
|
||||||
break;
|
break;
|
||||||
case AF_INET6: /* not yet */
|
case AF_INET6: /* not yet */
|
||||||
#ifdef KRB5_PLUGIN_NO_HANDLE
|
|
||||||
return KRB5_PLUGIN_NO_HANDLE;
|
return KRB5_PLUGIN_NO_HANDLE;
|
||||||
#else
|
|
||||||
return KRB5_KDC_UNREACH; /* Heimdal */
|
|
||||||
#endif
|
|
||||||
default:
|
default:
|
||||||
return EINVAL;
|
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);
|
(unsigned int)getpid(), gai_strerror(ret), ret);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef KRB5_PLUGIN_NO_HANDLE
|
|
||||||
return 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);
|
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;
|
return ret;
|
||||||
|
|
||||||
failed:
|
failed:
|
||||||
#ifdef KRB5_PLUGIN_NO_HANDLE
|
|
||||||
return KRB5_PLUGIN_NO_HANDLE;
|
return KRB5_PLUGIN_NO_HANDLE;
|
||||||
#else
|
|
||||||
return KRB5_KDC_UNREACH; /* Heimdal */
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HEIMDAL_KRB5_LOCATE_PLUGIN_H
|
#ifdef HEIMDAL_KRB5_LOCATE_PLUGIN_H
|
||||||
|
Loading…
Reference in New Issue
Block a user