s3: Make open_file_ntcreate a bit easier to read
[kai/samba.git] / nsswitch / winbind_krb5_locator.c
index b9e35bdec5998bf7c6d31d57ab4b84a1ac88aa9b..e921caea5939af95213435ddc780b0372b2f0fd6 100644 (file)
 
 #if defined(HAVE_KRB5) && defined(HAVE_KRB5_LOCATE_PLUGIN_H)
 
+#if HAVE_COM_ERR_H
+#include <com_err.h>
+#endif
+
+#include <krb5.h>
 #include <krb5/locate_plugin.h>
 
 #ifndef KRB5_PLUGIN_NO_HANDLE
@@ -187,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;
                }