From owner-freebsd-bugs@FreeBSD.ORG Sun May 23 08:50:01 2010 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DACD81065674 for ; Sun, 23 May 2010 08:50:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (unknown [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id B80098FC0C for ; Sun, 23 May 2010 08:50:01 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o4N8o1Pc029573 for ; Sun, 23 May 2010 08:50:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id o4N8o1Ns029572; Sun, 23 May 2010 08:50:01 GMT (envelope-from gnats) Resent-Date: Sun, 23 May 2010 08:50:01 GMT Resent-Message-Id: <201005230850.o4N8o1Ns029572@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Garrett Cooper Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CC8081065674 for ; Sun, 23 May 2010 08:44:43 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id A22AB8FC08 for ; Sun, 23 May 2010 08:44:43 +0000 (UTC) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.3/8.14.3) with ESMTP id o4N8ihRZ049829 for ; Sun, 23 May 2010 08:44:43 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.3/8.14.3/Submit) id o4N8ihbc049828; Sun, 23 May 2010 08:44:43 GMT (envelope-from nobody) Message-Id: <201005230844.o4N8ihbc049828@www.freebsd.org> Date: Sun, 23 May 2010 08:44:43 GMT From: Garrett Cooper To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: bin/146857: [patch] [pkg_install] fix missing error call in uname check added to pkg_version in r206043 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 May 2010 08:50:02 -0000 >Number: 146857 >Category: bin >Synopsis: [patch] [pkg_install] fix missing error call in uname check added to pkg_version in r206043 >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun May 23 08:50:01 UTC 2010 >Closed-Date: >Last-Modified: >Originator: Garrett Cooper >Release: 9-CURRENT >Organization: Cisco Systems, Inc. >Environment: FreeBSD bayonetta.local 9.0-CURRENT FreeBSD 9.0-CURRENT #0 r206173M: Mon Apr 26 22:45:06 PDT 2010 root@bayonetta.local:/usr/obj/usr/src/sys/BAYONETTA.ata amd64 >Description: One of the error checks wasn't properly integrated into r206043 as part of bin/145101 (it was in the 2nd patch, not the first one). This patch also reorders the headers so that it makes the actual dependencies for libpkg more apparent and fixes indentation according to jkh's `coding style' in one spot. >How-To-Repeat: These are error conditions that won't occur 99.9% of the time (unless uname(2) fails), but will occur given proper circumstances. >Fix: See attached patch. Patch attached with submission follows: Index: perform.c =================================================================== --- perform.c (revision 208438) +++ perform.c (working copy) @@ -21,12 +21,15 @@ #include __FBSDID("$FreeBSD$"); -#include -#include "version.h" +#include +#include #include #include #include +#include +#include "version.h" + FILE *IndexFile; char IndexPath[PATH_MAX] = ""; struct index_head Index = SLIST_HEAD_INITIALIZER(Index); @@ -56,10 +59,11 @@ struct utsname u; if (uname(&u) == -1) { - warn("%s(): failed to determine uname information", __func__); + warn("%s: failed to determine uname information", __func__); return 1; } else if ((rel_major_ver = (int) strtol(u.release, NULL, 10)) <= 0) { - + warnx("%s: bad release version specified: %s", __func__, u.release); + return 1; } /* @@ -82,10 +86,10 @@ pat[1] = NULL; MatchType = RegexExtended ? MATCH_EREGEX : MATCH_REGEX; patterns = pat; - } else { + } else { MatchType = MATCH_ALL; patterns = NULL; - } + } if (LookUpOrigin != NULL) pkgs = matchbyorigin(LookUpOrigin, &err_cnt); >Release-Note: >Audit-Trail: >Unformatted: