From nobody@FreeBSD.org  Sun May 20 20:00:00 2001
Return-Path: <nobody@FreeBSD.org>
Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21])
	by hub.freebsd.org (Postfix) with ESMTP id 2928D37B42C
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 20 May 2001 20:00:00 -0700 (PDT)
	(envelope-from nobody@FreeBSD.org)
Received: (from nobody@localhost)
	by freefall.freebsd.org (8.11.1/8.11.1) id f4L300k18182;
	Sun, 20 May 2001 20:00:00 -0700 (PDT)
	(envelope-from nobody)
Message-Id: <200105210300.f4L300k18182@freefall.freebsd.org>
Date: Sun, 20 May 2001 20:00:00 -0700 (PDT)
From: tom@wact.net
To: freebsd-gnats-submit@FreeBSD.org
Subject: pkg_add -r segfaults when PACKAGEROOT set
X-Send-Pr-Version: www-1.0

>Number:         27485
>Category:       bin
>Synopsis:       pkg_add -r segfaults when PACKAGEROOT set
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun May 20 20:00:02 PDT 2001
>Closed-Date:    Mon May 21 02:58:59 PDT 2001
>Last-Modified:  Mon May 21 02:59:39 PDT 2001
>Originator:     Tom Uffner
>Release:        current
>Organization:
>Environment:
FreeBSD discordia.uffner.com 5.0-CURRENT FreeBSD 5.0-CURRENT #2: Wed May  2 09:00:12 EDT 2001     tom@discordia.uffner.com:/usr/obj/usr/src/sys/DISCORDIA  i386
>Description:
see summary
>How-To-Repeat:
setenv PACKAGEROOT ftp://ftp3.FreeBSD.org/pub
pkg_add -r tkcvs

the values of PACKAGEROOT and the package fetched do not matter
it will happen regardless.
>Fix:
Index: main.c
===================================================================
RCS file: /home/ncvs/src/usr.sbin/pkg_install/add/main.c,v
retrieving revision 1.35
diff -c -w -r1.35 main.c
*** main.c      2001/04/26 06:48:59     1.35
--- main.c      2001/05/21 02:19:26
***************
*** 197,203 ****
        strcpy(sitepath, "ftp://ftp.FreeBSD.org");
  
      if (getenv("PACKAGEROOT"))
!       strcpy(sitepath, getenv("PACKAGEMIRRORROOT"));
      else
        strcat(sitepath, "/pub");
  
--- 197,203 ----
        strcpy(sitepath, "ftp://ftp.FreeBSD.org");
  
      if (getenv("PACKAGEROOT"))
!       strcpy(sitepath, getenv("PACKAGEROOT"));
      else
        strcat(sitepath, "/pub");

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: ru 
State-Changed-When: Mon May 21 02:58:59 PDT 2001 
State-Changed-Why:  
Already fixed, as specified in PR#27486. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=27485 
>Unformatted:
