[Openvpn-devel] auth-pam.c: add missing include limits.h

Message ID 20220421131909.32053-1-a@unstable.cc
State Accepted
Headers show
Series [Openvpn-devel] auth-pam.c: add missing include limits.h | expand

Commit Message

Antonio Quartulli April 21, 2022, 3:19 a.m. UTC
On most systems limits.h is pulled in by some other header and thus no
error is ever triggered, but it's possible to find the right environment
which lackis this and prevents compiling auth-pam.c (possibly when using
LibreSSL).

Include the header explicitly as it includes the definition of PATH_MAX.

(note that this bug is fixed in Gentoo since 2020 by including a custom
patch, but apparently the issue was never reported upstream)

Reported-by: Michelangelo Scopelliti <kernelpanic@gmx.com>
Signed-off-by: Antonio Quartulli <a@unstable.cc>
---
 src/plugins/auth-pam/auth-pam.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Gert Doering April 22, 2022, 1:48 a.m. UTC | #1
Acked-by: Gert Doering <gert@greenie.muc.de>

Sounds reasonable, and <limits.h> is standard.  Test compiled on FreeBSD.

Your patch has been applied to the master and release/2.5 branch.

commit 0fed64a91d894b46105bf7e8b16edea4d90ab70c (master)
commit 70b6c69c8255ebd6e789e59b0fe8e106a35e9ad8 (release/2.5)
Author: Antonio Quartulli
Date:   Thu Apr 21 15:19:09 2022 +0200

     auth-pam.c: add missing include limits.h

     Signed-off-by: Antonio Quartulli <a@unstable.cc>
     Acked-by: Gert Doering <gert@greenie.muc.de>
     Message-Id: <20220421131909.32053-1-a@unstable.cc>
     URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg24136.html
     Signed-off-by: Gert Doering <gert@greenie.muc.de>


--
kind regards,

Gert Doering

Patch

diff --git a/src/plugins/auth-pam/auth-pam.c b/src/plugins/auth-pam/auth-pam.c
index f893b51f..70339445 100644
--- a/src/plugins/auth-pam/auth-pam.c
+++ b/src/plugins/auth-pam/auth-pam.c
@@ -47,6 +47,7 @@ 
 #include <fcntl.h>
 #include <signal.h>
 #include <syslog.h>
+#include <limits.h>
 #include "utils.h"
 
 #include <openvpn-plugin.h>