From nobody@FreeBSD.org  Mon Feb  4 11:29:28 2008
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 853DC16A479
	for <freebsd-gnats-submit@FreeBSD.org>; Mon,  4 Feb 2008 11:29:28 +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 717ED13C474
	for <freebsd-gnats-submit@FreeBSD.org>; Mon,  4 Feb 2008 11:29:28 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.2/8.14.2) with ESMTP id m14BRTTW059734
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 4 Feb 2008 11:27:29 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.2/8.14.1/Submit) id m14BRT3j059732;
	Mon, 4 Feb 2008 11:27:29 GMT
	(envelope-from nobody)
Message-Id: <200802041127.m14BRT3j059732@www.freebsd.org>
Date: Mon, 4 Feb 2008 11:27:29 GMT
From: Jaakko Heinonen <jh@saunalahti.fi>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [gzip] [patch] znew(1) is broken
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         120249
>Category:       bin
>Synopsis:       [patch] znew(1) is broken
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    yar
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Feb 04 11:30:01 UTC 2008
>Closed-Date:    Mon Aug 18 12:07:20 UTC 2008
>Last-Modified:  Mon Aug 18 12:07:20 UTC 2008
>Originator:     Jaakko Heinonen
>Release:        7.0-RC1
>Organization:
>Environment:
>Description:
1) /usr/bin/znew script points to an interpreter (/bin/ksh) which doesn't
exist in FreeBSD base.

2) The script uses a non-existent gzip command line option (-o).

3) After applying the patch provided below znew(1) -v switch still generates
a different output compared to GNU znew.
>How-To-Repeat:
$ znew
znew: not found
$ head -1 /usr/bin/znew
#!/bin/ksh -

>Fix:


Patch attached with submission follows:

Index: znew
===================================================================
RCS file: /home/ncvs/src/usr.bin/gzip/znew,v
retrieving revision 1.1
diff -u -r1.1 znew
--- znew	26 Jan 2007 10:19:07 -0000	1.1
+++ znew	3 Feb 2008 19:54:24 -0000
@@ -1,4 +1,4 @@
-#!/bin/ksh -
+#!/bin/sh -
 #
 # $NetBSD: znew,v 1.2 2003/12/28 12:43:43 wiz Exp $
 # $OpenBSD: znew,v 1.2 2003/08/05 18:22:17 deraadt Exp $
@@ -60,7 +60,7 @@
 	trap 'rm -f "$tmp"; exit 1' HUP INT QUIT PIPE TERM
 
 	# Do the actual work, producing a file "$tmp"
-	if uncompress -f -c < "$filez" | gzip -f $gzipflags -o "$tmp"; then
+	if uncompress -f -c < "$filez" | gzip -cf $gzipflags > "$tmp"; then
 
 		if test $kflag -eq 1 && smaller "$filez" "$tmp"; then
 			echo -n "$prog: $filez is smaller than $filegz"
@@ -120,7 +120,7 @@
 	esac
 done
 
-shift OPTIND-1
+shift $(($OPTIND-1))
 
 if test $# -eq 0; then
 	echo "$usage"


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->patched 
State-Changed-By: yar 
State-Changed-When: Sat Feb 9 13:04:48 UTC 2008 
State-Changed-Why:  
Fixed in CURRENT, thanks! 


Responsible-Changed-From-To: freebsd-bugs->yar 
Responsible-Changed-By: yar 
Responsible-Changed-When: Sat Feb 9 13:04:48 UTC 2008 
Responsible-Changed-Why:  
MFC reminder. 

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

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/120249: commit references a PR
Date: Sat,  9 Feb 2008 13:04:06 +0000 (UTC)

 yar         2008-02-09 13:04:01 UTC
 
   FreeBSD src repository
 
   Modified files:
     usr.bin/gzip         znew 
   Log:
   Fix a few obvious errors in the znew(1) script.
   
   PR:             bin/120249
   Submitted by:   Jaakko Heinonen <see the PR for email>
   
   Revision  Changes    Path
   1.2       +3 -4      src/usr.bin/gzip/znew
 _______________________________________________
 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: patched->closed 
State-Changed-By: yar 
State-Changed-When: Mon Aug 18 12:04:49 UTC 2008 
State-Changed-Why:  
The fix has been merged to 6 & 7-stable by delphij@ (thanks!) 

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