[packages/proftpd] Up to 1.3.9e
arekm
arekm at pld-linux.org
Thu Oct 29 09:41:09 CET 2026
commit b6066c1219a755b1d9226ea1cec86ec1d6993c15
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date: Thu Oct 29 07:20:03 2026 +0100
Up to 1.3.9e
...ues-2256-2286.patch => proftpd-issue-2256.patch | 326 +++++++++------------
proftpd-issue-2319.patch | 60 ----
proftpd-rewrite-utf8trans.patch | 47 ---
proftpd.spec | 10 +-
4 files changed, 148 insertions(+), 295 deletions(-)
---
diff --git a/proftpd.spec b/proftpd.spec
index 2ba980a..16906c8 100644
--- a/proftpd.spec
+++ b/proftpd.spec
@@ -26,13 +26,13 @@ Summary(pl.UTF-8): PROfesionalny serwer FTP
Summary(pt_BR.UTF-8): Servidor FTP profissional, com sintaxe de configuração semelhante à do apache
Summary(zh_CN.UTF-8): 易于管理的,安全的 FTP 服务器
Name: proftpd
-Version: 1.3.9d
+Version: 1.3.9e
Release: 1
Epoch: 2
License: GPL v2+
Group: Networking/Daemons
Source0: ftp://ftp.proftpd.org/distrib/source/%{name}-%{version}.tar.gz
-# Source0-md5: d7773e706687ffdaec3d56f285bd9aab
+# Source0-md5: be360852af16c39434a0527234bf7db4
# https://github.com/jbenden/mod_clamav/releases
Source1: https://github.com/jbenden/mod_clamav/archive/v%{mod_clamav_version}/mod_clamav-%{mod_clamav_version}.tar.gz
# Source1-md5: 7d1e7e33added5a6ce1c4d96ca572167
@@ -53,9 +53,7 @@ Patch1: %{name}-noautopriv.patch
Patch2: %{name}-wtmp.patch
Patch3: %{name}-pool.patch
Patch5: mod_clamav-compat.patch
-Patch6: proftpd-issues-2256-2286.patch
-Patch7: proftpd-issue-2319.patch
-Patch8: proftpd-rewrite-utf8trans.patch
+Patch6: proftpd-issue-2256.patch
URL: http://www.proftpd.org/
BuildRequires: GeoIP-devel
BuildRequires: acl-devel
@@ -577,8 +575,6 @@ cp -a mod_clamav-%{mod_clamav_version}/*.{c,h} contrib/
%patch -P5 -p1
%patch -P6 -p1
-%patch -P7 -p1
-%patch -P8 -p1
cp -f /usr/share/automake/config.sub .
diff --git a/proftpd-issues-2256-2286.patch b/proftpd-issue-2256.patch
similarity index 61%
rename from proftpd-issues-2256-2286.patch
rename to proftpd-issue-2256.patch
index c974d98..e2f1215 100644
--- a/proftpd-issues-2256-2286.patch
+++ b/proftpd-issue-2256.patch
@@ -1,13 +1,15 @@
-# Reject invalid transfer offsets and preserve symlink semantics on EXDEV renames.
-# Upstream Issue #2286: https://github.com/proftpd/proftpd/issues/2286
-# Commits: 16e5d14, c8bf3c6, 7e810ca, 9ad4b03
+# Keep symlinks as symlinks when FTP RNTO / SFTP RENAME falls back to copying
+# across filesystem mounts (the fallback followed source and destination links).
# Upstream Issue #2256: https://github.com/proftpd/proftpd/issues/2256
-# Commits: bdb4901, 8255a02, 7610f88, 0fa0f97
+# Commits (master only, not in 1.3.9e): bdb4901, 8255a02, 7610f88, 0fa0f97
diff --git a/contrib/mod_copy.c b/contrib/mod_copy.c
-index a87a4363acd45715743f706019135bfce86c27b9..a807c2fca3b46e370feb6b80ba79161c3acf4efe 100644
+index a87a436..a807c2f 100644
--- a/contrib/mod_copy.c
+++ b/contrib/mod_copy.c
-@@ -160,31 +159,0 @@ static int create_path(pool *p, const char *path) {
+@@ -157,37 +157,6 @@ static int create_path(pool *p, const char *path) {
+ return 0;
+ }
+
-static int copy_symlink(pool *p, const char *src_path, const char *dst_path,
- int flags) {
- char *link_path = pcalloc(p, PR_TUNABLE_BUFFER_SIZE);
@@ -39,29 +41,41 @@ index a87a4363acd45715743f706019135bfce86c27b9..a807c2fca3b46e370feb6b80ba79161c
- return 0;
-}
-
-@@ -320 +289 @@ static int copy_dir(pool *p, const char *src_dir, const char *dst_dir,
+ static int copy_dir(pool *p, const char *src_dir, const char *dst_dir,
+ int flags) {
+ DIR *dh = NULL;
+@@ -317,7 +286,7 @@ static int copy_dir(pool *p, const char *src_dir, const char *dst_dir,
+
+ /* Is this path a symlink? */
+ } else if (S_ISLNK(st.st_mode)) {
- if (copy_symlink(iter_pool, src_path, dst_path, flags) < 0) {
+ if (pr_fs_copy_symlink(src_path, dst_path, flags) < 0) {
-@@ -471,0 +441,4 @@ static int copy_paths(pool *p, const char *from, const char *to) {
+ res = -1;
+ break;
+ }
+@@ -469,9 +438,13 @@ static int copy_paths(pool *p, const char *from, const char *to) {
+ errno = EACCES;
+ return -1;
+ }
+
+ } else {
+ pr_trace_msg(trace_channel, 19,
+ "lstat(2) error for destination path '%s': %s", to, strerror(errno));
-@@ -474 +447 @@ static int copy_paths(pool *p, const char *from, const char *to) {
+ }
+
- res = copy_symlink(p, from, to, flags);
+ res = pr_fs_copy_file2(from, to, flags, NULL);
+ if (res < 0) {
+ int xerrno = errno;
+
diff --git a/contrib/mod_sftp/fxp.c b/contrib/mod_sftp/fxp.c
-index 6bcbf29955698c02ab4a878d6b87500b905e2e3b..ba60840a3244b0a41f254dc9b5a45da8e085b2d1 100644
+index 6de598d..a15361b 100644
--- a/contrib/mod_sftp/fxp.c
+++ b/contrib/mod_sftp/fxp.c
-@@ -4328 +4328,2 @@ static int fxp_handle_ext_check_file(struct fxp_packet *fxp, char *digest_list,
-- if (offset >= st.st_size) {
-+ if (offset < 0 ||
-+ offset >= st.st_size) {
-@@ -4333 +4334 @@ static int fxp_handle_ext_check_file(struct fxp_packet *fxp, char *digest_list,
-- " >= %" PR_LU " file size)", (pr_off_t) offset, (pr_off_t) st.st_size);
-+ " vs %" PR_LU " file size)", (pr_off_t) offset, (pr_off_t) st.st_size);
-@@ -5337,0 +5339,116 @@ static int fxp_handle_ext_limits(struct fxp_packet *fxp) {
+@@ -5377,6 +5377,118 @@ static int fxp_handle_ext_limits(struct fxp_packet *fxp) {
+ return fxp_packet_write(resp);
+ }
+
+static int rename_across_mounts(pool *p, const char *src_path,
+ const char *dst_path) {
+ int res, xerrno;
@@ -150,10 +164,6 @@ index 6bcbf29955698c02ab4a878d6b87500b905e2e3b..ba60840a3244b0a41f254dc9b5a45da8
+ } else if (S_ISLNK(src_st.st_mode)) {
+ res = pr_fs_copy_symlink(src_path, dst_path, 0);
+ xerrno = errno;
-+
-+ } else {
-+ res = -1;
-+ xerrno = EPERM;
+ }
+
+ if (res < 0) {
@@ -178,10 +188,22 @@ index 6bcbf29955698c02ab4a878d6b87500b905e2e3b..ba60840a3244b0a41f254dc9b5a45da8
+ return 0;
+}
+
-@@ -5599 +5716 @@ static int fxp_handle_ext_posix_rename(struct fxp_packet *fxp, char *src,
+ static int fxp_handle_ext_posix_rename(struct fxp_packet *fxp, char *src,
+ char *dst) {
+ unsigned char *buf, *ptr;
+@@ -5638,7 +5750,7 @@ static int fxp_handle_ext_posix_rename(struct fxp_packet *fxp, char *src,
+ */
+ errno = 0;
+
- res = pr_fs_copy_file2(src, dst, 0, NULL);
+ res = rename_across_mounts(fxp->pool, src, dst);
-@@ -5613,9 +5729,0 @@ static int fxp_handle_ext_posix_rename(struct fxp_packet *fxp, char *src,
+ if (res < 0) {
+ xerrno = errno;
+
+@@ -5652,15 +5764,6 @@ static int fxp_handle_ext_posix_rename(struct fxp_packet *fxp, char *src,
+ "error copying '%s' to '%s': %s", src, dst, strerror(xerrno));
+
+ errno = xerrno;
-
- } else {
- /* Once copied, remove the original path. */
@@ -191,51 +213,46 @@ index 6bcbf29955698c02ab4a878d6b87500b905e2e3b..ba60840a3244b0a41f254dc9b5a45da8
- }
-
- xerrno = errno = 0;
-@@ -5637 +5745 @@ static int fxp_handle_ext_posix_rename(struct fxp_packet *fxp, char *src,
+ }
+ }
+
+@@ -5676,7 +5779,7 @@ static int fxp_handle_ext_posix_rename(struct fxp_packet *fxp, char *src,
+ xerrno != EOF ? strerror(xerrno) : "End of file", xerrno);
+
+ /* Clear out any transfer-specific data. */
- if (session.xfer.p) {
+ if (session.xfer.p != NULL) {
-@@ -10527,0 +10636,25 @@ static int fxp_handle_read(struct fxp_packet *fxp) {
-+ if (((off_t) offset) < 0) {
-+ int xerrno = EINVAL;
-+ uint32_t status_code;
-+ const char *reason;
-+
-+ (void) pr_log_writefile(sftp_logfd, MOD_SFTP_VERSION,
-+ "requested invalid read offset (%" PR_LU " bytes)", (pr_off_t) offset);
-+
-+ status_code = fxp_errno2status(xerrno, &reason);
-+
-+ pr_trace_msg(trace_channel, 8, "sending response: STATUS %lu '%s'",
-+ (unsigned long) status_code, fxp_strerror(status_code));
-+
-+ fxp_status_write(fxp->pool, &buf, &buflen, fxp->request_id, status_code,
-+ reason, NULL);
-+
-+ fxp_cmd_dispatch_err(cmd);
-+
-+ resp = fxp_packet_create(fxp->pool, fxp->channel_id);
-+ resp->payload = ptr;
-+ resp->payload_sz = (bufsz - buflen);
-+
-+ return fxp_packet_write(resp);
-+ }
-+
-@@ -12330,0 +12464,2 @@ static int fxp_handle_rename(struct fxp_packet *fxp) {
+ destroy_pool(session.xfer.p);
+ }
+ memset(&session.xfer, 0, sizeof(session.xfer));
+@@ -12395,33 +12498,25 @@ static int fxp_handle_rename(struct fxp_packet *fxp) {
+ errno = xerrno;
+
+ } else {
+ errno = 0;
+
-@@ -12334,2 +12469 @@ static int fxp_handle_rename(struct fxp_packet *fxp) {
+ /* In this case, we should manually copy the file from the source
+ * path to the destination path.
+ */
- errno = 0;
- if (pr_fs_copy_file2(old_path, new_path, 0, NULL) < 0) {
+ if (rename_across_mounts(fxp->pool, old_path, new_path) < 0) {
-@@ -12339 +12473 @@ static int fxp_handle_rename(struct fxp_packet *fxp) {
+ xerrno = errno;
+
+ (void) pr_trace_msg("fileperms", 1, "RENAME, user '%s' (UID %s, "
- "GID %s): error copying '%s' to '%s': %s", session.user,
+ "GID %s): error renaming '%s' to '%s': %s", session.user,
-@@ -12345,2 +12479,2 @@ static int fxp_handle_rename(struct fxp_packet *fxp) {
+ pr_uid2str(fxp->pool, session.uid),
+ pr_gid2str(fxp->pool, session.gid), old_path, new_path,
+ strerror(xerrno));
+
+ (void) pr_log_writefile(sftp_logfd, MOD_SFTP_VERSION,
- "error copying '%s' to '%s': %s", old_path, new_path,
- strerror(xerrno));
+ "RENAME of '%s' to '%s' across mounts failed: %s", old_path,
+ new_path, strerror(xerrno));
-@@ -12349,9 +12482,0 @@ static int fxp_handle_rename(struct fxp_packet *fxp) {
+
+ errno = xerrno;
-
- } else {
- /* Once copied, remove the original path. */
@@ -245,84 +262,42 @@ index 6bcbf29955698c02ab4a878d6b87500b905e2e3b..ba60840a3244b0a41f254dc9b5a45da8
- }
-
- xerrno = errno = 0;
-@@ -12373 +12498 @@ static int fxp_handle_rename(struct fxp_packet *fxp) {
+ }
+ }
+
+@@ -12437,7 +12532,7 @@ static int fxp_handle_rename(struct fxp_packet *fxp) {
+ xerrno != EOF ? strerror(xerrno) : "End of file", xerrno);
+
+ /* Clear out any transfer-specific data. */
- if (session.xfer.p) {
+ if (session.xfer.p != NULL) {
-@@ -13584,0 +13710,25 @@ static int fxp_handle_write(struct fxp_packet *fxp) {
-+ if (((off_t) offset) < 0) {
-+ int xerrno = EINVAL;
-+ uint32_t status_code;
-+ const char *reason;
-+
-+ (void) pr_log_writefile(sftp_logfd, MOD_SFTP_VERSION,
-+ "requested invalid write offset (%" PR_LU " bytes)", (pr_off_t) offset);
-+
-+ status_code = fxp_errno2status(xerrno, &reason);
-+
-+ pr_trace_msg(trace_channel, 8, "sending response: STATUS %lu '%s'",
-+ (unsigned long) status_code, fxp_strerror(status_code));
-+
-+ fxp_status_write(fxp->pool, &buf, &buflen, fxp->request_id, status_code,
-+ reason, NULL);
-+
-+ fxp_cmd_dispatch_err(cmd);
-+
-+ resp = fxp_packet_create(fxp->pool, fxp->channel_id);
-+ resp->payload = ptr;
-+ resp->payload_sz = (bufsz - buflen);
-+
-+ return fxp_packet_write(resp);
-+ }
-+
-diff --git a/contrib/mod_sftp/scp.c b/contrib/mod_sftp/scp.c
-index 4fb6cb232bd4a5006333da8ece4908058b122808..02c7ea02c6f38a6b5e146ced9631228491c6c257 100644
---- a/contrib/mod_sftp/scp.c
-+++ b/contrib/mod_sftp/scp.c
-@@ -607,0 +608 @@ static int recv_filesz(pool *p, uint32_t channel_id, char *size_str,
-+ int res = 0;
-@@ -609,0 +611 @@ static int recv_filesz(pool *p, uint32_t channel_id, char *size_str,
-+
-@@ -611,0 +614 @@ static int recv_filesz(pool *p, uint32_t channel_id, char *size_str,
-+ errno = 0;
-@@ -613,0 +617,4 @@ static int recv_filesz(pool *p, uint32_t channel_id, char *size_str,
-+ if (sz == ULLONG_MAX &&
-+ errno == ERANGE) {
-+ res = -1;
-+ }
-@@ -615,0 +623,4 @@ static int recv_filesz(pool *p, uint32_t channel_id, char *size_str,
-+ if (sz == ULONG_MAX &&
-+ errno == ERANGE) {
-+ res = -1;
-+ }
-@@ -617,0 +629,7 @@ static int recv_filesz(pool *p, uint32_t channel_id, char *size_str,
-+ /* Watch for cases where the sent file size might overflow our size type. */
-+ if (res < 0) {
-+ pr_trace_msg(trace_channel, 2, "file size '%s' out of range", size_str);
-+ write_confirm(p, channel_id, 1, "file size out of range");
-+ return -1;
-+ }
-+
-@@ -620,3 +638,2 @@ static int recv_filesz(pool *p, uint32_t channel_id, char *size_str,
-- /* Watch for cases where the sent file size might overflow our size type. */
-- if (*filesz < 0) {
-- pr_trace_msg(trace_channel, 2, "file size out of range");
-+ if (*filesz < 0 || (unsigned long long) *filesz != sz) {
-+ pr_trace_msg(trace_channel, 2, "file size '%s' out of range", size_str);
+ destroy_pool(session.xfer.p);
+ }
+ memset(&session.xfer, 0, sizeof(session.xfer));
diff --git a/include/fsio.h b/include/fsio.h
-index 5ac00183a40f3bc70e665ff5179a9530d8807abb..b9b184aa77dca40adf53b508d2ca2467009e11bb 100644
+index 5ac0018..b9b184a 100644
--- a/include/fsio.h
+++ b/include/fsio.h
-@@ -416,0 +417,5 @@ int pr_fs_copy_file2(const char *src, const char *dst, int flags,
+@@ -414,6 +414,11 @@ int pr_fs_copy_file2(const char *src, const char *dst, int flags,
+ void (*progress_cb)(int));
+ #define PR_FSIO_COPY_FILE_FL_NO_DELETE_ON_FAILURE 0x0001
+
+/* Copy a symlink from the given source path to the destination path, creating
+ * a symlink pointing to the same file at the destination.
+ */
+int pr_fs_copy_symlink(const char *src, const char *dst, int flags);
+
+ int pr_fs_setcwd(const char *);
+ const char *pr_fs_getcwd(void);
+ const char *pr_fs_getvwd(void);
diff --git a/modules/mod_core.c b/modules/mod_core.c
-index e2b38ae87c1a4a13299d2d1b5a76c8c8013559a3..18766f323ec14e5158373912d03eea2ed05fb620 100644
+index e2b38ae..18766f3 100644
--- a/modules/mod_core.c
+++ b/modules/mod_core.c
-@@ -6136,0 +6137,119 @@ MODRET core_dele(cmd_rec *cmd) {
+@@ -6134,8 +6134,127 @@ MODRET core_dele(cmd_rec *cmd) {
+ return PR_HANDLED(cmd);
+ }
+
+static int handle_cross_mount_rename(cmd_rec *cmd, const char *src_path,
+ const char *dst_path, struct stat *dst_st) {
+ int res, xerrno;
@@ -442,19 +417,33 @@ index e2b38ae87c1a4a13299d2d1b5a76c8c8013559a3..18766f323ec14e5158373912d03eea2e
+ return 0;
+}
+
-@@ -6138 +6257 @@ MODRET core_rnto(cmd_rec *cmd) {
+ MODRET core_rnto(cmd_rec *cmd) {
- int res;
+ int res, xerrno, dst_exists = FALSE;
-@@ -6162 +6281 @@ MODRET core_rnto(cmd_rec *cmd) {
+ char *decoded_path, *path;
+ unsigned char *allow_overwrite = NULL;
+ struct stat st;
+@@ -6159,7 +6278,7 @@ MODRET core_rnto(cmd_rec *cmd) {
+ decoded_path = pr_fs_decode_path2(cmd->tmp_pool, cmd->arg,
+ FSIO_DECODE_FL_TELL_ERRORS);
+ if (decoded_path == NULL) {
- int xerrno = errno;
+ xerrno = errno;
-@@ -6202,2 +6320,0 @@ MODRET core_rnto(cmd_rec *cmd) {
+
+ pr_log_debug(DEBUG8, "'%s' failed to decode properly: %s", cmd->arg,
+ strerror(xerrno));
+@@ -6199,23 +6318,28 @@ MODRET core_rnto(cmd_rec *cmd) {
+
+ path = dir_canonical_path(cmd->tmp_pool, path);
+
- allow_overwrite = get_param_ptr(CURRENT_CONF, "AllowOverwrite", FALSE);
-
-@@ -6206,0 +6324,2 @@ MODRET core_rnto(cmd_rec *cmd) {
+ /* Deny the rename if AllowOverwrites are not allowed, and the destination
+ * rename file already exists.
+ */
+ allow_overwrite = get_param_ptr(CURRENT_CONF, "AllowOverwrite", FALSE);
+
-@@ -6208,4 +6327,3 @@ MODRET core_rnto(cmd_rec *cmd) {
+ pr_fs_clear_cache2(path);
- if ((!allow_overwrite || *allow_overwrite == FALSE) &&
- pr_fsio_stat(path, &st) == 0) {
- pr_log_debug(DEBUG6, "AllowOverwrite denied permission for %s", path);
@@ -462,7 +451,7 @@ index e2b38ae87c1a4a13299d2d1b5a76c8c8013559a3..18766f323ec14e5158373912d03eea2e
+ res = pr_fsio_lstat(path, &st);
+ if (res == 0) {
+ dst_exists = TRUE;
-@@ -6213,3 +6331,9 @@ MODRET core_rnto(cmd_rec *cmd) {
+
- pr_cmd_set_errno(cmd, EACCES);
- errno = EACCES;
- return PR_ERROR(cmd);
@@ -475,13 +464,26 @@ index e2b38ae87c1a4a13299d2d1b5a76c8c8013559a3..18766f323ec14e5158373912d03eea2e
+ errno = EACCES;
+ return PR_ERROR(cmd);
+ }
-@@ -6218 +6342 @@ MODRET core_rnto(cmd_rec *cmd) {
+ }
+
- if (!path ||
+ if (path == NULL ||
-@@ -6231 +6355 @@ MODRET core_rnto(cmd_rec *cmd) {
+ !dir_check_canon(cmd->tmp_pool, cmd, cmd->group, path, NULL)) {
+ pr_log_debug(DEBUG8, "%s command denied by <Limit> config",
+ (char *) cmd->argv[0]);
+@@ -6228,7 +6352,7 @@ MODRET core_rnto(cmd_rec *cmd) {
+
+ res = pr_fsio_rename_with_error(cmd->pool, session.xfer.path, path, &err);
+ if (res < 0) {
- int xerrno = errno;
+ xerrno = errno;
-@@ -6298,14 +6422,2 @@ MODRET core_rnto(cmd_rec *cmd) {
+
+ pr_error_set_where(err, &core_module, __FILE__, __LINE__ - 4);
+ pr_error_set_why(err, pstrcat(cmd->pool, "rename '", session.xfer.path,
+@@ -6295,42 +6419,10 @@ MODRET core_rnto(cmd_rec *cmd) {
+ /* In this case, we'll need to manually copy the file from the source
+ * to the destination paths.
+ */
- if (pr_fs_copy_file(session.xfer.path, path) < 0) {
- xerrno = errno;
-
@@ -498,7 +500,8 @@ index e2b38ae87c1a4a13299d2d1b5a76c8c8013559a3..18766f323ec14e5158373912d03eea2e
- errno = xerrno;
+ if (handle_cross_mount_rename(cmd, session.xfer.path, path,
+ dst_exists == TRUE ? &st : NULL) < 0) {
-@@ -6314,20 +6425,0 @@ MODRET core_rnto(cmd_rec *cmd) {
+ return PR_ERROR(cmd);
+ }
-
- /* Once copied, unlink the original file. */
- res = pr_fsio_unlink_with_error(cmd->pool, session.xfer.path, &err);
@@ -519,59 +522,17 @@ index e2b38ae87c1a4a13299d2d1b5a76c8c8013559a3..18766f323ec14e5158373912d03eea2e
- strerror(xerrno));
- }
- }
-diff --git a/modules/mod_xfer.c b/modules/mod_xfer.c
-index f93922c2b594a795075ee476191c027a17219c5e..68938514965245d7ed234bb8720152edbe358494 100644
---- a/modules/mod_xfer.c
-+++ b/modules/mod_xfer.c
-@@ -2449,0 +2450 @@ static int parse_offset(char *str, off_t *num) {
-+ int res = 0;
-@@ -2450,0 +2452,2 @@ static int parse_offset(char *str, off_t *num) {
-+ unsigned long long n;
-+ off_t sz;
-@@ -2461,2 +2464,8 @@ static int parse_offset(char *str, off_t *num) {
--#ifdef HAVE_STRTOULL
-- *num = strtoull(ptr, &tmp, 10);
-+ errno = 0;
-+
-+#if defined(HAVE_STRTOULL)
-+ n = strtoull(ptr, &tmp, 10);
-+ if (n == ULLONG_MAX &&
-+ errno == ERANGE) {
-+ res = -1;
-+ }
-@@ -2464 +2473,5 @@ static int parse_offset(char *str, off_t *num) {
-- *num = strtoul(ptr, &tmp, 10);
-+ n = strtoul(ptr, &tmp, 10);
-+ if (n == ULONG_MAX &&
-+ errno == ERANGE) {
-+ res = -1;
-+ }
-@@ -2466,0 +2480,7 @@ static int parse_offset(char *str, off_t *num) {
-+ if (res < 0) {
-+ pr_trace_msg(trace_channel, 3,
-+ "client-sent offset '%s' conversion error: %s", ptr, strerror(errno));
-+ errno = EINVAL;
-+ return -1;
-+ }
-+
-@@ -2471,0 +2492,12 @@ static int parse_offset(char *str, off_t *num) {
-+ /* Watch for cases where the sent file offset might overflow our size
-+ * type (Issue #2286).
-+ */
-+ sz = n;
-+ if (sz < 0 || (unsigned long long) sz != n) {
-+ pr_trace_msg(trace_channel, 3,
-+ "client-sent offset '%s' out of range, rejecting", ptr);
-+ errno = EINVAL;
-+ return -1;
-+ }
-+
-+ *num = sz;
+ }
+
+ /* Change the xfer path to the name of the destination file, for logging. */
diff --git a/src/fsio.c b/src/fsio.c
-index 999aebd0a8bb182ac2cd4159b3d6e575e8a4b2b2..90c4906b486ff669975bfce585571200491fa7de 100644
+index 43c47b7..53789bd 100644
--- a/src/fsio.c
+++ b/src/fsio.c
-@@ -2237,0 +2238,39 @@ int pr_fs_copy_file(const char *src, const char *dst) {
+@@ -2235,6 +2235,45 @@ int pr_fs_copy_file(const char *src, const char *dst) {
+ return pr_fs_copy_file2(src, dst, 0, NULL);
+ }
+
+int pr_fs_copy_symlink(const char *src, const char *dst, int flags) {
+ char link_path[PR_TUNABLE_BUFFER_SIZE];
+ int len;
@@ -611,3 +572,6 @@ index 999aebd0a8bb182ac2cd4159b3d6e575e8a4b2b2..90c4906b486ff669975bfce585571200
+ return 0;
+}
+
+ pr_fs_t *pr_register_fs2(pool *p, const char *name, const char *path,
+ int flags) {
+ pr_fs_t *fs = NULL;
diff --git a/proftpd-issue-2319.patch b/proftpd-issue-2319.patch
deleted file mode 100644
index 5de3eba..0000000
--- a/proftpd-issue-2319.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-# Reset the mod_auth passwordless-auth state between USER attempts and on
-# session reinit, so a stale flag cannot let a wrong password authenticate
-# Upstream Issue #2319: https://github.com/proftpd/proftpd/issues/2319
---- a/modules/mod_auth.c
-+++ b/modules/mod_auth.c
-@@ -70,4 +70,4 @@
-- * Note: Once this function returns true (i.e. client has authenticated),
-- * it will ALWAYS return true. At least until REIN is implemented. Thus
-- * we have a flag for such a situation, to save on redundant lookups for
-- * the "authenticated" record.
-+ * Note: Once this function returns true (i.e. client has successfully
-+ * authenticated and logged in), it will ALWAYS return true. At least until
-+ * REIN is implemented. Thus we have a flag for such a situation, to save on
-+ * redundant lookups for the "authenticated" record.
-@@ -143,0 +144,17 @@
-+static void reset_authenticated_without_pass(cmd_rec *cmd) {
-+ unsigned char *authenticated = NULL;
-+
-+ if (cmd != NULL) {
-+ authenticated = get_param_ptr(cmd->server->conf, "authenticated", FALSE);
-+ }
-+ if (authenticated != NULL) {
-+ remove_config(main_server->conf, "authenticated", FALSE);
-+ }
-+
-+ if (cmd != NULL) {
-+ (void) pr_table_remove(cmd->notes, "mod_auth.checked-auth", NULL);
-+ }
-+
-+ authenticated_without_pass = FALSE;
-+}
-+
-@@ -164,3 +180,0 @@
-- /* Reset the CreateHome setting. */
-- mkhome = FALSE;
--
-@@ -172,0 +187,2 @@
-+ reset_authenticated_without_pass(NULL);
-+ auth_have_authenticated = FALSE;
-@@ -1280,3 +1296,2 @@
-- if (!authenticated_without_pass) {
-- auth_code = do_auth(p, c ? c->subset : main_server->conf, user_name,
-- pass);
-+ if (authenticated_without_pass == TRUE) {
-+ auth_code = PR_AUTH_OK_NO_PASS;
-@@ -1285 +1300,2 @@
-- auth_code = PR_AUTH_OK_NO_PASS;
-+ auth_code = do_auth(p, c ? c->subset : main_server->conf, user_name,
-+ pass);
-@@ -2019,0 +2036 @@
-+ reset_authenticated_without_pass(cmd);
-@@ -2022,0 +2040 @@
-+
-@@ -2518,0 +2537 @@
-+ reset_authenticated_without_pass(cmd);
-@@ -2525 +2544 @@
-- if (nopass) {
-+ if (nopass == TRUE) {
-@@ -2745,0 +2765 @@
-+ reset_authenticated_without_pass(cmd);
diff --git a/proftpd-rewrite-utf8trans.patch b/proftpd-rewrite-utf8trans.patch
deleted file mode 100644
index 1f0f0f3..0000000
--- a/proftpd-rewrite-utf8trans.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-# Reject oversized client keys before the utf8trans RewriteMap overflows its
-# static buffers. Upstream: https://github.com/proftpd/proftpd/commit/4bafd1e9861506e77b9ea3ed277b58e60eacfe4d
-# Disclosure: https://github.com/abraxas/proftpd-rewrite-utf8trans
---- a/contrib/mod_rewrite.c
-+++ b/contrib/mod_rewrite.c
-@@ -1659,9 +1659,10 @@ static char rewrite_hex_to_char(const char *what) {
- */
- static int rewrite_utf8_to_ucs4(unsigned long *ucs4_buf,
- size_t utf8_len, unsigned char *utf8_buf) {
-- const unsigned char *utf8_endbuf = utf8_buf + utf8_len;
-+ const unsigned char *utf8_endbuf;
- int ucs_len = 0;
-
-+ utf8_endbuf = utf8_buf + utf8_len;
- while (utf8_buf != utf8_endbuf) {
- pr_signals_handle();
-
-@@ -2035,13 +2036,27 @@ static int rewrite_write_fifo(int fd, char *buf, size_t buflen) {
- }
-
- static char *rewrite_map_int_utf8trans(pool *map_pool, char *key) {
-- int ucs4strlen = 0;
- static unsigned char utf8_val[PR_TUNABLE_BUFFER_SIZE] = {'\0'};
- static unsigned long ucs4_longs[PR_TUNABLE_BUFFER_SIZE] = {0L};
-+ int ucs4strlen = 0;
-+ size_t key_len = 0;
-
- /* If the key is NULL or empty, do nothing. */
-+ if (key != NULL) {
-+ key_len = strlen(key);
-+ }
-+
- if (key == NULL ||
-- strlen(key) == 0) {
-+ key_len == 0) {
-+ return NULL;
-+ }
-+
-+ /* If the key length exceeds our buffers, reject it. */
-+ if (key_len >= sizeof(utf8_val)) {
-+ rewrite_log("utf8trans: key '%.100s...' length (%lu bytes) exceeds "
-+ "maximum allowed length (%lu bytes), rejecting", key,
-+ (unsigned long) key_len, (unsigned long) sizeof(utf8_val));
-+ errno = EPERM;
- return NULL;
- }
-
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/proftpd.git/commitdiff/b6066c1219a755b1d9226ea1cec86ec1d6993c15
More information about the pld-cvs-commit
mailing list