NetBSD Problem Report #3520

Received: (qmail-queue invoked from smtpd); 21 Apr 1997 16:51:58 -0000
Message-Id: <199704211651.SAA15197@vader.runit.sintef.no>
Date: Mon, 21 Apr 1997 18:51:33 +0200 (MEST)
From: Havard Eidnes <he@vader.runit.sintef.no>
Reply-To: he@vader.runit.sintef.no
To: gnats-bugs@gnats.netbsd.org
Subject: URL parsing failure in ftp
X-Send-Pr-Version: 3.95

>Number:         3520
>Category:       bin
>Synopsis:       URL parsing in ftp using ftp://host/dir/file fails
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Apr 21 10:05:01 +0000 1997
>Closed-Date:    Mon Apr 21 18:40:18 +0000 1997
>Last-Modified:  Mon Apr 21 18:43:53 +0000 1997
>Originator:     Havard Eidnes
>Release:        NetBSD-current April 20 1997
>Organization:
	SINTEF RUNIT
>Environment:
System: NetBSD vader.runit.sintef.no 1.2D NetBSD 1.2D (VADER) #0: Mon Apr 14 23:27:38 MEST 1997 he@vader.runit.sintef.no:/usr/src/sys/arch/i386/compile/VADER i386


>Description:
	URL parsing in fetch.c in ftp misparses an URL of the form
	ftp://host/dir/file, resulting in "host" being used as the user
	name, which leads to failure.

	Example:

% ftp -d ftp://ftp.ee.lbl.gov/pathchar/msri-talk.ps.gz
user ftp.ee.lbl.gov: host ftp.ee.lbl.gov port (null) dir pathchar file msri-talk.ps.gz
Connected to ee.lbl.gov.
220 ee.lbl.gov FTP server ready.
---> SYST
215 UNIX Type: L8
Remote system type is UNIX.
Using binary mode to transfer files.
---> USER ftp.ee.lbl.gov
530 Sorry, I can't accept a cleartext password over the wire.
ftp: Login failed.
ftp: Can't connect or login to host `ftp.ee.lbl.gov'
---> QUIT
221 Goodbye.
%

>How-To-Repeat:
	See above.
>Fix:
	No fix here, sorry, but the part starting at line 432 of fetch.c
	looks suspect:

                                /* look for [user:pass@]host[:port] */
                        user = host;
                        pass = strpbrk(user, ":@/");
                        if (pass == NULL || *pass == '/')
                                goto parsed_url;

	Why is "user" set to "host", and more importantly, why is it not
	reset if no user name was found in the URL?
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: lukem 
State-Changed-When: Mon Apr 21 11:40:18 PDT 1997 
State-Changed-Why:  
should be fixed in fetch.c v1.7 or greater 
>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.