From 9d806fdb9510fc61233a7deca92ee2dae581f751 Mon Sep 17 00:00:00 2001 From: jcj83429 Date: Sat, 22 Jun 2024 18:42:35 -0700 Subject: [PATCH] Fix unix login with yescrypt hashed passwords Increase the MAX_DATA_SIZE when libxcrypt is used to accomodate yescrypt. This was discussed in https://forums.fedoraforum.org/showthread.php?332193-Problems-with-unix-authentication-in-pure-ftpd&p=1881101 --- src/ftpd.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/ftpd.h b/src/ftpd.h index e2f4516a..ebcb190c 100644 --- a/src/ftpd.h +++ b/src/ftpd.h @@ -168,6 +168,9 @@ #ifdef HAVE_CRYPT_H # include +# ifdef XCRYPT_VERSION_NUM +# define HAVE_YESCRYPT 1 +# endif #endif #ifdef USE_SHADOW @@ -558,8 +561,10 @@ Your platform has a very large PATH_MAX, we should not trust it. #ifndef MAX_DATA_SIZE # ifdef HAVE_LIBSODIUM # define MAX_DATA_SIZE (70 * 1024 * 1024) +# elif defined(HAVE_YESCRYPT) +# define MAX_DATA_SIZE (32 * 1024 * 1024) /* Max memory usage - yescrypt needs 32M */ # elif defined(WITH_LDAP) || defined(WITH_MYSQL) || defined(WITH_PGSQL) -# define MAX_DATA_SIZE (16 * 1024 * 1024) /* Max memory usage - SQL/LDAP need more */ +# define MAX_DATA_SIZE (16 * 1024 * 1024) /* Max memory usage - SQL/LDAP need 16M */ # else # define MAX_DATA_SIZE (8 * 1024 * 1024) /* Max memory usage */ # endif