Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 16 Oct 1998 15:56:29 -0700 (PDT)
From:      wefa@callcenter.systemhaus.net
To:        freebsd-gnats-submit@FreeBSD.ORG
Subject:   bin/8348: zforce(1) is broken: fix
Message-ID:  <199810162256.PAA06547@hub.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         8348
>Category:       bin
>Synopsis:       zforce(1) is broken: fix
>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:   Fri Oct 16 16:00:00 PDT 1998
>Last-Modified:
>Originator:     Christoph Weber-Fahr
>Organization:
O.tel.o Caommunications
>Release:        2.2.7-RELEASE
>Environment:
FreeBSD paris.otelo-call.de 2.2.7-RELEASE FreeBSD 2.2.7-RELEASE #0: Tue Oct 13 02:08:22 CEST 1998     wefa@newproxy.otelo-call.de:/usr/src/sys/compile/WEB  i386
>Description:
1) zforce does nothing. (it fails to identify gzip files and 
   therefore doesn't 'force' anything)
2) if you fix 1) it behaves nonsensical - it tries to truncate
   filenames to 14 chars, even though there is no such limit
   in the FreeBSD filesystem
3) the code doing 2) is broken as well - it actually only 
   squeezes '.gz' into the last 3 chars of files of any 
   length > 12, but doesn't shorten them. Oh, and this 
   doesn't work in MSDOS file systems either, because it 
   _loves_ to produce files ending in ..gz, which are illegal
   in 8.3 filesystems.
>How-To-Repeat:
use it
>Fix:
I suggest the appended fix:

paris# [bin] diff zforce.org zforce
6c6,13
< # 12345678901234 is renamed to 12345678901.gz
---
> #
> # Fixed gzip call (added -v option)
> # Removed trunking code. Code
> #  - is unnecessary on FreeBSD
> #  - was used in FreeBSD despite of that
> #  - was buggy anyway (it didn't work as advertized)
> #  19981010   CWF
>
27c34,36
<   if gzip -l < "$i" 2>/dev/null | grep '^defl' > /dev/null; then
---
>   if gzip -vl < "$i" 2>/dev/null | grep '^defl' > /dev/null; then
>
>     new="$i.gz"
29,33d37
<     if test `expr "$i" : '^............'` -eq 12; then
<       new=`expr "$i" : '\(.*\)...$`.gz
<     else
<       new="$i.gz"
<     fi
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199810162256.PAA06547>