ftp: Portability to Android.

Add external declaration of getpass().
Tiny patch by Fredrik Fornwall <fredrik@fornwall.net>.
This commit is contained in:
Mats Erik Andersson
2017-03-02 16:20:47 +01:00
parent 73e2811a05
commit 56fc0cc15d
3 changed files with 22 additions and 0 deletions

View File

@@ -1,3 +1,16 @@
2017-03-02 Fredrik Fornwall <fredrik@fornwall.net> (tiny change)
ftp: Portability to Android.
Without a check for HAVE_DECL_GETPASS and without making a
local function declaration, the implicit declaration causes
crashes on 64-bit systems lacking declared getpass(), such
as Android. Reported in:
http://lists.gnu.org/archive/html/bug-inetutils/2016-10/msg00000.html
* ftp/cmds.c [!HAVE_DECL_GETPASS] (user, account): Declare getpass()
as external function.
* ftp/ftp.c (login): Likewise.
2017-03-02 Mats Erik Andersson <gnu@gisladisker.se>
whois: Update Canadian TLD server.

View File

@@ -1721,6 +1721,9 @@ shell (int argc, char **argv _GL_UNUSED_PARAMETER)
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 @@ globulize (char *cp)
void
account (int argc, char **argv)
{
#if !HAVE_DECL_GETPASS
extern char *getpass ();
#endif
char acct[50], *ap;
if (argc > 1)

View File

@@ -296,6 +296,9 @@ bad:
int
login (char *host)
{
#if !HAVE_DECL_GETPASS
extern char *getpass ();
#endif
char tmp[80];
char *user, *pass, *acct, *p;
int n, aflag = 0;