[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Current /usr/bin/ftp
- To: misc_(_at_)_openbsd_(_dot_)_org
- Subject: Re: Current /usr/bin/ftp
- From: Marc Espie <Marc_(_dot_)_Espie_(_at_)_liafa_(_dot_)_jussieu_(_dot_)_fr>
- Date: Thu, 3 Feb 2000 16:26:28 +0100
- Mail-followup-to: misc_(_at_)_openbsd_(_dot_)_org
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