summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPino Toscano <toscano.pino@tiscali.it>2023-05-08 08:55:42 +0200
committerPino Toscano <toscano.pino@tiscali.it>2023-05-11 07:16:06 +0200
commitcbe0839c89116e9c33f35b3fe185c63493ec34b2 (patch)
tree575091cbfc184cf1a12233b4d896e679924e05d0
parent4aec21a15e0611d717b3c45fcf36e6356e96c46c (diff)
downloadlinux-pam-git-cbe0839c89116e9c33f35b3fe185c63493ec34b2.tar.gz
pam_timestamp: do not assume PATH_MAX is defined
PATH_MAX is optional in POSIX, and not defined on GNU/Hurd; hence, in case it is not defined, define BUFLEN directly to LINE_MAX.
-rw-r--r--modules/pam_timestamp/pam_timestamp.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/modules/pam_timestamp/pam_timestamp.c b/modules/pam_timestamp/pam_timestamp.c
index c5fa6dfc..4bb556e4 100644
--- a/modules/pam_timestamp/pam_timestamp.c
+++ b/modules/pam_timestamp/pam_timestamp.c
@@ -82,7 +82,9 @@
/* Various buffers we use need to be at least as large as either PATH_MAX or
* LINE_MAX, so choose the larger of the two. */
-#if (LINE_MAX > PATH_MAX)
+#ifndef PATH_MAX
+#define BUFLEN LINE_MAX
+#elif (LINE_MAX > PATH_MAX)
#define BUFLEN LINE_MAX
#else
#define BUFLEN PATH_MAX