summaryrefslogtreecommitdiff
path: root/lib/nss_wrapper
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2014-10-09 09:16:33 +0200
committerAndreas Schneider <asn@cryptomilk.org>2014-10-09 12:24:03 +0200
commit2bbd403f39eb5bc6025014fe1514751dd5872207 (patch)
tree445479e3e4f57d7d74b25ebd148ac0f5e9b3fb92 /lib/nss_wrapper
parent895b32b2e39417072bc40afeb21293a08181399f (diff)
downloadsamba-2bbd403f39eb5bc6025014fe1514751dd5872207.tar.gz
nwrap: Use DNS_NAME_MAX cause it is not available on BSD.
Also HOST_NAME_MAX is only for the value returned by gethostname(). It is normally limited to 64 chars on Linux. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'lib/nss_wrapper')
-rw-r--r--lib/nss_wrapper/nss_wrapper.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/nss_wrapper/nss_wrapper.c b/lib/nss_wrapper/nss_wrapper.c
index 931aaa5989b..c066e47f51d 100644
--- a/lib/nss_wrapper/nss_wrapper.c
+++ b/lib/nss_wrapper/nss_wrapper.c
@@ -49,7 +49,6 @@
#include <string.h>
#include <unistd.h>
#include <ctype.h>
-#include <limits.h>
/*
* Defining _POSIX_PTHREAD_SEMANTICS before including pwd.h and grp.h gives us
@@ -122,6 +121,10 @@ typedef nss_status_t NSS_STATUS;
#define __location__ __FILE__ ":" __LINESTR__
#endif
+#ifndef DNS_NAME_MAX
+#define DNS_NAME_MAX 255
+#endif
+
/* GCC have printf type attribute check. */
#ifdef HAVE_ATTRIBUTE_PRINTF_FORMAT
#define PRINTF_ATTRIBUTE(a,b) __attribute__ ((__format__ (__printf__, a, b)))
@@ -2352,7 +2355,7 @@ static void nwrap_files_endgrent(struct nwrap_backend *b)
static struct hostent *nwrap_files_gethostbyname(const char *name, int af)
{
struct hostent *he;
- char canon_name[HOST_NAME_MAX] = { 0 };
+ char canon_name[DNS_NAME_MAX] = { 0 };
size_t name_len;
int i;