commit:     3950715ee58cad4a5f481fe15eea47c615d44ebf
Author:     Alexey Sokolov <alexey+gentoo <AT> asokolov <DOT> org>
AuthorDate: Sat May 10 23:11:24 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun May 11 00:26:16 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3950715e

net-ftp/vsftpd: fix build with gcc15

Closes: https://bugs.gentoo.org/880399
Signed-off-by: Alexey Sokolov <alexey+gentoo <AT> asokolov.org>
Part-of: https://github.com/gentoo/gentoo/pull/42022
Closes: https://github.com/gentoo/gentoo/pull/42022
Signed-off-by: Sam James <sam <AT> gentoo.org>

 net-ftp/vsftpd/files/vsftpd-3.0.5-gcc15.patch |  13 +++
 net-ftp/vsftpd/vsftpd-3.0.5-r2.ebuild         | 117 ++++++++++++++++++++++++++
 2 files changed, 130 insertions(+)

diff --git a/net-ftp/vsftpd/files/vsftpd-3.0.5-gcc15.patch 
b/net-ftp/vsftpd/files/vsftpd-3.0.5-gcc15.patch
new file mode 100644
index 000000000000..1dc39b1a7974
--- /dev/null
+++ b/net-ftp/vsftpd/files/vsftpd-3.0.5-gcc15.patch
@@ -0,0 +1,13 @@
+https://bugs.gentoo.org/880399
+
+--- a/ssl.c
++++ b/ssl.c
+@@ -34,7 +34,7 @@
+ static char* get_ssl_error();
+ static SSL* get_ssl(struct vsf_session* p_sess, int fd);
+ static int ssl_session_init(struct vsf_session* p_sess);
+-static void setup_bio_callbacks();
++static void setup_bio_callbacks(SSL* p_ssl);
+ static long bio_callback(
+   BIO* p_bio, int oper, const char* p_arg, int argi, long argl, long retval);
+ static int ssl_verify_callback(int verify_ok, X509_STORE_CTX* p_ctx);

diff --git a/net-ftp/vsftpd/vsftpd-3.0.5-r2.ebuild 
b/net-ftp/vsftpd/vsftpd-3.0.5-r2.ebuild
new file mode 100644
index 000000000000..b7c0af8e2b3e
--- /dev/null
+++ b/net-ftp/vsftpd/vsftpd-3.0.5-r2.ebuild
@@ -0,0 +1,117 @@
+# Copyright 2022-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit systemd toolchain-funcs
+
+DESCRIPTION="Very Secure FTP Daemon"
+HOMEPAGE="https://security.appspot.com/vsftpd.html";
+SRC_URI="https://security.appspot.com/downloads/${P}.tar.gz";
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
+IUSE="pam ssl tcpd"
+
+DEPEND="
+       >=sys-libs/libcap-2
+       pam? ( sys-libs/pam )
+       !pam? ( virtual/libcrypt:= )
+       ssl? ( dev-libs/openssl:0= )
+       tcpd? ( >=sys-apps/tcp-wrappers-7.6 )
+"
+
+RDEPEND="${DEPEND}
+       net-ftp/ftpbase
+"
+
+src_prepare() {
+       local PATCHES=(
+               "${FILESDIR}"/vsftpd-2.3.2-kerberos.patch
+               "${FILESDIR}"/vsftpd-3.0.2-alpha.patch
+               "${FILESDIR}"/vsftpd-3.0.3-sparc.patch
+               "${FILESDIR}"/vsftpd-3.0.5-seccomp.patch
+               "${FILESDIR}"/vsftpd-3.0.5-gcc15.patch
+       )
+       default
+}
+
+define() {
+       sed -i -e "/#undef $2/c#define $2${3:+ }$3" "$1" || die
+}
+
+undef() {
+       sed -i -e "/#define $2/c#undef $2" "$1" || die
+}
+
+src_configure() {
+       libs=( -lcap )
+
+       if use pam; then
+               libs+=( -lpam )
+       else
+               undef builddefs.h VSF_BUILD_PAM
+               libs+=( -lcrypt )
+       fi
+
+       if use ssl; then
+               define builddefs.h VSF_BUILD_SSL
+               libs+=( -lcrypto -lssl )
+       fi
+
+       if use tcpd; then
+               define builddefs.h VSF_BUILD_TCPWRAPPERS
+               libs+=( -lwrap )
+       fi
+
+       if use elibc_musl; then
+               # musl does not support utmp/wtmp
+               # https://bugs.gentoo.org/713952
+               undef sysdeputil.c VSF_SYSDEP_HAVE_UTMPX
+       fi
+}
+
+src_compile() {
+       local args=(
+               CC="$(tc-getCC)"
+               CFLAGS="${CFLAGS}"
+               LDFLAGS="${LDFLAGS}"
+               LIBS="${libs[*]}"
+               LINK=
+       )
+       emake "${args[@]}"
+}
+
+src_install() {
+       into /usr
+       dosbin vsftpd
+
+       doman vsftpd.conf.5 vsftpd.8
+
+       insinto /etc/logrotate.d
+       newins "${FILESDIR}"/vsftpd.logrotate vsftpd
+
+       insinto /etc/xinetd.d
+       newins "${FILESDIR}"/vsftpd.xinetd vsftpd
+
+       newinitd "${FILESDIR}"/vsftpd.init-3.0.5 vsftpd
+
+       systemd_newunit "${FILESDIR}"/vsftpd.service-3.0.5 vsftpd.service
+       systemd_newunit "${FILESDIR}"/vsftpd_at.service-3.0.5 [email protected]
+       systemd_dounit "${FILESDIR}"/vsftpd.socket
+
+       keepdir /usr/share/empty
+
+       dodoc vsftpd.conf
+       dodoc -r EXAMPLE SECURITY
+
+       einstalldocs
+}
+
+pkg_preinst() {
+       if [[ ! -e ${EROOT}/etc/vsftpd.conf && -e 
${EROOT}/etc/vsftpd/vsftpd.conf ]]; then
+               elog "Moving ${EROOT}/etc/vsftpd/vsftpd.conf to 
${EROOT}/etc/vsftpd.conf"
+               mv "${EROOT}"/etc/{vsftpd/,}vsftpd.conf || die
+       fi
+}

Reply via email to