Subject: lib/3476: [dM] chmod(2) missing EFTYPE
To: None <gnats-bugs@gnats.netbsd.org>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: netbsd-bugs
Date: 04/11/1997 08:43:23
>Number:         3476
>Category:       lib
>Synopsis:       [dM] chmod(2) missing EFTYPE
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    lib-bug-people (Library Bug People)
>State:          open
>Class:          doc-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Apr 11 05:50:01 1997
>Last-Modified:
>Originator:     der Mouse
>Organization:
	Dis-
>Release:        1.2_BETA
>Environment:
	Any (noticed on NetBSD/sparc on SS2)
>Description:
	chmod(2) can return EFTYPE; the manpage does not include EFTYPE
	in the list of possible errors.
>How-To-Repeat:
	As a non-root user (assuming /tmp is on an ffs filesystem),

	% touch /tmp/foo
	% chmod 1644 /tmp/foo

	Then read the manpage for chmod and notice the absence of any
	such error condition documented.
>Fix:
	Here's a patch to the manpage.  I'm not convinced this is
	entirely right, though, because the error comes from
	ufs/ufs/ufs_vnops.c and therefore is filesystem-dependent,
	whereas this description makes it sound filesystem-independent.
	(It also would be nice to collapse the identical or
	nearly-identical errno descriptions for chmod and fchmod; I
	haven't done that here, but if/when I get around to applying
	this myself I will.)

*** chmod.2.current	Fri Apr 11 08:23:45 1997
--- chmod.2	Fri Apr 11 08:35:53 1997
***************
*** 153,158 ****
--- 153,166 ----
  points outside the process's allocated address space.
  .It Bq Er EIO
  An I/O error occurred while reading from or writing to the file system.
+ .It Bq Er EFTYPE
+ The effective user ID is not the super-user, the
+ .Fa mode
+ includes the sticky bit
+ .Pq Dv S_ISVTX ,
+ and
+ .Fa path
+ does not refer to a directory.
  .El
  .Pp
  .Fn Fchmod
***************
*** 167,172 ****
--- 175,188 ----
  The file resides on a read-only file system.
  .It Bq Er EIO
  An I/O error occurred while reading from or writing to the file system.
+ .It Bq Er EFTYPE
+ The effective user ID is not the super-user, the
+ .Fa mode
+ includes the sticky bit
+ .Pq Dv S_ISVTX ,
+ and
+ .Fa fd
+ does not refer to a directory.
  .El
  .Sh SEE ALSO
  .Xr chmod 1 ,

					der Mouse

			       mouse@rodents.montreal.qc.ca
		     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B
>Audit-Trail:
>Unformatted: