Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 24 Sep 2002 13:11:06 -0400 (EDT)
From:      Alan Eldridge <ports@geeksrus.net>
To:        FreeBSD-gnats-submit@FreeBSD.org
Cc:        kris@obsecurity.org
Subject:   bin/43337: fetch: -s fails if -4 or possibly other options given; inappropraite exit code if file does not exist on server
Message-ID:  <200209241711.g8OHB646083266@wwweasel.geeksrus.net>

next in thread | raw e-mail | index | archive | help

>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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200209241711.g8OHB646083266>