1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-12 20:58:37 +03:00

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>
This commit is contained in:
Andreas Schneider 2014-10-09 09:16:33 +02:00 committed by Andreas Schneider
parent 895b32b2e3
commit 2bbd403f39

View File

@ -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;