From nobody@FreeBSD.org  Fri Feb 25 02:35:07 2000
Return-Path: <nobody@FreeBSD.org>
Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21])
	by hub.freebsd.org (Postfix) with ESMTP id 6267037C363
	for <freebsd-gnats-submit@FreeBSD.org>; 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
Sender: nobody@FreeBSD.org
To: freebsd-gnats-submit@FreeBSD.org
Subject: Minor nit with (un)compress and "Operation not supported"
X-Send-Pr-Version: www-1.0

>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:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Feb 25 02:40:00 PST 2000
>Closed-Date:    Mon May 15 22:04:16 PDT 2000
>Last-Modified:  Mon May 15 22:06:00 PDT 2000
>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:
State-Changed-From-To: open->closed 
State-Changed-By: hoek 
State-Changed-When: Mon May 15 22:04:16 PDT 2000 
State-Changed-Why:  
Suggested patch applied, thanks. 
>Unformatted:
