From nobody@FreeBSD.org  Tue Oct 17 20:12:13 2006
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 4868516A415
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 17 Oct 2006 20:12:13 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 110E043D45
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 17 Oct 2006 20:12:13 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id k9HKCCth026431
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 17 Oct 2006 20:12:12 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id k9HKCCVJ026430;
	Tue, 17 Oct 2006 20:12:12 GMT
	(envelope-from nobody)
Message-Id: <200610172012.k9HKCCVJ026430@www.freebsd.org>
Date: Tue, 17 Oct 2006 20:12:12 GMT
From: Toomas Aas<toomas.aas@raad.tartu.ee>
To: freebsd-gnats-submit@FreeBSD.org
Subject: portsnap update may freak out with certain non-standard values of LANG
X-Send-Pr-Version: www-3.0

>Number:         104505
>Category:       bin
>Synopsis:       portsnap update may freak out with certain non-standard values of LANG
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    cperciva
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Oct 17 20:20:18 GMT 2006
>Closed-Date:    Tue Oct 24 09:52:12 GMT 2006
>Last-Modified:  Tue Oct 24 09:52:12 GMT 2006
>Originator:     Toomas Aas
>Release:        6.2-PRERELEASE
>Organization:
Tartu City Government
>Environment:
FreeBSD my.machine.name 6.2-PRERELEASE FreeBSD 6.2-PRERELEASE #0: Wed Oct 11 18:36:44 EEST 2006     toomas@my.machine.name:/usr/obj/usr/src/sys/MYKERNEL  i386
>Description:
I generally have LANG set to et_EE.ISO8859-15 in my environment. When I run 'portsnap update', it sometimes aborts with this message:

# portsnap fetch
Looking up portsnap.FreeBSD.org mirrors... 2 mirrors found.
Fetching snapshot tag from portsnap1.FreeBSD.org... done.
Fetching snapshot metadata... done.

Portsnap metadata is correctly signed, but contains
at least one line which appears bogus.
Cowardly refusing to proceed any further.

If I unsetenv LANG and immediately run 'portsnap fetch' again, it succeeds.

I guess the problem has something to do with this check in fetch_metadata_sanity() function of /usr/sbin/portsnap:

if grep -qvE "^[0-9A-Z.]+\|[0-9a-f]{64}$" tINDEX.new; then
	fetch_metadata_freakout
	return 1
fi

Here we see a grep for regex containing range A-Z. The problem is that in Estonian language Z is not at the end of the alphabet but in the middle, so A-Z doesn't cover the entire alphabet.

Maybe something like :alpha: (or even :alnum:) could be used instead?
>How-To-Repeat:
setenv LANG et_EE.ISO8859-15
/usr/sbin/portsnap fetch

(results may vary depending of the actual portsnap metadata at the moment of testing)
>Fix:

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->cperciva 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Tue Oct 17 21:00:41 UTC 2006 
Responsible-Changed-Why:  
Over to maintainer. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=104505 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/104505: commit references a PR
Date: Sat, 21 Oct 2006 11:04:53 +0000 (UTC)

 cperciva    2006-10-21 11:04:34 UTC
 
   FreeBSD src repository
 
   Modified files:
     usr.sbin/freebsd-update freebsd-update.sh 
     usr.sbin/portsnap/portsnap portsnap.sh 
   Log:
   Set LC_ALL=C in order to avoid problems with character ranges and
   sorting.
   
   PR:             bin/104505
   MFC after:      3 days
   
   Revision  Changes    Path
   1.3       +3 -0      src/usr.sbin/freebsd-update/freebsd-update.sh
   1.26      +3 -0      src/usr.sbin/portsnap/portsnap/portsnap.sh
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: open->closed 
State-Changed-By: cperciva 
State-Changed-When: Tue Oct 24 09:51:41 UTC 2006 
State-Changed-Why:  
Fixed in HEAD and RELENG_6, thanks! 


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