From: Sunil Nimmagadda Date: Thu, 5 Nov 2020 07:03:09 +0000 (+0530) Subject: Fallback definition for HOST_NAME_MAX. X-Git-Tag: v6.8~31 X-Git-Url: https://git.armaanb.net/atreides/tree/README.md?p=opendoas.git;a=commitdiff_plain;h=b1ae418af40289ea4f40449a819df26ee3bdd399 Fallback definition for HOST_NAME_MAX. On some platforms(NetBSD) where HOST_NAME_MAX is not defined, provide a fallback definition to _POSIX_HOST_NAME_MAX. --- diff --git a/pam.c b/pam.c index c5a3001..ccebd0f 100644 --- a/pam.c +++ b/pam.c @@ -271,6 +271,9 @@ pamauth(const char *user, const char *myname, int interactive, int nopass, int p if (!interactive) errx(1, "Authorization required"); +#ifndef HOST_NAME_MAX +#define HOST_NAME_MAX _POSIX_HOST_NAME_MAX +#endif /* doas style prompt for pam */ char host[HOST_NAME_MAX + 1]; if (gethostname(host, sizeof(host)))