From 1863fbd00b9b3256ffd16d0ebb015f2d1b736020 Mon Sep 17 00:00:00 2001 From: zhaoyonghao Date: Wed, 3 Dec 2025 16:49:31 +0800 Subject: [PATCH] backport some patches from upstream (cherry picked from commit 052a7d09c5a97f26c04eac02dce6ec762037723e) --- ...ic-memory-pool-when-destory-channels.patch | 91 +++++++ ...rt-Fix-the-computation-of-the-RADIUS.patch | 42 +++ ...egistering-new-event-handler-as-head.patch | 33 +++ ...gged-in-user-not-in-the-session-pool.patch | 34 +++ ...-handle-sftp-keys-from-sql-databases.patch | 254 ++++++++++++++++++ ...ort-mod_sftp-needs-to-check_all-keys.patch | 104 +++++++ proftpd.spec | 21 +- 7 files changed, 578 insertions(+), 1 deletion(-) create mode 100644 backport-Ensure-free-up-the-channel-specific-memory-pool-when-destory-channels.patch create mode 100644 backport-Fix-the-computation-of-the-RADIUS.patch create mode 100644 backport-Registering-new-event-handler-as-head.patch create mode 100644 backport-fix-logged-in-user-not-in-the-session-pool.patch create mode 100644 backport-handle-sftp-keys-from-sql-databases.patch create mode 100644 backport-mod_sftp-needs-to-check_all-keys.patch diff --git a/backport-Ensure-free-up-the-channel-specific-memory-pool-when-destory-channels.patch b/backport-Ensure-free-up-the-channel-specific-memory-pool-when-destory-channels.patch new file mode 100644 index 0000000..be3995d --- /dev/null +++ b/backport-Ensure-free-up-the-channel-specific-memory-pool-when-destory-channels.patch @@ -0,0 +1,91 @@ +From b7689d454f27ce3419df46a93aeab4244a9fd72e Mon Sep 17 00:00:00 2001 +From: TJ Saunders +Date: Thu, 6 Mar 2025 09:01:47 -0800 +Subject: [PATCH] Issue #1876: Ensure we free up the channel-specific memory + pool when destroy channels, and also implement an upper bounds on the memory + used for tracking all channels across the lifetime of the connection. + +Conflict:NA +Reference:https://github.com/proftpd/proftpd/commit/b7689d454f27ce3419df46a93aeab4244a9fd72e + +--- + contrib/mod_sftp/channel.c | 33 +++++++++++++++++++++++++++++---- + 1 file changed, 29 insertions(+), 4 deletions(-) + +diff --git a/contrib/mod_sftp/channel.c b/contrib/mod_sftp/channel.c +index 1c22dc3..0572518 100644 +--- a/contrib/mod_sftp/channel.c ++++ b/contrib/mod_sftp/channel.c +@@ -1,6 +1,6 @@ + /* + * ProFTPD - mod_sftp channels +- * Copyright (c) 2008-2023 TJ Saunders ++ * Copyright (c) 2008-2025 TJ Saunders + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by +@@ -98,9 +98,11 @@ static int send_channel_done(pool *, uint32_t); + static struct ssh2_channel *alloc_channel(const char *type, + uint32_t remote_channel_id, uint32_t remote_windowsz, + uint32_t remote_max_packetsz) { +- struct ssh2_channel *chan = NULL; ++ register unsigned int i; ++ struct ssh2_channel *chan = NULL, **chans = NULL; + pool *sub_pool = NULL; +- ++ int found_existing_slot = FALSE; ++ + sub_pool = make_sub_pool(channel_pool); + pr_pool_tag(sub_pool, "SSH2 channel pool"); + +@@ -121,7 +123,26 @@ static struct ssh2_channel *alloc_channel(const char *type, + channel_list = make_array(channel_pool, 1, sizeof(struct ssh2_channel *)); + } + +- *((struct ssh2_channel **) push_array(channel_list)) = chan; ++ /* Look for an empty slot in the list, from an already-destroyed channel, ++ * first. ++ */ ++ chans = channel_list->elts; ++ for (i = 0; i < channel_list->nelts; i++) { ++ if (chans[i] == NULL) { ++ chans[i] = chan; ++ found_existing_slot = TRUE; ++ ++ pr_trace_msg(trace_channel, 22, ++ "reusing existing empty slot in channel list (%d item count) for new " ++ "channel ID %lu", channel_list->nelts, ++ (unsigned long) chan->local_channel_id); ++ break; ++ } ++ } ++ ++ if (found_existing_slot == FALSE) { ++ *((struct ssh2_channel **) push_array(channel_list)) = chan; ++ } + + channel_count++; + return chan; +@@ -152,7 +173,9 @@ static void destroy_channel(uint32_t channel_id) { + (chans[i]->finish)(channel_id); + } + ++ destroy_pool(chans[i]->pool); + chans[i] = NULL; ++ + channel_count--; + break; + } +@@ -1568,7 +1591,9 @@ int sftp_channel_free(void) { + (chans[i]->finish)(chans[i]->local_channel_id); + } + ++ destroy_pool(chans[i]->pool); + chans[i] = NULL; ++ + channel_count--; + } + } +-- +2.33.0 + diff --git a/backport-Fix-the-computation-of-the-RADIUS.patch b/backport-Fix-the-computation-of-the-RADIUS.patch new file mode 100644 index 0000000..f8ecb9a --- /dev/null +++ b/backport-Fix-the-computation-of-the-RADIUS.patch @@ -0,0 +1,42 @@ +From 3cf5ad4b7e6df0e5a980aeab9021ef25c63dbfd6 Mon Sep 17 00:00:00 2001 +From: TJ Saunders +Date: Sat, 26 Oct 2024 12:06:00 -0700 +Subject: [PATCH] Issue #1840: Fix the computation of the RADIUS + Message-Authenticator signature to conform more properly to RFC 2869. (#1843) + +Conflict:NA +Reference:https://github.com/proftpd/proftpd/commit/3cf5ad4b7e6df0e5a980aeab9021ef25c63dbfd6 + +--- + contrib/mod_radius.c | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +diff --git a/contrib/mod_radius.c b/contrib/mod_radius.c +index f232e99..057bd1a 100644 +--- a/contrib/mod_radius.c ++++ b/contrib/mod_radius.c +@@ -1,6 +1,6 @@ + /* + * ProFTPD: mod_radius -- a module for RADIUS authentication and accounting +- * Copyright (c) 2001-2022 TJ Saunders ++ * Copyright (c) 2001-2024 TJ Saunders + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by +@@ -2266,8 +2266,11 @@ static int radius_verify_auth_mac(radius_packet_t *pkt, const char *pkt_type, + memset(replied, '\0', sizeof(replied)); + memcpy(replied, attrib->data, attrib_len); + +- /* Next, zero out the value so that we can calculate it ourselves. */ +- memset(attrib->data, '\0', attrib_len); ++ /* Next, zero out the value so that we can calculate it ourselves. ++ * ++ * Note that we only want to zero out the first 16 bytes, per RFC 2869. ++ */ ++ memset(attrib->data, '\0', expected_len); + + memset(digest, '\0', sizeof(digest)); + md = EVP_md5(); +-- +2.33.0 + diff --git a/backport-Registering-new-event-handler-as-head.patch b/backport-Registering-new-event-handler-as-head.patch new file mode 100644 index 0000000..4d60500 --- /dev/null +++ b/backport-Registering-new-event-handler-as-head.patch @@ -0,0 +1,33 @@ +From ca0dc634e2228bb9e92c10c9b4714df42bc5a137 Mon Sep 17 00:00:00 2001 +From: Andreas Zervas <49820969+andreaszervas@users.noreply.github.com> +Date: Thu, 27 Jun 2024 02:33:16 +0200 +Subject: [PATCH] Registering new event handler as head of the doubly linked + list issue. (#1811) + +When registering multiple event handlers for the same event, the registering of a new handler in the double linked list is not performed correctly. + +Conflict:NA +Reference:https://github.com/proftpd/proftpd/commit/ca0dc634e2228bb9e92c10c9b4714df42bc5a137 + +--- + src/event.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/event.c b/src/event.c +index 5539fee..f83fbed 100644 +--- a/src/event.c ++++ b/src/event.c +@@ -160,8 +160,8 @@ int pr_event_register(module *m, const char *event, + } + + if (evh->module != NULL) { +- if (evl->handlers->next != NULL) { +- evl->handlers->next->prev = evh; ++ if (evl->handlers != NULL) { ++ evl->handlers->prev = evh; + } + + evh->next = evl->handlers; +-- +2.33.0 + diff --git a/backport-fix-logged-in-user-not-in-the-session-pool.patch b/backport-fix-logged-in-user-not-in-the-session-pool.patch new file mode 100644 index 0000000..0138e66 --- /dev/null +++ b/backport-fix-logged-in-user-not-in-the-session-pool.patch @@ -0,0 +1,34 @@ +From e7539bd772ca6e12d3e05fb56da274cf78ee1edf Mon Sep 17 00:00:00 2001 +From: TJ Saunders +Date: Wed, 11 Dec 2024 15:55:16 -0800 +Subject: [PATCH] While investigating Issue #1855, I discovered a long-hidden + bug in mod_sftp, where the list of GIDs for the logged-in user was not being + appropriately copied out of the session pool. + +This was manifesting as a segfault in my local tests, when the `HideNoAccess` directive is in effect for an SFTP session. + +Conflict:delete useless member according to 14c006b62c09d1efe302c57b2d183a489bcb22dc +Reference:https://github.com/proftpd/proftpd/commit/e7539bd772ca6e12d3e05fb56da274cf78ee1edf + +--- + contrib/mod_sftp/auth.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/contrib/mod_sftp/auth.c b/contrib/mod_sftp/auth.c +index 6196fec..4015e98 100644 +--- a/contrib/mod_sftp/auth.c ++++ b/contrib/mod_sftp/auth.c +@@ -690,6 +690,10 @@ static int setup_env(pool *p, const char *user) { + session.group = pstrdup(session.pool, session.group); + } + ++ if (session.gids != NULL) { ++ session.gids = copy_array(session.pool, session.gids); ++ } ++ + session.groups = copy_array_str(session.pool, session.groups); + + pr_resolve_fs_map(); +-- +2.33.0 + diff --git a/backport-handle-sftp-keys-from-sql-databases.patch b/backport-handle-sftp-keys-from-sql-databases.patch new file mode 100644 index 0000000..549d1cf --- /dev/null +++ b/backport-handle-sftp-keys-from-sql-databases.patch @@ -0,0 +1,254 @@ +From 097398f582f67cc19e0b35903e385ca0b28d9bd7 Mon Sep 17 00:00:00 2001 +From: TJ Saunders +Date: Sat, 20 Apr 2024 10:02:02 -0700 +Subject: [PATCH] Issue #1529: Properly handle SFTP keys from SQL databases + where key headers may have unexpectedly missing/empty values. + +Conflict:NA +Reference:https://github.com/proftpd/proftpd/commit/097398f582f67cc19e0b35903e385ca0b28d9bd7 + +--- + NEWS | 2 + + contrib/mod_sftp_sql.c | 30 +++- + .../lib/ProFTPD/Tests/Modules/mod_sftp_sql.pm | 151 ++++++++++++++++++ + 3 files changed, 176 insertions(+), 7 deletions(-) + +diff --git a/NEWS b/NEWS +index 2e4b8d7..9c308e7 100644 +--- a/NEWS ++++ b/NEWS +@@ -22,6 +22,8 @@ + - Issue 1756 - Build system fails for specific module names. + - Issue 1760 - mod_sftp is affected by "Terrapin" Prefix Truncation Attacks in + SSH Specification (CVE-2023-48795). ++- Issue 1529 - mod_sftp_sql logs "header value too long" due to unexpected key ++ header text. + + 1.3.8a - Released 08-Oct-2023 + -------------------------------- +diff --git a/contrib/mod_sftp_sql.c b/contrib/mod_sftp_sql.c +index 511d507..e93303d 100644 +--- a/contrib/mod_sftp_sql.c ++++ b/contrib/mod_sftp_sql.c +@@ -1,6 +1,6 @@ + /* + * ProFTPD: mod_sftp_sql -- SQL backend module for retrieving authorized keys +- * Copyright (c) 2008-2022 TJ Saunders ++ * Copyright (c) 2008-2024 TJ Saunders + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by +@@ -93,7 +93,8 @@ static char *sqlstore_getline(pool *p, char **blob, size_t *bloblen) { + return NULL; + } + +- while (data != NULL && datalen > 0) { ++ while (data != NULL && ++ datalen > 0) { + char *ptr; + size_t delimlen, linelen; + int have_line_continuation = FALSE; +@@ -187,13 +188,28 @@ static char *sqlstore_getline(pool *p, char **blob, size_t *bloblen) { + } + + /* Header value starts at 2 after the ':' (one for the mandatory +- * space character. ++ * space character. Make sure to check that we actually have text ++ * after the ':' character (see Issue #1529). + */ +- header_valuelen = linelen - (header_taglen + 2); +- if (header_valuelen > 1024) { ++ if (header_taglen + 2 < linelen) { ++ header_valuelen = linelen - (header_taglen + 2); ++ if (header_valuelen > 1024) { ++ (void) pr_log_writefile(sftp_logfd, MOD_SFTP_SQL_VERSION, ++ "header value too long (%u) in retrieved SQL data for '%s'", ++ header_valuelen, sqlstore_user); ++ errno = EINVAL; ++ return NULL; ++ } ++ ++ } else { + (void) pr_log_writefile(sftp_logfd, MOD_SFTP_SQL_VERSION, +- "header value too long (%u) in retrieved SQL data for '%s'", +- header_valuelen, sqlstore_user); ++ "empty/missing '%.*s' header value, ignoring", (int) header_taglen, ++ line); ++ ++ /* Make sure we advance past this line. */ ++ *blob = data; ++ *bloblen = datalen; ++ + errno = EINVAL; + return NULL; + } +diff --git a/tests/t/lib/ProFTPD/Tests/Modules/mod_sftp_sql.pm b/tests/t/lib/ProFTPD/Tests/Modules/mod_sftp_sql.pm +index a785317..2daec1a 100644 +--- a/tests/t/lib/ProFTPD/Tests/Modules/mod_sftp_sql.pm ++++ b/tests/t/lib/ProFTPD/Tests/Modules/mod_sftp_sql.pm +@@ -98,6 +98,11 @@ my $TESTS = { + test_class => [qw(bug forking ssh2)], + }, + ++ ssh2_auth_publickey_empty_comment_issue1529 => { ++ order => ++$order, ++ test_class => [qw(bug forking ssh2)], ++ }, ++ + }; + + sub new { +@@ -3170,4 +3175,150 @@ EOS + test_cleanup($setup->{log_file}, $ex); + } + ++sub ssh2_auth_publickey_empty_comment_issue1529 { ++ my $self = shift; ++ my $tmpdir = $self->{tmpdir}; ++ my $setup = test_setup($tmpdir, 'sftp_sql'); ++ ++ my $db_file = File::Spec->rel2abs("$tmpdir/sftp.db"); ++ ++ my $rsa_rfc4716_data = '---- BEGIN SSH2 PUBLIC KEY ---- ++Comment: ++AAAAB3NzaC1yc2EAAAABIwAAAQEAzJ1CLwnVP9mUa8uyM+XBzxLxsRvGz4cS59aPTgdw7j ++Gx1jCvC9ya400x7ej5Q4ubwlAAPblXzG5GYv2ROmYQ1DIjrhmR/61tDKUvAAZIgtvLZ00y ++dqqpq5lG4ubVJ4gW6sxbPfq/X12kV1gxGsFLUJCgoYInZGyIONrnvmQjFIfIx+mQXaK84u ++O6w0CT6KhRWgonajMrlO6P8O7qr80rFmOZsBNIMooyYrGTaMyxVsQK2SY+VKbXWFC+2HMm ++ef62n+02ohAOBKtOsSOn8HE2wi7yMA0g8jRTd8kZcWBIkAhizPvl8pqG1F0DCmLn00rhPk ++Byq2pv4VBo953gK7f1AQ== ++---- END SSH2 PUBLIC KEY ----'; ++ ++ my $db_script = File::Spec->rel2abs("$tmpdir/sftp.sql"); ++ ++ my $fh; ++ if (open($fh, "> $db_script")) { ++ print $fh <{user}', '$rsa_rfc4716_data'); ++EOS ++ unless (close($fh)) { ++ die("Can't write $db_script: $!"); ++ } ++ ++ } else { ++ die("Can't open $db_script: $!"); ++ } ++ ++ my $cmd = "sqlite3 $db_file < $db_script"; ++ if ($ENV{TEST_VERBOSE}) { ++ print STDERR "Executing sqlite3: $cmd\n"; ++ } ++ ++ my @output = `$cmd`; ++ ++ unlink($db_script); ++ ++ my $rsa_host_key = File::Spec->rel2abs('t/etc/modules/mod_sftp/ssh_host_rsa_key'); ++ my $dsa_host_key = File::Spec->rel2abs('t/etc/modules/mod_sftp/ssh_host_dsa_key'); ++ ++ my $rsa_priv_key = File::Spec->rel2abs('t/etc/modules/mod_sftp/test_rsa_key'); ++ my $rsa_pub_key = File::Spec->rel2abs('t/etc/modules/mod_sftp/test_rsa_key.pub'); ++ ++ my $config = { ++ PidFile => $setup->{pid_file}, ++ ScoreboardFile => $setup->{scoreboard_file}, ++ SystemLog => $setup->{log_file}, ++ TraceLog => $setup->{log_file}, ++ Trace => 'ssh2:20 sftp:20 sql:20', ++ ++ AuthUserFile => $setup->{auth_user_file}, ++ AuthGroupFile => $setup->{auth_group_file}, ++ AuthOrder => 'mod_auth_file.c', ++ ++ IfModules => { ++ 'mod_delay.c' => { ++ DelayEngine => 'off', ++ }, ++ ++ 'mod_sql_sqlite.c' => { ++ SQLAuthenticate => 'off', ++ SQLConnectInfo => $db_file, ++ SQLLogFile => $setup->{log_file}, ++ SQLNamedQuery => 'get-user-authorized-keys SELECT "key FROM sftpuserkeys WHERE name = \'%{0}\'"', ++ }, ++ ++ 'mod_sftp.c' => [ ++ "SFTPEngine on", ++ "SFTPLog $setup->{log_file}", ++ "SFTPHostKey $rsa_host_key", ++ "SFTPHostKey $dsa_host_key", ++ "SFTPAuthorizedUserKeys sql:/get-user-authorized-keys", ++ ], ++ }, ++ }; ++ ++ my ($port, $config_user, $config_group) = config_write($setup->{config_file}, ++ $config); ++ ++ # Open pipes, for use between the parent and child processes. Specifically, ++ # the child will indicate when it's done with its test by writing a message ++ # to the parent. ++ my ($rfh, $wfh); ++ unless (pipe($rfh, $wfh)) { ++ die("Can't open pipe: $!"); ++ } ++ ++ require Net::SSH2; ++ ++ my $ex; ++ ++ # Fork child ++ $self->handle_sigchld(); ++ defined(my $pid = fork()) or die("Can't fork: $!"); ++ if ($pid) { ++ eval { ++ # Allow for server startup ++ sleep(2); ++ ++ my $ssh2 = Net::SSH2->new(); ++ ++ unless ($ssh2->connect('127.0.0.1', $port)) { ++ my ($err_code, $err_name, $err_str) = $ssh2->error(); ++ die("Can't connect to SSH2 server: [$err_name] ($err_code) $err_str"); ++ } ++ ++ unless ($ssh2->auth_publickey($setup->{user}, $rsa_pub_key, $rsa_priv_key)) { ++ my ($err_code, $err_name, $err_str) = $ssh2->error(); ++ die("RSA publickey authentication failed: [$err_name] ($err_code) $err_str"); ++ } ++ ++ $ssh2->disconnect(); ++ }; ++ if ($@) { ++ $ex = $@; ++ } ++ ++ $wfh->print("done\n"); ++ $wfh->flush(); ++ ++ } else { ++ eval { server_wait($setup->{config_file}, $rfh) }; ++ if ($@) { ++ warn($@); ++ exit 1; ++ } ++ ++ exit 0; ++ } ++ ++ # Stop server ++ server_stop($setup->{pid_file}); ++ $self->assert_child_ok($pid); ++ ++ test_cleanup($setup->{log_file}, $ex); ++} ++ + 1; +-- +2.33.0 + diff --git a/backport-mod_sftp-needs-to-check_all-keys.patch b/backport-mod_sftp-needs-to-check_all-keys.patch new file mode 100644 index 0000000..50e4d87 --- /dev/null +++ b/backport-mod_sftp-needs-to-check_all-keys.patch @@ -0,0 +1,104 @@ +From c5dab662faf7d37e236e0a4415dff14223dae52c Mon Sep 17 00:00:00 2001 +From: TJ Saunders +Date: Thu, 17 Oct 2024 14:51:33 -0700 +Subject: [PATCH] Issue 1839: When checking for configured ECDSA host keys, + mod_sftp needs to check _all_ such configured keys. (#1842) + +Conflict:NA +Reference:https://github.com/proftpd/proftpd/commit/c5dab662faf7d37e236e0a4415dff14223dae52c + +--- + contrib/mod_sftp/keys.c | 8 +++++--- + tests/t/lib/ProFTPD/Tests/Modules/mod_sftp.pm | 20 +++---------------- + 2 files changed, 8 insertions(+), 20 deletions(-) + +diff --git a/contrib/mod_sftp/keys.c b/contrib/mod_sftp/keys.c +index 673847d..9041361 100644 +--- a/contrib/mod_sftp/keys.c ++++ b/contrib/mod_sftp/keys.c +@@ -1,6 +1,6 @@ + /* + * ProFTPD - mod_sftp key mgmt (keys) +- * Copyright (c) 2008-2023 TJ Saunders ++ * Copyright (c) 2008-2024 TJ Saunders + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by +@@ -4143,8 +4143,9 @@ int sftp_keys_have_ecdsa_hostkey(pool *p, int **nids) { + } + count++; + EC_KEY_free(ec); ++ } + +- } else if (sftp_ecdsa384_hostkey != NULL) { ++ if (sftp_ecdsa384_hostkey != NULL) { + EC_KEY *ec; + + ec = EVP_PKEY_get1_EC_KEY(sftp_ecdsa384_hostkey->pkey); +@@ -4153,8 +4154,9 @@ int sftp_keys_have_ecdsa_hostkey(pool *p, int **nids) { + } + count++; + EC_KEY_free(ec); ++ } + +- } else if (sftp_ecdsa521_hostkey != NULL) { ++ if (sftp_ecdsa521_hostkey != NULL) { + EC_KEY *ec; + + ec = EVP_PKEY_get1_EC_KEY(sftp_ecdsa521_hostkey->pkey); +diff --git a/tests/t/lib/ProFTPD/Tests/Modules/mod_sftp.pm b/tests/t/lib/ProFTPD/Tests/Modules/mod_sftp.pm +index d38b768..a470697 100644 +--- a/tests/t/lib/ProFTPD/Tests/Modules/mod_sftp.pm ++++ b/tests/t/lib/ProFTPD/Tests/Modules/mod_sftp.pm +@@ -5647,11 +5647,7 @@ EOC + defined(my $pid = fork()) or die("Can't fork: $!"); + if ($pid) { + eval { +- +- # libssh2, and thus Net::SSH2, don't support ECC/ECDH yet. So we +- # use the external sftp(1) client (e.g. OpenSSH-5.9p1) to test. +- +- my $sftp = '/Users/tj/local/openssh-7.9p1/bin/sftp'; ++ my $sftp = 'sftp'; + + my @cmd = ( + $sftp, +@@ -5725,9 +5721,7 @@ EOC + my $expected_sz = $src_sz; + $self->assert($expected_sz == $sz, + test_msg("Expected file size $expected_sz, got $sz")); +- + }; +- + if ($@) { + $ex = $@; + } +@@ -5898,11 +5892,7 @@ EOC + defined(my $pid = fork()) or die("Can't fork: $!"); + if ($pid) { + eval { +- +- # libssh2, and thus Net::SSH2, don't support ECC/ECDH yet. So we +- # use the external sftp(1) client (e.g. OpenSSH-5.9p1) to test. +- +- my $sftp = '/Users/tj/local/openssh-7.9p1/bin/sftp'; ++ my $sftp = 'sftp'; + + my @cmd = ( + $sftp, +@@ -6149,11 +6139,7 @@ EOC + defined(my $pid = fork()) or die("Can't fork: $!"); + if ($pid) { + eval { +- +- # libssh2, and thus Net::SSH2, don't support ECC/ECDH yet. So we +- # use the external sftp(1) client (e.g. OpenSSH-5.9p1) to test. +- +- my $sftp = '/Users/tj/local/openssh-7.9p1/bin/sftp'; ++ my $sftp = 'sftp'; + + my @cmd = ( + $sftp, +-- +2.33.0 + diff --git a/proftpd.spec b/proftpd.spec index baf20df..a287b5d 100644 --- a/proftpd.spec +++ b/proftpd.spec @@ -20,7 +20,7 @@ Name: proftpd Version: 1.3.8b -Release: 7 +Release: 8 Summary: Flexible, stable and highly-configurable FTP server License: GPLv2+ URL: http://www.proftpd.org/ @@ -46,6 +46,12 @@ Patch7: proftpd-1.3.8-fix-environment-sensitive-tests-failure.patch Patch8: huawei-proftpd-service-add-restart.patch Patch9: backport-CVE-2024-48651.patch Patch10: CVE-2024-57392.patch +Patch11: backport-handle-sftp-keys-from-sql-databases.patch +Patch12: backport-Registering-new-event-handler-as-head.patch +Patch13: backport-mod_sftp-needs-to-check_all-keys.patch +Patch14: backport-Fix-the-computation-of-the-RADIUS.patch +Patch15: backport-fix-logged-in-user-not-in-the-session-pool.patch +Patch16: backport-Ensure-free-up-the-channel-specific-memory-pool-when-destory-channels.patch BuildRequires: coreutils BuildRequires: gcc @@ -254,6 +260,13 @@ sed -i -e '/killall/s/test.*/systemctl reload proftpd.service/' \ %patch 8 -p1 %patch 9 -p1 %patch 10 -p1 +%patch 11 -p1 +%patch 12 -p1 +%patch 13 -p1 +%patch 14 -p1 +%patch 15 -p1 +%patch 16 -p1 + # Avoid docfile dependencies chmod -c -x contrib/xferstats.holger-preiss @@ -539,6 +552,12 @@ fi %{_mandir}/man1/ftpwho.1* %changelog +* Wed Dec 3 2025 zhaoyonghao - 1.3.8b-8 +- Type:bugfix +- CVE: +- SUG:NA +- DESC:backport some patches from upstream + * Tue Jul 29 2025 yaoxin <1024769339@qq.com> - 1.3.8b-7 - Fix CVE-2024-57392 -- Gitee