[packages/ftpproxy] - rel 3, fix build on x32 and incorrect handling of time_t

baggins baggins at pld-linux.org
Sat Jun 6 15:10:25 CEST 2026


commit 244c5a7cf8e5873b72fbbe55a15f2ae7e255eaee
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Sat Jun 6 15:09:58 2026 +0200

    - rel 3, fix build on x32 and incorrect handling of time_t

 ftpproxy.spec |  4 +++-
 x32.patch     | 38 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 41 insertions(+), 1 deletion(-)
---
diff --git a/ftpproxy.spec b/ftpproxy.spec
index daada4a..6e4a3e3 100644
--- a/ftpproxy.spec
+++ b/ftpproxy.spec
@@ -2,13 +2,14 @@ Summary:	ftpproxy is an application level gateway for the FTP protocol
 Summary(pl.UTF-8):	ftpproxy jest aplikacyjną bramką dla protokołu FTP
 Name:		ftpproxy
 Version:	1.2.3
-Release:	2
+Release:	3
 License:	GPL
 Group:		Applications/Networking
 Source0:	http://ftp.daemons.de/download/%{name}-%{version}.tgz
 # Source0-md5:	c2068bc452e1d7554d3bda08030aa433
 Source1:	%{name}.inetd
 Patch0:		%{name}-modern-c.patch
+Patch1:		x32.patch
 URL:		http://ftp.daemons.de/
 BuildRequires:	ctags
 BuildRequires:	rpmbuild(macros) >= 1.268
@@ -32,6 +33,7 @@ serwerami FTP.
 %prep
 %setup -q
 %patch -P0 -p1
+%patch -P1 -p1
 
 %build
 %{__make} \
diff --git a/x32.patch b/x32.patch
new file mode 100644
index 0000000..274677a
--- /dev/null
+++ b/x32.patch
@@ -0,0 +1,38 @@
+--- ftpproxy-1.2.3/src/ftp.c~	2004-07-30 14:52:12.000000000 +0200
++++ ftpproxy-1.2.3/src/ftp.c	2026-06-06 15:05:25.456363705 +0200
+@@ -1752,8 +1752,11 @@
+ 
+ 	x = allocate(sizeof(ftp_t));
+ 	x->config = config;
++#if defined(__x86_64__) && defined(__ILP32__)
++	snprintf (x->session, sizeof(x->session) - 2, "%llu-%u", time(NULL), getpid());
++#else
+ 	snprintf (x->session, sizeof(x->session) - 2, "%lu-%u", time(NULL), getpid());
+-
++#endif
+ 
+ 	/*
+ 	 * Fix potential problems after immediate initial unseccsesful
+--- ftpproxy-1.2.3/src/ftp.c~	2026-06-06 15:05:57.000000000 +0200
++++ ftpproxy-1.2.3/src/ftp.c	2026-06-06 15:06:25.979977178 +0200
+@@ -1826,7 +1826,7 @@
+ 				syslog(LOG_NOTICE, "%s %s: %ld bytes", x->ch.command, x->ch.filename, x->ch.bytes);
+ 
+ 				if (x->xlfp != NULL) {
+-					unsigned long now;
++					time_t now;
+ 					char	date[80];
+ 
+ 					/*
+@@ -1838,7 +1838,11 @@
+ 
+ 					now = time(NULL);
+ 					copy_string(date, ctime(&now), sizeof(date));
++#if defined(__x86_64__) && defined(__ILP32__)
++					fprintf (x->xlfp, "%s %llu %s %lu %s %c %c %c %c %s %s %d %s %c\n",
++#else
+ 					fprintf (x->xlfp, "%s %lu %s %lu %s %c %c %c %c %s %s %d %s %c\n",
++#endif
+ 							date,
+ 							now - x->ch.started,
+ 							x->client_ip,
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/ftpproxy.git/commitdiff/244c5a7cf8e5873b72fbbe55a15f2ae7e255eaee



More information about the pld-cvs-commit mailing list