docs/84265: chmod(1) manpage omits implication of setting w on directory

Gary W. Swearingen garys at opusnet.com
Sun Jul 31 17:50:16 UTC 2005


The following reply was made to PR docs/84265; it has been noted by GNATS.

From: garys at opusnet.com (Gary W. Swearingen)
To: Ceri Davies <ceri at submonkey.net>
Cc: FreeBSD-gnats-submit at FreeBSD.org
Subject: Re: docs/84265: chmod(1) manpage omits implication of setting w on
 directory
Date: Sun, 31 Jul 2005 10:49:15 -0700

 Ceri Davies <ceri at submonkey.net> writes:
 
 > On 29 Jul 2005, at 02:57, Gary W. Swearingen wrote:
 
 > > I'd also add the following paragraph to the chmod(1) and chgrp(1)
 > > manpages, but I'll wait for approval before making patches.
 > >
 > >    The group of a directory will be assigned to files newly created
 > >    (eg, by > or an editor, but not by mv or cp) within it, despite the
 > >    owner or group of the creator.
 
 > A reference to touch(1) rather than '>' reads better here, I think.
 
 
 How about this new para for chown(1) and chgrp(1)?
 
       Files created in a directory will be generally be assigned the
       group ID of the directory, with exceptions including files added
       by cp(1) with -p and mv(1).
 
 Want patches for that?  In new PR(s) or this one?
 
 
 > Also, the reference to "owner" should be "user id", as the creator of  the file probably doesn't have an owner ;)
 
 "Owner" is a concept, while "User ID" is an implementation detail,
 but it's no big deal; I've changed that (and more):
 
       Setting the write permission on a directory will enable files to be added
       to it.  Files created in the directory will be generally be assigned the
       group ID of the directory, with exceptions including files added by cp(1)
       with -p and mv(1).
 
 Note that I haven't added cp(1) and mv(1) to the "SEE ALSO" because
 their man pages don't sufficiently help explain chmod(1).
 
 I hope I handled that last period OK; it looks OK on my xterm.
 
 --- chmod..orig.1	Wed Jul 27 18:05:44 2005
 +++ chmod.1	Sun Jul 31 10:35:18 2005
 @@ -276,6 +276,16 @@
  ``o'' by itself), in combination with the
  .Ar perm
  symbols ``s'' or ``t'', are ignored.
 +.Pp
 +Setting the write permission on a directory will enable files to be
 +added to it.  Files created in the directory will be generally be
 +assigned the group ID of the directory, with exceptions including
 +files added by 
 +.Xr cp 1
 +with
 +.Fl p
 +and
 +.Xr mv 1 .
  .Sh EXAMPLES
  .Bl -tag -width "u=rwx,go=u-w" -compact
  .It Li 644



More information about the freebsd-doc mailing list