[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Current /usr/bin/ftp



On Thu, Feb 03, 2000 at 12:57:00PM +0000, John Wright wrote:
> Looks like a change from using gethostbyname to getaddrinfo means that I'm
> getting 
> 
> ftp: name or service is not known: Undefined error: 0
> 
> >From /usr/bin/ftp -current on a 2.6-release installation.
> 
> Urm... What do I need to upgrade to get it working?

Everything, I'm afraid.

Oops, plain forgot about IPv6 and Kame.

If you just want the Y2K work-around, go back to 2.6, and use the latest change
to util.c, e.g., this patch:
Index: util.c
===================================================================
RCS file: /cvs/src/usr.bin/ftp/util.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -p -r1.22 -r1.23
--- util.c	1999/12/08 12:57:06	1.22
+++ util.c	2000/02/01 20:53:06	1.23
@@ -565,6 +565,26 @@ remotemodtime(file, noisy)
 	if (command("MDTM %s", file) == COMPLETE) {
 		struct tm timebuf;
 		int yy, mo, day, hour, min, sec;
+ 		/*
+ 		 * time-val = 14DIGIT [ "." 1*DIGIT ]
+ 		 *		YYYYMMDDHHMMSS[.sss]
+ 		 * mdtm-response = "213" SP time-val CRLF / error-response
+ 		 */
+		/* TODO: parse .sss as well, use timespecs. */
+		char *timestr = reply_string;
+
+		/* Repair `19%02d' bug on server side */
+		while (!isspace(*timestr))
+			timestr++;
+		while (isspace(*timestr))
+			timestr++;
+		if (strncmp(timestr, "191", 3) == 0) {
+ 			fprintf(ttyout,
+ 	    "Y2K warning! Fixed incorrect time-val received from server.\n");
+	    		timestr[0] = ' ';
+			timestr[1] = '2';
+			timestr[2] = '0';
+		}
 		sscanf(reply_string, "%*s %04d%02d%02d%02d%02d%02d", &yy, &mo,
 			&day, &hour, &min, &sec);
 		memset(&timebuf, 0, sizeof(timebuf));
-- 
	Marc Espie		
|anime, sf, juggling, unicycle, acrobatics, comics...
|AmigaOS, OpenBSD, C++, perl, Icon, PostScript...
| `real programmers don't die, they just get out of beta'



Visit your host, monkey.org