NetBSD Problem Report #24744

Received: (qmail 22422 invoked by uid 605); 11 Mar 2004 12:59:03 -0000
Message-Id: <200403101122.i2ABML800536@poseidon.pantheon.ton.tut.fi>
Date: Wed, 10 Mar 2004 13:22:22 +0200 (EET)
From: jarmo.jaakkola@iki.fi
Sender: gnats-bugs-owner@NetBSD.org
Reply-To: jarmo.jaakkola@iki.fi
To: gnats-bugs@gnats.netbsd.org
Subject: pkg_add can't find packages with FTP without full name
X-Send-Pr-Version: 3.95

>Number:         24744
>Category:       pkg
>Synopsis:       pkg_add can't find packages with FTP without full name
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    hubertf
>State:          closed
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Thu Mar 11 13:00:01 +0000 2004
>Closed-Date:    Sat Sep 17 20:01:04 +0000 2005
>Last-Modified:  Sat Sep 17 20:01:04 +0000 2005
>Originator:     Jarmo Jaakkola
>Release:        NetBSD 1.6.2
>Organization:
>Environment:
System: NetBSD poseidon.pantheon.ton.tut.fi 1.6.2 NetBSD 1.6.2 (GENERIC) #0: Tue Feb 10 21:53:10 UTC 2004 autobuild@tgm.netbsd.org:/autobuild/netbsd-1-6-PATCH002/i386/OBJ/autobuild/netbsd-1-6-PATCH002/src/sys/arch/i386/compile/GENERIC i386
Architecture: i386
Machine: i386
>Description:
pkg_add cannot install packages from some FTP-sites, unless the precise
version number and file suffix is given.  Apparently, some server's don't
interpret following patterns correctly: package-*.t[bg]z
>How-To-Repeat:
For example:
$ export PKG_PATH='ftp://ftp.fi.netbsd.org/pub/NetBSD/packages/1.6.2/i386/All'
$ pkg_add free
>Fix:
Instead of 'nlist package-*.t[bg]z' possible packages should be listed with
'nlist package-*.tgz' and 'nlist package-*.tbz'.
>Release-Note:
>Audit-Trail:

From: "Jeremy C. Reed" <reed@reedmedia.net>
To: jarmo.jaakkola@iki.fi
Cc: gnats-bugs@gnats.netbsd.org
Subject: Re: pkg/24744: pkg_add can't find packages with FTP without full
 name
Date: Thu, 11 Mar 2004 07:49:16 -0800 (PST)

 On Wed, 10 Mar 2004 jarmo.jaakkola@iki.fi wrote:

 > >Fix:
 > Instead of 'nlist package-*.t[bg]z' possible packages should be listed with
 > 'nlist package-*.tgz' and 'nlist package-*.tbz'.

 Another idea (used by FreeBSD) is to have a directory containing all
 package names (PKGBASE) as symlinks to the packages with the version
 numbers.

    Jeremy C. Reed
    http://www.reedmedia.net/

Responsible-Changed-From-To: pkg-manager->hubertf
Responsible-Changed-By: wiz@netbsd.org
Responsible-Changed-When: Thu, 17 Mar 2005 17:24:59 +0000
Responsible-Changed-Why:
hubertf added the wildcard support.


From: Hubert Feyrer <hubert@feyrer.de>
To: jarmo.jaakkola@iki.fi
Cc: gnats-bugs@netbsd.org
Subject: Re: pkg/24744
Date: Fri, 18 Mar 2005 00:58:37 +0100 (CET)

 Hi,

 I'm looking at your PR pkg/24744 (pkg_add can't find packages with FTP 
 without full name):

 > >Description:
 > pkg_add cannot install packages from some FTP-sites, unless the precise
 > version number and file suffix is given.  Apparently, some server's don't
 > interpret following patterns correctly: package-*.t[bg]z

 Your observation is wrong.
 If you look closely at output of "pkg_add -v free", you'll see that it 
 first runs "nlist free somefile" (successfully!), and then hangs after "cd 
 .". It doesn't even get to any .t[gb]z part.

 The problem of the hang is that ftp.fi.netbsd.org seems to use a funky FTP 
 server that returns a code 257 where ~everyone else returns either 250 or 
 550. The fact that the text following the 257 is rather long doesn't help 
 to this.

 The patch below fixes the problem for me, and I'll commit it to 
 NetBSD-current soonish, then look into pullups for the various NetBSD 
 releases, and get some help to get it into pkg_install.

 I'd appreciate if you could try to recompile your NetBSD's 
 src/usr.sbin/pkg_install, and let me know if the problem is fixed for you.


   - Hubert

 Index: lib/ftpio.c
 ===================================================================
 RCS file: /cvsroot/src/usr.sbin/pkg_install/lib/ftpio.c,v
 retrieving revision 1.62
 diff -u -r1.62 ftpio.c
 --- lib/ftpio.c	20 Dec 2003 03:31:56 -0000	1.62
 +++ lib/ftpio.c	17 Mar 2005 23:52:16 -0000
 @@ -139,7 +139,7 @@
   expect(int fd, const char *str, int *ftprc)
   {
   	int rc;
 -	char buf[90]; 
 +	char buf[256];
   #if EXPECT_DEBUG
   	char *vstr;
   #endif /* EXPECT_DEBUG */
 @@ -654,7 +654,7 @@
   	}

   	/* Sync - don't remove */
 -	rc = ftp_cmd("cd .\n", "\n(550|250).*\n");
 +	rc = ftp_cmd("cd .\n", "\n(550|250|257).*\n");
   	if (rc != 250) {
   		warnx("chdir failed!");
   		unlink(tmpname);	/* remove clutter */

 -- 
 NetBSD - Free AND Open!      (And of course secure, portable, yadda yadda)

State-Changed-From-To: open->feedback
State-Changed-By: hubertf@netbsd.org
State-Changed-When: Fri, 18 Mar 2005 00:01:47 +0000
State-Changed-Why:
Please let me know if the patch works for you.

 - Hubert


From: Hubert Feyrer <hubertf@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: PR/24744 CVS commit: src/usr.sbin/pkg_install/lib
Date: Fri, 18 Mar 2005 00:01:11 +0000 (UTC)

 Module Name:	src
 Committed By:	hubertf
 Date:		Fri Mar 18 00:01:11 UTC 2005

 Modified Files:
 	src/usr.sbin/pkg_install/lib: ftpio.c

 Log Message:
 Address PR pkg/24744 by Jarmo Jaakkola <jarmo.jaakkola@iki.fi>:
  * ftp.fi.netbsd.org returns "257" in return to a "cd" command, accept that
    (in addition to 250 and 550). Seems to be allowed per RFC 959.
  * Make buffer for reply bigger (not too big, as it may hit performance).


 To generate a diff of this commit:
 cvs rdiff -r1.66 -r1.67 src/usr.sbin/pkg_install/lib/ftpio.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: Hubert Feyrer <hubertf@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: PR/24744 CVS commit: src/usr.sbin/pkg_install/lib
Date: Fri, 18 Mar 2005 00:12:35 +0000 (UTC)

 Module Name:	src
 Committed By:	hubertf
 Date:		Fri Mar 18 00:12:35 UTC 2005

 Modified Files:
 	src/usr.sbin/pkg_install/lib: version.h

 Log Message:
 Bump PKGTOOLS_VERSION to today's date to allow telling in which version
 PR 24744 was fixed (affects lib/ftpio.c).


 To generate a diff of this commit:
 cvs rdiff -r1.64 -r1.65 src/usr.sbin/pkg_install/lib/version.h

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: Matthias Scheler <tron@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: PR/24744 CVS commit: [netbsd-3] src/usr.sbin/pkg_install/lib
Date: Sat, 19 Mar 2005 13:16:56 +0000 (UTC)

 Module Name:	src
 Committed By:	tron
 Date:		Sat Mar 19 13:16:56 UTC 2005

 Modified Files:
 	src/usr.sbin/pkg_install/lib [netbsd-3]: ftpio.c

 Log Message:
 Pull up revision 1.67 (requested by hubertf in ticket #8):
 Address PR pkg/24744 by Jarmo Jaakkola <jarmo.jaakkola@iki.fi>:
   * ftp.fi.netbsd.org returns "257" in return to a "cd" command, accept that
     (in addition to 250 and 550). Seems to be allowed per RFC 959.
   * Make buffer for reply bigger (not too big, as it may hit performance).


 To generate a diff of this commit:
 cvs rdiff -r1.66 -r1.66.2.1 src/usr.sbin/pkg_install/lib/ftpio.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: Matthias Scheler <tron@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: PR/24744 CVS commit: [netbsd-3] src/usr.sbin/pkg_install/lib
Date: Sat, 19 Mar 2005 13:18:38 +0000 (UTC)

 Module Name:	src
 Committed By:	tron
 Date:		Sat Mar 19 13:18:38 UTC 2005

 Modified Files:
 	src/usr.sbin/pkg_install/lib [netbsd-3]: version.h

 Log Message:
 Pull up revision 1.65 (requested by hubertf in ticket #9):
 Bump PKGTOOLS_VERSION to today's date to allow telling in which version
 PR 24744 was fixed (affects lib/ftpio.c).


 To generate a diff of this commit:
 cvs rdiff -r1.64 -r1.64.2.1 src/usr.sbin/pkg_install/lib/version.h

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: Hubert Feyrer <hubertf@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: PR/24744 CVS commit: pkgsrc/pkgtools/pkg_install/files/lib
Date: Sun, 20 Mar 2005 15:55:54 +0000 (UTC)

 Module Name:	pkgsrc
 Committed By:	hubertf
 Date:		Sun Mar 20 15:55:54 UTC 2005

 Modified Files:
 	pkgsrc/pkgtools/pkg_install/files/lib: ftpio.c version.h

 Log Message:
 Address PR pkg/24744 by Jarmo Jaakkola <jarmo.jaakkola@iki.fi>:
  * ftp.fi.netbsd.org returns "257" in return to a "cd" command, accept that
    (in addition to 250 and 550). Seems to be allowed per RFC 959.
  * Make buffer for reply bigger (not too big, as it may hit performance).
  * Bump PKGTOOLS_VERSION (NOT!!! PKGTOOLS_REQD) to 20050318


 To generate a diff of this commit:
 cvs rdiff -r1.14 -r1.15 pkgsrc/pkgtools/pkg_install/files/lib/ftpio.c
 cvs rdiff -r1.41 -r1.42 pkgsrc/pkgtools/pkg_install/files/lib/version.h

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: Hubert Feyrer <hubertf@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: PR/24744 CVS commit: pkgsrc/doc
Date: Sun, 20 Mar 2005 15:56:42 +0000 (UTC)

 Module Name:	pkgsrc
 Committed By:	hubertf
 Date:		Sun Mar 20 15:56:42 UTC 2005

 Modified Files:
 	pkgsrc/doc: CHANGES

 Log Message:
 Address PR pkg/24744 by Jarmo Jaakkola <jarmo.jaakkola@iki.fi>:
  * ftp.fi.netbsd.org returns "257" in return to a "cd" command, accept that
    (in addition to 250 and 550). Seems to be allowed per RFC 959.
  * Make buffer for reply bigger (not too big, as it may hit performance).
  * Bump PKGTOOLS_VERSION (NOT!!! PKGTOOLS_REQD) to 20050318


 To generate a diff of this commit:
 cvs rdiff -r1.9521 -r1.9522 pkgsrc/doc/CHANGES

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: Jeff Rizzo <riz@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: PR/24744 CVS commit: [netbsd-2] src/usr.sbin/pkg_install/lib
Date: Tue, 10 May 2005 18:21:42 +0000 (UTC)

 Module Name:	src
 Committed By:	riz
 Date:		Tue May 10 18:21:42 UTC 2005

 Modified Files:
 	src/usr.sbin/pkg_install/lib [netbsd-2]: ftpio.c

 Log Message:
 Pull up revision 1.67 (requested by hubertf in ticket #1333):
 Address PR pkg/24744 by Jarmo Jaakkola <jarmo.jaakkola@iki.fi>:
   * ftp.fi.netbsd.org returns "257" in return to a "cd" command, accept that
     (in addition to 250 and 550). Seems to be allowed per RFC 959.
   * Make buffer for reply bigger (not too big, as it may hit performance).


 To generate a diff of this commit:
 cvs rdiff -r1.62 -r1.62.4.1 src/usr.sbin/pkg_install/lib/ftpio.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: feedback->closed
State-Changed-By: wiz@netbsd.org
State-Changed-When: Sat, 17 Sep 2005 20:01:04 +0000
State-Changed-Why:
Feedback timeout.


>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.