From owner-freebsd-bugs Tue Sep 24 10:20: 6 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E595037B401 for ; Tue, 24 Sep 2002 10:20:03 -0700 (PDT) Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 54F9C43E65 for ; Tue, 24 Sep 2002 10:20:03 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id g8OHK2Co078319 for ; Tue, 24 Sep 2002 10:20:02 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id g8OHK2w1078318; Tue, 24 Sep 2002 10:20:02 -0700 (PDT) Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9C84D37B406 for ; Tue, 24 Sep 2002 10:11:40 -0700 (PDT) Received: from wwweasel.geeksrus.net (wwweasel.geeksrus.net [64.8.210.226]) by mx1.FreeBSD.org (Postfix) with ESMTP id 646D143E75 for ; Tue, 24 Sep 2002 10:11:39 -0700 (PDT) (envelope-from alane@wwweasel.geeksrus.net) Received: from wwweasel.geeksrus.net (smmsp@localhost [127.0.0.1]) by wwweasel.geeksrus.net (8.12.6/8.12.6) with ESMTP id g8OHB8HL083284; Tue, 24 Sep 2002 13:11:08 -0400 (EDT) (envelope-from alane@wwweasel.geeksrus.net) Received: (from root@localhost) by wwweasel.geeksrus.net (8.12.6/8.12.6/Submit) id g8OHB646083266; Tue, 24 Sep 2002 13:11:06 -0400 (EDT) (envelope-from alane) Message-Id: <200209241711.g8OHB646083266@wwweasel.geeksrus.net> Date: Tue, 24 Sep 2002 13:11:06 -0400 (EDT) From: Alan Eldridge Reply-To: Alan Eldridge To: FreeBSD-gnats-submit@FreeBSD.org Cc: kris@obsecurity.org X-Send-Pr-Version: 3.113 Subject: bin/43337: fetch: -s fails if -4 or possibly other options given; inappropraite exit code if file does not exist on server Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 43337 >Category: bin >Synopsis: fetch: -s fails if -4 or possibly other options given; inappropraite exit code if file does not exist on server >Confidential: no >Severity: serious >Priority: high >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Sep 24 10:20:02 PDT 2002 >Closed-Date: >Last-Modified: >Originator: Alan Eldridge >Release: FreeBSD 4.7-RC i386 >Organization: Geeksrus.NET >Environment: System: FreeBSD wwweasel.geeksrus.net 4.7-RC FreeBSD 4.7-RC #0: Sat Sep 21 10:38:39 EDT 2002 root@wwweasel.geeksrus.net:/usr/obj/usr/src/sys/WWWEASEL i386 >Description: Kris, I Cc'd you in hopes you would know who to route this to. Thanks. Feel free to edit-pr your name off the Cc list. -s option to fetch is supposed to show size of remote file. it prints nothing if the -4 option is also used, even when the file exists and the -4 option can be used to fetch it. If the file does not exist, fetch still returns an exit code of 0, which is inappropriate for applications trying to determine if the file exists on the server or not. Additionally, the value "Unknown" is not appropriate for when the file is not there. How is one to distinguish between file-not-present and server-won't-tell-me-size conditions, especially using http: urls? >How-To-Repeat: [root@wwweasel:~]# fetch -v -v -v -s -4 -p -T 60 ftp://snapshots.jp.FreeBSD.org/pub/FreeBSD/snapshots/i386/ISO-IMAGES/4.7-RC-20020918-JPSNAP.iso ---> snapshots.jp.FreeBSD.org:21 looking up snapshots.jp.FreeBSD.org [root@wwweasel:~]# fetch -s -4 -p ftp://snapshots.jp.FreeBSD.org/pub/FreeBSD/snapshots/i386/ISO-IMAGES/4.7-RC-20020918-JPSNAP.iso [root@wwweasel:~]# fetch -s -p ftp://snapshots.jp.FreeBSD.org/pub/FreeBSD/snapshots/i386/ISO-IMAGES/4.7-RC-20020918-JPSNAP.iso 173539328 [root@wwweasel:~]# fetch -s -p ftp://snapshots.jp.FreeBSD.org/pub/FreeBSD/snapshots/i386/ISO-IMAGES/4.7-RC-20030918-JPSNAP.iso Unknown [root@wwweasel:~]# echo $? 0 >Fix: Don't know. Have not investigated. However, since these are three distinct problems, it probably impacts more than one area of the code, and possibly libfetch as well as the fetch program itself. >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message