NetBSD Problem Report #59777

From www@netbsd.org  Thu Nov 20 00:57:49 2025
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256
	 client-signature RSA-PSS (2048 bits) client-digest SHA256)
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id C75DE1A9239
	for <gnats-bugs@gnats.NetBSD.org>; Thu, 20 Nov 2025 00:57:48 +0000 (UTC)
Message-Id: <20251120005747.B19531A923A@mollari.NetBSD.org>
Date: Thu, 20 Nov 2025 00:57:47 +0000 (UTC)
From: cspiegel@gmail.com
Reply-To: cspiegel@gmail.com
To: gnats-bugs@NetBSD.org
Subject: Incorrect warning message in Unix compress
X-Send-Pr-Version: www-1.0

>Number:         59777
>Category:       bin
>Synopsis:       Incorrect warning message in Unix compress
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Nov 20 01:00:00 +0000 2025
>Originator:     Chris Spiegel
>Release:        10.1
>Organization:
>Environment:
N/A (found while reading code)
>Description:
There are a few absolutely minor issues I found in the "compress" program.

This is all in src/usr.bin/compress/compress.c.

1. When the program is called as "zcat" it sets itself to "cat" mode (lines 87-89). But then on line 93, the cat variable is unconditionally reset to 0, meaning the "zcat" program behaves exactly as "uncompress". This is irrelevant unless somebody links "compress" to "zcat" themselves since the "zcat" symlink was removed in 1993, but perhaps either the "zcat" check should be removed, or the variables should be initialized earlier, to avoid confusion for the many people interested in the source to Unix compress.

2. The following occurs on lines 409-410:

    if (chmod(name, fs->st_mode))
            cwarn("chown: %s", name);

    The warning message should say "chmod" instead of "chown". I'm not sure if it's even possible to see this since odds are if you created the file you'll have the rights to chmod it, but you never know...

3. Line 269 is not indented properly (should be indented two more tabs).
>How-To-Repeat:
N/A
>Fix:
N/A (described above)

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2025 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.