s3-rpc_server: Rename dcesrv_ntlmssp.[ch] to dcesrv_auth_generic.[ch]
[mat/samba.git] / nsswitch / winbind_krb5_locator.c
index 272e7dbab153bacc2a28a468e88a31bbce23228f..e921caea5939af95213435ddc780b0372b2f0fd6 100644 (file)
 
 #if defined(HAVE_KRB5) && defined(HAVE_KRB5_LOCATE_PLUGIN_H)
 
-#include <krb5/krb5.h>
+#if HAVE_COM_ERR_H
+#include <com_err.h>
+#endif
+
+#include <krb5.h>
 #include <krb5/locate_plugin.h>
 
 #ifndef KRB5_PLUGIN_NO_HANDLE
@@ -188,7 +192,7 @@ static krb5_error_code smb_krb5_locator_call_cbfunc(const char *name,
                        break;
                }
 
-               if (ret == EAI_AGAIN) {
+               if ((ret == EAI_AGAIN) && (count > 1)) {
                        count--;
                        continue;
                }