public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Paul Howarth <paul@city-fan.org>
To: git-commits@fedoraproject.org
Subject: [rpms/proftpd] epel10.2: Fix some issues in mod_copy (not enabled by default)
Date: Fri, 06 Nov 2026 09:41:24 GMT [thread overview]
Message-ID: <179395808436.1.10456651346973990624.rpms-proftpd-d2ad68afe8d0@fedoraproject.org> (raw)
A new commit has been pushed.
Repo : rpms/proftpd
Branch : epel10.2
Commit : d2ad68afe8d038a77689850005c5846285fd652d
Author : Paul Howarth <paul@city-fan.org>
Date : 2026-11-06T08:45:12+00:00
Stats : +230/-1 in 3 file(s)
URL : https://src.fedoraproject.org/rpms/proftpd/c/d2ad68afe8d038a77689850005c5846285fd652d?branch=epel10.2
Log:
Fix some issues in mod_copy (not enabled by default)
- <Limit READ> configurations were not honored by SITE COPY as they should be
(GH#2095)
- Fix write restriction bypass via symlink following in mod_copy (GH#2374,
CVE-2026-119364)
---
diff --git a/proftpd-1.3.9e-gh2095.patch b/proftpd-1.3.9e-gh2095.patch
new file mode 100644
index 0000000..54debae
--- /dev/null
+++ b/proftpd-1.3.9e-gh2095.patch
@@ -0,0 +1,47 @@
+diff --git a/contrib/mod_copy.c b/contrib/mod_copy.c
+index bf725eebae..dd770c029d 100644
+--- a/contrib/mod_copy.c
++++ b/contrib/mod_copy.c
+@@ -571,7 +571,7 @@ MODRET copy_copy(cmd_rec *cmd) {
+ return PR_DECLINED(cmd);
+ }
+
+- if (strncasecmp(cmd->argv[1], "COPY", 5) == 0) {
++ if (strcasecmp(cmd->argv[1], "COPY") == 0) {
+ char *cmd_name, *decoded_path, *from, *to;
+ unsigned char *authenticated;
+
+@@ -625,14 +625,31 @@ MODRET copy_copy(cmd_rec *cmd) {
+
+ to = dir_canonical_vpath(cmd->tmp_pool, decoded_path);
+
++ cmd_name = cmd->argv[0];
++ pr_cmd_set_name(cmd, "SITE_COPY");
++ if (!dir_check(cmd->tmp_pool, cmd, G_READ, from, NULL)) {
++ int xerrno = EPERM;
++
++ pr_cmd_set_name(cmd, cmd_name);
++ pr_log_debug(DEBUG8, "%s %s denied by <Limit> configuration",
++ (char *) cmd->argv[0], from);
++ pr_response_add_err(R_550, "%s: %s", (char *) cmd->argv[2],
++ strerror(xerrno));
++
++ pr_cmd_set_errno(cmd, xerrno);
++ errno = xerrno;
++ return PR_ERROR(cmd);
++ }
++ pr_cmd_set_name(cmd, cmd_name);
++
+ cmd_name = cmd->argv[0];
+ pr_cmd_set_name(cmd, "SITE_COPY");
+ if (!dir_check(cmd->tmp_pool, cmd, G_WRITE, to, NULL)) {
+ int xerrno = EPERM;
+
+ pr_cmd_set_name(cmd, cmd_name);
+- pr_log_debug(DEBUG8, "%s denied by <Limit> configuration",
+- (char *) cmd->argv[0]);
++ pr_log_debug(DEBUG8, "%s %s denied by <Limit> configuration",
++ (char *) cmd->argv[0], to);
+ pr_response_add_err(R_550, "%s: %s", (char *) cmd->argv[3],
+ strerror(xerrno));
+
diff --git a/proftpd-1.3.9e-gh2374.patch b/proftpd-1.3.9e-gh2374.patch
new file mode 100644
index 0000000..53648f5
--- /dev/null
+++ b/proftpd-1.3.9e-gh2374.patch
@@ -0,0 +1,162 @@
+commit 191e11052229004599b00f71400c4ba3f038bbac
+Author: TJ Saunders <tj@castaglia.org>
+Date: Tue May 19 17:16:11 2026 -0700
+
+ While working on mod_copy, I added a regression test for `<Anonymous>` configurations, and noticed some logging nits, now addressed.
+
+diff --git a/contrib/mod_copy.c b/contrib/mod_copy.c
+index dd770c029..024070911 100644
+--- a/contrib/mod_copy.c
++++ b/contrib/mod_copy.c
+@@ -631,8 +631,8 @@ MODRET copy_copy(cmd_rec *cmd) {
+ int xerrno = EPERM;
+
+ pr_cmd_set_name(cmd, cmd_name);
+- pr_log_debug(DEBUG8, "%s %s denied by <Limit> configuration",
+- (char *) cmd->argv[0], from);
++ pr_log_debug(DEBUG8, "%s %s %s denied by <Limit> configuration",
++ (char *) cmd->argv[0], (char *) cmd->argv[1], from);
+ pr_response_add_err(R_550, "%s: %s", (char *) cmd->argv[2],
+ strerror(xerrno));
+
+@@ -648,8 +648,8 @@ MODRET copy_copy(cmd_rec *cmd) {
+ int xerrno = EPERM;
+
+ pr_cmd_set_name(cmd, cmd_name);
+- pr_log_debug(DEBUG8, "%s %s denied by <Limit> configuration",
+- (char *) cmd->argv[0], to);
++ pr_log_debug(DEBUG8, "%s %s %s denied by <Limit> configuration",
++ (char *) cmd->argv[0], (char *) cmd->argv[1], to);
+ pr_response_add_err(R_550, "%s: %s", (char *) cmd->argv[3],
+ strerror(xerrno));
+
+@@ -697,7 +697,7 @@ MODRET copy_cpfr(cmd_rec *cmd) {
+ }
+
+ if (cmd->argc < 3 ||
+- strncasecmp(cmd->argv[1], "CPFR", 5) != 0) {
++ strcasecmp(cmd->argv[1], "CPFR") != 0) {
+ return PR_DECLINED(cmd);
+ }
+
+@@ -743,10 +743,9 @@ MODRET copy_cpfr(cmd_rec *cmd) {
+ int xerrno = EPERM;
+
+ pr_cmd_set_name(cmd, cmd_name);
+- pr_log_debug(DEBUG8, "%s denied by <Limit> configuration",
+- (char *) cmd->argv[0]);
+- pr_response_add_err(R_550, "%s: %s", (char *) cmd->argv[3],
+- strerror(xerrno));
++ pr_log_debug(DEBUG8, "%s %s %s denied by <Limit> configuration",
++ (char *) cmd->argv[0], (char *) cmd->argv[1], path);
++ pr_response_add_err(R_550, "%s: %s", path, strerror(xerrno));
+
+ pr_cmd_set_errno(cmd, xerrno);
+ errno = xerrno;
+@@ -806,7 +805,7 @@ MODRET copy_cpfr(cmd_rec *cmd) {
+
+ MODRET copy_cpto(cmd_rec *cmd) {
+ register unsigned int i;
+- const char *from, *to = "";
++ const char *from, *to = "", *resolved_to;
+ char *cmd_name;
+ unsigned char *authenticated = NULL;
+
+@@ -815,7 +814,7 @@ MODRET copy_cpto(cmd_rec *cmd) {
+ }
+
+ if (cmd->argc < 3 ||
+- strncasecmp(cmd->argv[1], "CPTO", 5) != 0) {
++ strcasecmp(cmd->argv[1], "CPTO") != 0) {
+ return PR_DECLINED(cmd);
+ }
+
+@@ -864,16 +863,16 @@ MODRET copy_cpto(cmd_rec *cmd) {
+ to = pstrcat(cmd->tmp_pool, to, *to ? " " : "", decoded_path, NULL);
+ }
+
+- to = dir_canonical_vpath(cmd->tmp_pool, to);
++ resolved_to = dir_canonical_vpath(cmd->tmp_pool, to);
+
+ cmd_name = cmd->argv[0];
+ pr_cmd_set_name(cmd, "SITE_CPTO");
+- if (!dir_check(cmd->tmp_pool, cmd, G_WRITE, to, NULL)) {
++ if (!dir_check(cmd->tmp_pool, cmd, G_WRITE, resolved_to, NULL)) {
+ int xerrno = EPERM;
+
+ pr_cmd_set_name(cmd, cmd_name);
+- pr_log_debug(DEBUG8, "%s denied by <Limit> configuration",
+- (char *) cmd->argv[0]);
++ pr_log_debug(DEBUG8, "%s %s %s denied by <Limit> configuration",
++ (char *) cmd->argv[0], (char *) cmd->argv[1], to);
+ pr_response_add_err(R_550, "%s: %s", to, strerror(xerrno));
+
+ pr_cmd_set_errno(cmd, xerrno);
+@@ -882,12 +881,12 @@ MODRET copy_cpto(cmd_rec *cmd) {
+ }
+ pr_cmd_set_name(cmd, cmd_name);
+
+- if (copy_paths(cmd->tmp_pool, from, to) < 0) {
++ if (copy_paths(cmd->tmp_pool, from, resolved_to) < 0) {
+ int xerrno = errno;
+ const char *err_code = R_550;
+
+ pr_log_debug(DEBUG7, MOD_COPY_VERSION
+- ": error copying '%s' to '%s': %s", from, to, strerror(xerrno));
++ ": error copying '%s' to '%s': %s", from, resolved_to, strerror(xerrno));
+
+ /* Check errno for EDQOUT (or the most appropriate alternative).
+ * (I hate the fact that FTP has a special response code just for
+@@ -912,8 +911,8 @@ MODRET copy_cpto(cmd_rec *cmd) {
+ break;
+ }
+
+- pr_response_add_err(err_code, "%s: %s", (char *) cmd->argv[1],
+- strerror(xerrno));
++ pr_response_add_err(err_code, "%s %s: %s", (char *) cmd->argv[0],
++ (char *) cmd->argv[1], strerror(xerrno));
+
+ pr_cmd_set_errno(cmd, xerrno);
+ errno = xerrno;
+From c41691f8981f98081fcb8a535c3c21b06a3f04af Mon Sep 17 00:00:00 2001
+From: TJ Saunders <tj@castaglia.org>
+Date: Sat, 17 Oct 2026 13:12:56 -0700
+Subject: [PATCH] Issue #2374: Resolve the destination path in order to handle
+ any potential symlinks, and use the resolved path for <Limit> checks.
+
+---
+ contrib/mod_copy.c | 14 ++++++++++++--
+ 1 file changed, 12 insertions(+), 2 deletions(-)
+
+diff --git a/contrib/mod_copy.c b/contrib/mod_copy.c
+index 51d62107e5..70f704f39a 100644
+--- a/contrib/mod_copy.c
++++ b/contrib/mod_copy.c
+@@ -593,7 +593,12 @@ MODRET copy_copy(cmd_rec *cmd) {
+ return PR_ERROR(cmd);
+ }
+
+- to = dir_canonical_vpath(cmd->tmp_pool, decoded_path);
++ pr_fs_clear_cache2(decoded_path);
++ to = dir_realpath(cmd->tmp_pool, decoded_path);
++ if (to == NULL) {
++ /* Try using dir_best_path(), as xfer_pre_stor() does. */
++ to = dir_best_path(cmd->tmp_pool, decoded_path);
++ }
+
+ cmd_name = cmd->argv[0];
+ pr_cmd_set_name(cmd, "SITE_COPY");
+@@ -833,7 +838,12 @@ MODRET copy_cpto(cmd_rec *cmd) {
+ to = pstrcat(cmd->tmp_pool, to, *to ? " " : "", decoded_path, NULL);
+ }
+
+- resolved_to = dir_canonical_vpath(cmd->tmp_pool, to);
++ pr_fs_clear_cache2(to);
++ resolved_to = dir_realpath(cmd->tmp_pool, to);
++ if (resolved_to == NULL) {
++ /* Try using dir_best_path(), as xfer_pre_stor() does. */
++ resolved_to = dir_best_path(cmd->tmp_pool, to);
++ }
+
+ cmd_name = cmd->argv[0];
+ pr_cmd_set_name(cmd, "SITE_CPTO");
diff --git a/proftpd.spec b/proftpd.spec
index daad5a1..3143183 100644
--- a/proftpd.spec
+++ b/proftpd.spec
@@ -17,7 +17,7 @@
%undefine _strict_symbol_defs_build
#global prever rc4
-%global baserelease 2
+%global baserelease 3
%global mod_procfs_version 0.3
%global mod_proxy_version 0.9.7
%global mod_vroot_version 0.9.12
@@ -46,6 +46,8 @@ Patch1: proftpd-1.3.8-shellbang.patch
Patch2: mod_proxy-certificate.patch
Patch3: proftpd-1.3.4rc1-mod_vroot-test.patch
Patch6: https://github.com/proftpd/proftpd/commit/933abc9a.patch
+Patch7: proftpd-1.3.9e-gh2095.patch
+Patch8: proftpd-1.3.9e-gh2374.patch
BuildRequires: coreutils
BuildRequires: gcc
@@ -235,6 +237,14 @@ mv contrib/README contrib/README.contrib
# https://github.com/proftpd/proftpd/issues/2411
%patch -P6 -p1 -b .gh2411
+# <Limit READ> configurations were not honored by SITE COPY as they should be
+# https://github.com/proftpd/proftpd/issues/2095
+%patch -P7 -p1 -b .gh2095
+
+# Fix write restriction bypass via symlink following in mod_copy (CVE-2026-119364)
+# https://github.com/proftpd/proftpd/issues/2374
+%patch -P8 -p1 -b .gh2374
+
# Tweak logrotate script for systemd compatibility (#802178)
sed -i -e '/killall/s/test.*/systemctl try-reload-or-restart proftpd.service/' \
contrib/dist/rpm/proftpd.logrotate
@@ -474,6 +484,13 @@ fi
%{_mandir}/man1/ftpwho.1*
%changelog
+* Thu Nov 5 2026 Paul Howarth <paul@city-fan.org> - 1.3.9e-3
+- Fix some issues in mod_copy (not enabled by default)
+ - <Limit READ> configurations were not honored by SITE COPY as they should be
+ (GH#2095)
+ - Fix write restriction bypass via symlink following in mod_copy (GH#2374,
+ CVE-2026-119364)
+
* Wed Oct 28 2026 Paul Howarth <paul@city-fan.org> - 1.3.9e-2
- Fix regression in the handling of private keys formatted using the
OpenSSH-specific private key format, and which are not passphrase-protected
@@ -500,6 +517,9 @@ fi
address to which UDP packets are sent (GH#2384)
- mod_ban SysV shared memory segment default permissions allow for local
unprivileged user read/write access (GH#2388)
+ - Guard against overly-long keys overflowing buffers when the "utf8trans"
+ builtin RewriteMap type is used (CVE-2026-119146)
+ - Fix authorization bypass via mod_sftp copy-file extension (CVE-2026-119147)
* Mon Aug 24 2026 Paul Howarth <paul@city-fan.org> - 1.3.9d-2
- Fix regression in mod_sql's SQLNamedQuery (upstream bug 4515, GH#2293)
reply other threads:[~2026-11-06 9:41 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=179395808436.1.10456651346973990624.rpms-proftpd-d2ad68afe8d0@fedoraproject.org \
--to=paul@city-fan.org \
--cc=git-commits@fedoraproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox