summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--nslcd/common.h4
-rw-r--r--nslcd/pam.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/nslcd/common.h b/nslcd/common.h
index 6399506..9247911 100644
--- a/nslcd/common.h
+++ b/nslcd/common.h
@@ -105,7 +105,11 @@ int update_lastchange(MYLDAP_SESSION *session,const char *userdn);
/* fallback definition of HOST_NAME_MAX */
#ifndef HOST_NAME_MAX
+#ifdef _POSIX_HOST_NAME_MAX
+#define HOST_NAME_MAX _POSIX_HOST_NAME_MAX
+#else
#define HOST_NAME_MAX 255
+#endif /* _POSIX_HOST_NAME_MAX */
#endif /* not HOST_NAME_MAX */
/* these are the functions for initialising the database specific
diff --git a/nslcd/pam.c b/nslcd/pam.c
index 399d599..c0cefb9 100644
--- a/nslcd/pam.c
+++ b/nslcd/pam.c
@@ -38,10 +38,6 @@
#include "common/dict.h"
#include "common/expr.h"
-#ifndef HOST_NAME_MAX
-#define HOST_NAME_MAX 255
-#endif /* not HOST_NAME_MAX */
-
/* set up a connection and try to bind with the specified DN and password,
returns an LDAP result code */
static int try_bind(const char *userdn,const char *password)