From: Duncan Overbruck Date: Thu, 12 Nov 2020 13:11:05 +0000 (+0100) Subject: move HOST_NAME_MAX to the top and add it to shadow.c X-Git-Tag: v6.8~24 X-Git-Url: https://git.armaanb.net/?p=opendoas.git;a=commitdiff_plain;h=46a5abc4ac149c98f7a67ef953b5d48710fad110 move HOST_NAME_MAX to the top and add it to shadow.c --- diff --git a/pam.c b/pam.c index ccebd0f..1fc6082 100644 --- a/pam.c +++ b/pam.c @@ -37,6 +37,10 @@ #include "includes.h" +#ifndef HOST_NAME_MAX +#define HOST_NAME_MAX _POSIX_HOST_NAME_MAX +#endif + #define PAM_SERVICE_NAME "doas" static pam_handle_t *pamh = NULL; @@ -271,9 +275,6 @@ 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))) diff --git a/shadow.c b/shadow.c index 71c71c6..64cc1f7 100644 --- a/shadow.c +++ b/shadow.c @@ -18,6 +18,10 @@ #include "openbsd.h" +#ifndef HOST_NAME_MAX +#define HOST_NAME_MAX _POSIX_HOST_NAME_MAX +#endif + void shadowauth(const char *myname, int persist) {