From owner-freebsd-bugs Fri Oct 16 16:00:37 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id QAA07301 for freebsd-bugs-outgoing; Fri, 16 Oct 1998 16:00:37 -0700 (PDT) (envelope-from owner-freebsd-bugs@FreeBSD.ORG) Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id QAA07165 for ; Fri, 16 Oct 1998 16:00:09 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.8.8/8.8.5) id QAA20784; Fri, 16 Oct 1998 16:00:01 -0700 (PDT) Received: (from nobody@localhost) by hub.freebsd.org (8.8.8/8.8.8) id PAA06547; Fri, 16 Oct 1998 15:56:29 -0700 (PDT) (envelope-from nobody) Message-Id: <199810162256.PAA06547@hub.freebsd.org> Date: Fri, 16 Oct 1998 15:56:29 -0700 (PDT) From: wefa@callcenter.systemhaus.net To: freebsd-gnats-submit@FreeBSD.ORG X-Send-Pr-Version: www-1.0 Subject: bin/8348: zforce(1) is broken: fix Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >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