From owner-freebsd-bugs Fri Feb 25 2:40: 5 2000 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id 04B6737BE14 for ; Fri, 25 Feb 2000 02:40:02 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id CAA21479; Fri, 25 Feb 2000 02:40:01 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id 6267037C363 for ; Fri, 25 Feb 2000 02:35:07 -0800 (PST) (envelope-from nobody@FreeBSD.org) Received: (from nobody@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id CAA18173; Fri, 25 Feb 2000 02:35:07 -0800 (PST) (envelope-from nobody@FreeBSD.org) Message-Id: <200002251035.CAA18173@freefall.freebsd.org> Date: Fri, 25 Feb 2000 02:35:07 -0800 (PST) From: peter.edwards@ireland.com To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-1.0 Subject: bin/16981: Minor nit with (un)compress and "Operation not supported" Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 16981 >Category: bin >Synopsis: Minor nit with (un)compress and "Operation not supported" >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 Feb 25 02:40:00 PST 2000 >Closed-Date: >Last-Modified: >Originator: Peter Edwards >Release: -current >Organization: >Environment: FreeBSD rocklobster 4.0-CURRENT FreeBSD 4.0-CURRENT #3: Fri Jan 21 09:42:06 GMT 2000 petere@rocklobster:/usr/src/sys/compile/PME2 i386 >Description: compress uses setfile() to make flags, ownership and mode of the output the same as those of the original. However, if the filesystem holding the output file doesn't support these operations, compress prints a warning. This bites a bit with NFS directories, which always fail the chflags() operation. If the file system doesn't support the operation, then the flags data wasn't valid on the original file anyway, so the warning is spurious. >How-To-Repeat: $ cd /net/remote/directory $ compress somefile compress: chflags: somefile.Z: Operation not supported $ >Fix: chmod() is also documented as returning EOPNOTSUPP, so I guess the same goes for it as well as chflags(). Patch follows... *** compress.c.old Fri Feb 25 10:17:53 2000 --- compress.c Fri Feb 25 10:24:20 2000 *************** *** 372,381 **** cwarn("chown: %s", name); fs->st_mode &= ~(S_ISUID|S_ISGID); } ! if (chmod(name, fs->st_mode)) cwarn("chown: %s", name); ! if (chflags(name, fs->st_flags)) cwarn("chflags: %s", name); } --- 372,381 ---- cwarn("chown: %s", name); fs->st_mode &= ~(S_ISUID|S_ISGID); } ! if (chmod(name, fs->st_mode) && errno != EOPNOTSUPP) cwarn("chown: %s", name); ! if (chflags(name, fs->st_flags) && errno != EOPNOTSUPP) cwarn("chflags: %s", name); >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message