opendoas

my fork of doas with custom prompt
git clone git://git.kocotian.pl/opendoas.git
Log | Files | Refs | README | LICENSE

commit 46a5abc4ac149c98f7a67ef953b5d48710fad110
parent fd03103c045c958756f5f3f03f13604bd80eaa1d
Author: Duncan Overbruck <mail@duncano.de>
Date:   Thu, 12 Nov 2020 14:11:05 +0100

move HOST_NAME_MAX to the top and add it to shadow.c

Diffstat:
Mpam.c | 7++++---
Mshadow.c | 4++++
2 files changed, 8 insertions(+), 3 deletions(-)

diff --git 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 @@ -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) {