Date: Sun, 30 Jan 2005 08:55:09 -0600 (CST) From: "Matthew D.Fuller" <fullermd@over-yonder.net> To: FreeBSD-gnats-submit@FreeBSD.org Subject: bin/76858: [PATCH] Bug in pkg_{install,delete} package name lookup Message-ID: <20050130145509.0FFB4210CD@mortis.over-yonder.net> Resent-Message-ID: <200501301500.j0UF0h1x083832@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 76858 >Category: bin >Synopsis: [PATCH] Bug in pkg_{install,delete} package name lookup >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun Jan 30 15:00:42 GMT 2005 >Closed-Date: >Last-Modified: >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: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050130145509.0FFB4210CD>