inetutils: Add HAVE_DECL_GETPASS checks to ftp
authorFredrik Fornwall <fredrik@fornwall.net>
Sat, 22 Oct 2016 12:20:13 +0000 (08:20 -0400)
committerFredrik Fornwall <fredrik@fornwall.net>
Sat, 22 Oct 2016 12:20:13 +0000 (08:20 -0400)
Without the check for HAVE_DECL_GETPASS and declaring a local
function declaration the implicit int rule causes crashes on 64-bit
systems without getpass(3) such as Android.

Fixes #517.

packages/inetutils/build.sh
packages/inetutils/ftp-getpass.patch [new file with mode: 0644]

index db697bf..22ca008 100644 (file)
@@ -1,7 +1,7 @@
 TERMUX_PKG_HOMEPAGE=http://www.gnu.org/software/inetutils/
 TERMUX_PKG_DESCRIPTION="Collection of common network programs"
 TERMUX_PKG_VERSION=1.9.4
-TERMUX_PKG_BUILD_REVISION=3
+TERMUX_PKG_BUILD_REVISION=4
 TERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/inetutils/inetutils-${TERMUX_PKG_VERSION}.tar.xz
 TERMUX_PKG_DEPENDS="readline, libutil"
 # These are old cruft / not suited for android:
diff --git a/packages/inetutils/ftp-getpass.patch b/packages/inetutils/ftp-getpass.patch
new file mode 100644 (file)
index 0000000..c0695cb
--- /dev/null
@@ -0,0 +1,36 @@
+diff -u -r ../inetutils-1.9.4/ftp/cmds.c ./ftp/cmds.c
+--- ../inetutils-1.9.4/ftp/cmds.c      2015-06-09 03:41:47.000000000 -0400
++++ ./ftp/cmds.c       2016-10-22 08:13:16.282265064 -0400
+@@ -1721,6 +1721,9 @@
+ void
+ user (int argc, char **argv)
+ {
++# if !HAVE_DECL_GETPASS
++  extern char *getpass ();
++# endif
+   char acct[80];
+   int n, aflag = 0;
+@@ -2070,6 +2073,9 @@
+ void
+ account (int argc, char **argv)
+ {
++# if !HAVE_DECL_GETPASS
++  extern char *getpass ();
++# endif
+   char acct[50], *ap;
+   if (argc > 1)
+diff -u -r ../inetutils-1.9.4/ftp/ftp.c ./ftp/ftp.c
+--- ../inetutils-1.9.4/ftp/ftp.c       2015-03-31 11:40:47.000000000 -0400
++++ ./ftp/ftp.c        2016-10-22 08:13:37.005945253 -0400
+@@ -292,6 +292,9 @@
+ int
+ login (char *host)
+ {
++# if !HAVE_DECL_GETPASS
++  extern char *getpass ();
++# endif
+   char tmp[80];
+   char *user, *pass, *acct;
+   int n, aflag = 0;