summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Squyres <jsquyres@cisco.com>2021-04-30 15:16:38 -0700
committerTomáš Mráz <tm@t8m.info>2021-06-14 09:03:08 +0200
commit55f206447a1e4ee26e307e7a9c069236e823b1a5 (patch)
tree57666d35c26bb08871f4d5f221d48064b7c666af
parentb3bb13e18a74e9ece825b7de1b81db97ebb107a0 (diff)
downloadlinux-pam-git-55f206447a1e4ee26e307e7a9c069236e823b1a5.tar.gz
pam_misc: make length of misc_conv() configurable
Add --with-misc-conv-bufsize=<number> option to configure to allow a longer buffer size for libpam_misc's misc_conv() function (it still defaults to 512 bytes). Signed-off-by: Jeff Squyres <jsquyres@cisco.com>
-rw-r--r--configure.ac7
-rw-r--r--libpam_misc/misc_conv.c2
2 files changed, 8 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index 9c92d0de..b283db1b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -648,6 +648,13 @@ case "$enable_unix" in
*) AC_MSG_ERROR([bad value $enable_unix for --enable-unix option]) ;;
esac
+AC_ARG_WITH([misc-conv-bufsize],
+AS_HELP_STRING([--with-misc-conv-bufsize=<number>],
+ [Size of input buffer for libpam_misc's misc_conv() conversation function, default=512]),
+ [],
+ [with_misc_conv_bufsize=512])
+AC_DEFINE_UNQUOTED(PAM_MISC_CONV_BUFSIZE, $with_misc_conv_bufsize, [libpam_misc misc_conv() buffer size.])
+
AM_CONDITIONAL([COND_BUILD_PAM_KEYINIT], [test "$have_key_syscalls" = 1])
AM_CONDITIONAL([COND_BUILD_PAM_LASTLOG], [test "$ac_cv_func_logwtmp" = yes])
AM_CONDITIONAL([COND_BUILD_PAM_NAMESPACE], [test "$ac_cv_func_unshare" = yes])
diff --git a/libpam_misc/misc_conv.c b/libpam_misc/misc_conv.c
index f28b1093..908ee890 100644
--- a/libpam_misc/misc_conv.c
+++ b/libpam_misc/misc_conv.c
@@ -18,7 +18,7 @@
#include <security/pam_appl.h>
#include <security/pam_misc.h>
-#define INPUTSIZE PAM_MAX_RESP_SIZE /* maximum length of input+1 */
+#define INPUTSIZE PAM_MISC_CONV_BUFSIZE /* maximum length of input+1 */
#define CONV_ECHO_ON 1 /* types of echo state */
#define CONV_ECHO_OFF 0