summaryrefslogtreecommitdiff
path: root/net-ftp/pure-ftpd/files/pure-ftpd-1.0.49-quota_maxfile_size_check.patch
diff options
context:
space:
mode:
Diffstat (limited to 'net-ftp/pure-ftpd/files/pure-ftpd-1.0.49-quota_maxfile_size_check.patch')
-rw-r--r--net-ftp/pure-ftpd/files/pure-ftpd-1.0.49-quota_maxfile_size_check.patch25
1 files changed, 25 insertions, 0 deletions
diff --git a/net-ftp/pure-ftpd/files/pure-ftpd-1.0.49-quota_maxfile_size_check.patch b/net-ftp/pure-ftpd/files/pure-ftpd-1.0.49-quota_maxfile_size_check.patch
new file mode 100644
index 000000000000..8b1877366c20
--- /dev/null
+++ b/net-ftp/pure-ftpd/files/pure-ftpd-1.0.49-quota_maxfile_size_check.patch
@@ -0,0 +1,25 @@
+From fb93975777a1cffba80544e08ca81606532395d6 Mon Sep 17 00:00:00 2001
+From: DroidTest <53651584+DroidTest@users.noreply.github.com>
+Date: Thu, 29 Jul 2021 11:36:26 +0800
+Subject: [PATCH] fix the maxfile_size checking bug
+
+Fix the predicate that never evaluates true
+---
+ src/ftpd.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/ftpd.c b/src/ftpd.c
+index d856839..61275de 100644
+--- a/src/ftpd.c
++++ b/src/ftpd.c
+@@ -4247,8 +4247,8 @@ void dostor(char *name, const int append, const int autorename)
+ if (quota_update(&quota, 0LL, 0LL, &overflow) == 0 &&
+ (overflow > 0 || quota.files >= user_quota_files ||
+ quota.size > user_quota_size ||
+- (max_filesize >= (off_t) 0 &&
+- (max_filesize = user_quota_size - quota.size) < (off_t) 0))) {
++ ((max_filesize = user_quota_size - quota.size) < (off_t) 0 &&
++ max_filesize >= (off_t) 0))) {
+ overflow = 1;
+ (void) close(f);
+ goto afterquota;