Date: Fri, 25 Feb 2000 02:35:07 -0800 (PST) From: peter.edwards@ireland.com To: freebsd-gnats-submit@FreeBSD.org Subject: bin/16981: Minor nit with (un)compress and "Operation not supported" Message-ID: <200002251035.CAA18173@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200002251035.CAA18173>