ftp: Honour host aliases.

Take care to preserve the desired peer's name.  Do not
replace it with its canonical name.  Bug was reported to
the list as `2015-02/msg00000.html' by John Sullivan.
This commit is contained in:
Mats Erik Andersson
2015-03-16 23:22:12 +01:00
parent 0b7e868749
commit 495beb89da
2 changed files with 19 additions and 2 deletions

View File

@@ -1,3 +1,14 @@
2015-03-16 Mats Erik Andersson <gnu@gisladisker.se>
ftp: Honour host aliases.
While establishing the connection, do not replace the desired
peer name with its canonical name. This prevents correct use
of the netrc file. Bug reported by John Sullivan in
http://lists.gnu.org/archive/html/bug-inetutils/2015-02/msg00000.html
* ftp/cmds.c (setpeer): Do not assign value from hookup()
to HOST. Instead, only test if it is non-null.
2015-03-15 Mats Erik Andersson <gnu@gisladisker.se>
telnetd: Suppress PTY packet data.

View File

@@ -279,8 +279,14 @@ setpeer (int argc, char **argv)
port = (sp) ? ntohs (sp->s_port) : DEFPORT;
}
host = hookup (host, port);
if (host)
/* After hookup(), the global variable `hostname' contains
* the canonical host name corresponding to the alias name
* contained in HOST. The return value of hookup() is not
* NULL only if the server has answered our call. The value
* of HOST should be preserved for reporting inside login(),
* which also detects a correct stanza of the netrc file.
*/
if (hookup (host, port))
{
int overbose;