Browse Source

inetutils: Add HAVE_DECL_GETPASS checks to ftp

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.
android-5
Fredrik Fornwall 8 years ago
parent
commit
795d376ef1
  1. 2
      packages/inetutils/build.sh
  2. 36
      packages/inetutils/ftp-getpass.patch

2
packages/inetutils/build.sh

@ -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:

36
packages/inetutils/ftp-getpass.patch

@ -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;
Loading…
Cancel
Save