diff --git a/SOURCES/netkit-ftp-0.17-arg_max1.patch b/SOURCES/netkit-ftp-0.17-arg_max1.patch new file mode 100644 index 0000000..7fe5616 --- /dev/null +++ b/SOURCES/netkit-ftp-0.17-arg_max1.patch @@ -0,0 +1,29 @@ +diff -up netkit-ftp-0.17/ftp/glob.c.arg_max1 netkit-ftp-0.17/ftp/glob.c +--- netkit-ftp-0.17/ftp/glob.c.arg_max1 2012-01-24 12:59:09.335021131 +0100 ++++ netkit-ftp-0.17/ftp/glob.c 2012-01-24 13:05:27.752028732 +0100 +@@ -55,10 +55,15 @@ char glob_rcsid[] = + #include "ftp_var.h" /* for protos only */ + #include "glob.h" + ++#ifndef LOWEST_ARG_MAX ++ #define LOWEST_ARG_MAX 2621440 /* ARG_MAX for default stack size limit 10240 */ ++#endif ++ + #define QUOTE 0200 + #define TRIM 0177 + #define eq(a,b) (strcmp(a, b)==0) +-#define GAVSIZ (sysconf(_SC_ARG_MAX)/6) ++#define max(a,b) (a > b ? a : b) ++#define GAVSIZ (max((int)sysconf(_SC_ARG_MAX), LOWEST_ARG_MAX)/6) + #define isdir(d) ((d.st_mode & S_IFMT) == S_IFDIR) + + const char *globerr; +@@ -159,7 +164,7 @@ ginit(entry *agargv) + gargv = agargv; + sortbas = agargv; + gargc = 0; +- gnleft = sysconf(_SC_ARG_MAX) - 4; ++ gnleft = max((int)sysconf(_SC_ARG_MAX), LOWEST_ARG_MAX) - 4; + } + + static diff --git a/SPECS/ftp.spec b/SPECS/ftp.spec index 9eb319b..5bc735e 100644 --- a/SPECS/ftp.spec +++ b/SPECS/ftp.spec @@ -1,7 +1,7 @@ Summary: The standard UNIX FTP (File Transfer Protocol) client Name: ftp Version: 0.17 -Release: 66%{?dist} +Release: 67%{?dist} License: BSD with advertising Group: Applications/Internet Source0: ftp://ftp.linux.org.uk/pub/linux/Networking/netkit/netkit-ftp-%{version}.tar.gz @@ -40,6 +40,7 @@ Patch31: netkit-ftp-0.17-commands-leaks.patch Patch32: netkit-ftp-0.17-lsn-timeout.patch Patch33: netkit-ftp-0.17-getlogin.patch Patch34: netkit-ftp-0.17-token.patch +Patch35: netkit-ftp-0.17-arg_max1.patch BuildRequires: glibc-devel, readline-devel, ncurses-devel @@ -87,6 +88,7 @@ file transfers. %patch32 -p1 -b .lsn-timeout %patch33 -p1 -b .getlogin %patch34 -p1 -b .token +%patch35 -p1 -b .arg_max1 %build sh configure --with-c-compiler=gcc --enable-ipv6 @@ -115,6 +117,9 @@ make INSTALLROOT=${RPM_BUILD_ROOT} install %{_mandir}/man5/netrc.* %changelog +* Wed Feb 3 2016 Jan Synáček - 0.17-67 +- fix 'Out of memory' message when stacksize is set to unlimited (#1304064) + * Fri Jan 24 2014 Daniel Mach - 0.17-66 - Mass rebuild 2014-01-24