From owner-freebsd-bugs@freebsd.org Mon Oct 19 16:07:13 2015 Return-Path: Delivered-To: freebsd-bugs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 13A54A19F43 for ; Mon, 19 Oct 2015 16:07:13 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DC301AE9 for ; Mon, 19 Oct 2015 16:07:12 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id t9JG7COa019844 for ; Mon, 19 Oct 2015 16:07:12 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-bugs@FreeBSD.org Subject: [Bug 203873] [patch] make gzip(1) embedded-friendly and more compatible with GNU gzip Date: Mon, 19 Oct 2015 16:07:12 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: 10.2-STABLE X-Bugzilla-Keywords: patch X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: eugen@grosbein.net X-Bugzilla-Status: New X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-bugs@FreeBSD.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status keywords bug_severity priority component assigned_to reporter attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2015 16:07:13 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=203873 Bug ID: 203873 Summary: [patch] make gzip(1) embedded-friendly and more compatible with GNU gzip Product: Base System Version: 10.2-STABLE Hardware: Any OS: Any Status: New Keywords: patch Severity: Affects Some People Priority: --- Component: bin Assignee: freebsd-bugs@FreeBSD.org Reporter: eugen@grosbein.net Keywords: patch Created attachment 162210 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=162210&action=edit patch for gzip While running FreeBSD using space-constrained embedded platform like MIPS32 router, one may not have enough flash space for full-blown file system to keep variable configuration files persistent between reboots. For example, there may be only 64K or so flash space seen as /dev/map/cfg. This is not enough for newfs(1) but enough to write gzip-compressed tar archive that can store hundreds kilobytes of text configs like SSH host keys etc. We need a way to check integrity of those raw 64Kbytes of data and "gzip -qt" would do the job. However, "gzip -qt < /dev/map/cfg" does not work due to hardware limitations and we need to use "dd bs=64k if=/dev/map/cfg | gzip -qt". That feeds gzip with our compressed data and some trailing garbage. Our gzip ignores trailing garbage but returns exit status 1 (fatal error) even if CRC matches. GNU gzip returns exit status 2 (just warning) in such case. Attached patch makes our gzip return 2 in case of ignored trailing garbage. -- You are receiving this mail because: You are the assignee for the bug.