From fullermd@over-yonder.net  Sun Jan 30 14:55:25 2005
Return-Path: <fullermd@over-yonder.net>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 32F4716A4CE
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 30 Jan 2005 14:55:25 +0000 (GMT)
Received: from mortis.over-yonder.net (adsl-222-103-242.jan.bellsouth.net [68.222.103.242])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 5DC5043D2F
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 30 Jan 2005 14:55:24 +0000 (GMT)
	(envelope-from fullermd@over-yonder.net)
Received: by mortis.over-yonder.net (Postfix, from userid 100)
	id 0FFB4210CD; Sun, 30 Jan 2005 08:55:09 -0600 (CST)
Message-Id: <20050130145509.0FFB4210CD@mortis.over-yonder.net>
Date: Sun, 30 Jan 2005 08:55:09 -0600 (CST)
From: Matthew D.Fuller <fullermd@over-yonder.net>
Reply-To: Matthew D.Fuller <fullermd@over-yonder.net>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [PATCH] Bug in pkg_{info,delete} package name lookup
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         76858
>Category:       bin
>Synopsis:       [PATCH] Bug in pkg_{info,delete} package name lookup
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jan 30 15:00:42 GMT 2005
>Closed-Date:    Mon Oct 10 08:41:21 GMT 2005
>Last-Modified:  Mon Oct 10 08:41:21 GMT 2005
>Originator:     Matthew D. Fuller
>Release:        FreeBSD 5.3-STABLE i386
>Organization:
>Environment:
System: FreeBSD mortis.sighup.org 5.3-STABLE FreeBSD 5.3-STABLE #0: Sat Jan 29 00:29:15 CST 2005 fullermd@mortis:/usr/obj/usr/src/sys/MORTIS i386


>Description:
    The code in pkg_* that dissects a full path to get a package name out
    of it doesn't take account of packages that start with numbers, even
    though it should, and the comment says it does.

>How-To-Repeat:
    (ttyp3):{267}% pkg_info /var/db/pkg/3dc-0.8.1/
    pkg_info: can't find package 'pkg' installed or in a file!

>Fix:

Index: delete/main.c
===================================================================
RCS file: /usr/cvs/src/usr.sbin/pkg_install/delete/main.c,v
retrieving revision 1.26
diff -u -r1.26 main.c
--- delete/main.c	29 Jun 2004 18:54:47 -0000	1.26
+++ delete/main.c	30 Jan 2005 14:48:29 -0000
@@ -121,7 +121,7 @@
 		 * package name.  Otherwise we've come across a trailing '/' and
 		 * need to continue our quest.
 		 */
-		if (isalpha(*pkgs_split) || ((MatchType == MATCH_GLOB) && \
+		if (isalnum(*pkgs_split) || ((MatchType == MATCH_GLOB) && \
 		    strpbrk(pkgs_split, "*?[]") != NULL)) {
 		    *argv = pkgs_split;
 		    break;
Index: info/main.c
===================================================================
RCS file: /usr/cvs/src/usr.sbin/pkg_install/info/main.c,v
retrieving revision 1.47
diff -u -r1.47 main.c
--- info/main.c	18 Oct 2004 05:34:54 -0000	1.47
+++ info/main.c	30 Jan 2005 14:48:51 -0000
@@ -240,7 +240,7 @@
 		 * we've come across a trailing '/' and need to continue our
 		 * quest.
 		 */
-		if (isalpha(*pkgs_split) || ((MatchType == MATCH_GLOB) && \
+		if (isalnum(*pkgs_split) || ((MatchType == MATCH_GLOB) && \
 		    strpbrk(pkgs_split, "*?[]") != NULL)) {
 		    *argv = pkgs_split;
 		    break;
>Release-Note:
>Audit-Trail:

From: "Matthew D.Fuller" <fullermd@over-yonder.net>
To: FreeBSD-gnats-submit@FreeBSD.org
Cc:  
Subject: Re: bin/76858: [PATCH] Bug in pkg_{install,delete} package name lookup
Date: Sun, 30 Jan 2005 09:11:12 -0600

 *snort*
 
 > >Synopsis:       [PATCH] Bug in pkg_{install,delete} package name lookup
                                        ^^^^^^^
                                        info
 
 
 -- 
 Matthew Fuller     (MF4839)   |  fullermd@over-yonder.net
 Systems/Network Administrator |  http://www.over-yonder.net/~fullermd/
 
 "The only reason I'm burning my candle at both ends, is because I
       haven't figured out how to light the middle yet"

From: "Matthew D.Fuller" <fullermd@over-yonder.net>
To: FreeBSD-gnats-submit@FreeBSD.org
Cc:  
Subject: Re: bin/76858: [PATCH] Bug in pkg_{install,delete} package name lookup
Date: Sat, 2 Jul 2005 05:51:58 -0500

 [ KEEPALIVE ]
 
 > > >Synopsis:       [PATCH] Bug in pkg_{install,delete} package name lookup
 
 As long as we're skipping down the path of another release, could
 somebody take a peek at this and see if we can sneak it in?
 
 
 -- 
 Matthew Fuller     (MF4839)   |  fullermd@over-yonder.net
 Systems/Network Administrator |  http://www.over-yonder.net/~fullermd/
            On the Internet, nobody can hear you scream.
State-Changed-From-To: open->closed 
State-Changed-By: krion 
State-Changed-When: Mon Oct 10 08:41:15 GMT 2005 
State-Changed-Why:  
The fix is committed, thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=76858 
>Unformatted:
