Audit chown(1)

Similar to the chgrp(1)-audit:
1) Refactor manpage so it's actually fun to read
2) BUGFIX: Call (l)chown properly when the H-flag is specified
   (only when depth > 0)
3) BUGFIX: Call (l)chown properly when the h-flag is specified
   (only when depth = 0).
4) BUGFIX: Only recurse() in chgrp() when the initial chownf()
   succeeds.
5) Style fixes, argv-basing.
6) Rename status to ret for consistency.
7) Add blank line before return.
This commit is contained in:
FRIGN
2015-03-09 00:37:34 +01:00
parent 8f436abde6
commit 3a04302c66
3 changed files with 52 additions and 43 deletions

33
chown.1
View File

@@ -1,4 +1,4 @@
.Dd February 17, 2015
.Dd March 9, 2015
.Dt CHOWN 1
.Os sbase
.Sh NAME
@@ -15,26 +15,35 @@
.Op Ar file ...
.Sh DESCRIPTION
.Nm
changes the user or group ownership for the given
.Ar files .
sets the user or group id of each
.Ar file
to the uid of
.Ar owner
or the gid of
.Ar group
respectively.
.Sh OPTIONS
.Bl -tag -width Ds
.It Fl h
Change the user ID and/or group ID of the symlink itself. This flag cannot be used
with
.Op Fl R .
Preserve
.Ar file
if it is a symbolic link.
.It Fl R
Change directory ownership recursively.
Change file ownerships recursively.
.It Fl H
Only dereference symbolic links that are passed as command line arguments when
recursively traversing directories.
Dereference
.Ar file
if it is a symbolic link.
.It Fl L
Always dereference symbolic links while recursively traversing directories.
Dereference all symbolic links.
.It Fl P
Don't dereference symbolic links (default).
Preserve symbolic links. This is the default.
.El
.Sh SEE ALSO
.Xr chown 2
.Xr chmod 1 ,
.Xr chown 2 ,
.Xr getgrnam 3 ,
.Xr getpwnam 3
.Sh STANDARDS
The
.Nm