From owner-freebsd-current Thu Aug 17 18:54:50 2000 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.129.65]) by hub.freebsd.org (Postfix) with ESMTP id 1D94337BDF9 for ; Thu, 17 Aug 2000 18:51:27 -0700 (PDT) Received: from gatekeeper.whistle.com (gatekeeper.whistle.com [207.76.204.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8090C6E3A95 for ; Thu, 17 Aug 2000 13:30:41 -0700 (PDT) Received: from bubba.whistle.com (bubba.whistle.com [207.76.205.7]) by gatekeeper.whistle.com (8.9.3/8.9.3) with ESMTP id NAA10784; Thu, 17 Aug 2000 13:29:28 -0700 (PDT) (envelope-from archie@whistle.com) Received: (from archie@localhost) by bubba.whistle.com (8.9.3/8.9.3) id NAA96024; Thu, 17 Aug 2000 13:29:27 -0700 (PDT) (envelope-from archie) From: Archie Cobbs Message-Id: <200008172029.NAA96024@bubba.whistle.com> Subject: Re: 5.0 snapshot install problem In-Reply-To: <20000818.023721.115915969.ume@mahoroba.org> from Hajimu UMEMOTO at "Aug 18, 2000 02:37:21 am" To: Hajimu UMEMOTO Date: Thu, 17 Aug 2000 13:29:27 -0700 (PDT) Cc: freebsd-current@freebsd.org X-Mailer: ELM [version 2.4ME+ PL68 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hajimu UMEMOTO writes: > > It seems -CURRENT's libftpio.c always set passive flag according to > > environment variable FTP_PASSIVE_MODE. Then, PASV/PORT selection > > obeys only FTP_PASSIVE_MODE and direction of sysinstall is ignored. > > Does this patch fix your problem? > > archie> Don't know, because I'd have to create new install floppies first.. > > archie> But I don't think this patch would fix things.. I don't see any > archie> logical flaw there. ftpPassive() just checks that the toggle is > archie> set to the right value -- it doesn't necessarily do anything. > > After checking, FTP_PASSIVE_MODE is tested by check_passive() every > fetGET() call. check_passive() calls ftpPassive(). So, > ftp->is_passive is resetted. OK, now I think I see part of the problem.. check out ftpPassive(): /* Unlike binary mode, passive mode is a toggle! :-( */ int ftpPassive(FILE *fp, int st) { FTP_t ftp = fcookie(fp); int i; if (ftp->is_passive == st) return SUCCESS; switch (ftp->addrtype) { case AF_INET: i = cmd(ftp, "PASV"); if (i < 0) return i; if (i != FTP_PASSIVE_HAPPY) return FAILURE; break; case AF_INET6: i = cmd(ftp, "EPSV"); if (i < 0) return i; if (i != FTP_EPASSIVE_HAPPY) { i = cmd(ftp, "LPSV"); if (i < 0) return i; if (i != FTP_LPASSIVE_HAPPY) return FAILURE; } break; } ftp->is_passive = !ftp->is_passive; return SUCCESS; } This is completely wrong. The comment "passive mode is a toggle" is incorrect. It's correct when you're talking about ftp(1)'s "pass" command, but NOT true in the FTP protocol. Therefore ftpPassive() should not be issuing any PASV command at all; the sending of the PASV or PORT command (which applies per-transfer) is handled by ftp_file_op() anyway (so the one sent by ftpPassive() ends up having no effect anyway). What must be happening is that sysinstall is actually setting up an active mode connection, and the PASV is simply the extraneous one emitted by ftpPassive(). But why is sysinstall going to active mode? I *know* FTP passive was selected.. In the meantime, I'll fix ftpPassive().. -Archie ___________________________________________________________________________ Archie Cobbs * Whistle Communications, Inc. * http://www.whistle.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message