Subject: CVS commit: [netbsd-3] src/usr.bin/ftp
To: None <source-changes@NetBSD.org>
From: Matthias Scheler <tron@netbsd.org>
List: source-changes
Date: 07/24/2005 10:29:53
Module Name: src
Committed By: tron
Date: Sun Jul 24 10:29:53 UTC 2005
Modified Files:
src/usr.bin/ftp [netbsd-3]: extern.h
Log Message:
Pull up revision 1.69 (requested by lukem in ticket #606):
Implement:
int getline(FILE *stream, char *buf, size_t buflen, const char **errormsg)
Read a line from the FILE stream into buf/buflen using fgets(), so up
to buflen-1 chars will be read and the result will be NUL terminated.
If the line has a trailing newline it will be removed.
If the line is too long, excess characters will be read until
newline/EOF/error.
Various -ve return values indicate different errors, and errormsg
will be changed to an error description if it's not NULL.
Convert to use getline() instead of fgets() whenever reading user input
to ensure that an overly long input line doesn't leave excess characters
for the next input operation to accidentally use as input.
Zero out the password & account after we've finished with it.
Consistently use getpass(3) (i.e, character echo suppressed) when
reading the account data. For some reason, historically the "login"
code suppressed echo for Account: yet the "user" command did not!
Display the hostname in the "getaddrinfo failed" warning.
Appease some -Wcast-qual warnings. Fixing all of these requires
significant code refactoring. (mmm, legacy code).
To generate a diff of this commit:
cvs rdiff -r1.64.2.4 -r1.64.2.5 src/usr.bin/ftp/extern.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.