chown.2: ffix

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2017-08-13 23:00:20 +02:00
parent 778ac6277e
commit 009a7c83cc
1 changed files with 19 additions and 21 deletions

View File

@ -41,25 +41,23 @@ chown, fchown, lchown, fchownat \- change ownership of a file
.SH SYNOPSIS
.nf
.B #include <unistd.h>
.sp
.PP
.BI "int chown(const char *" pathname ", uid_t " owner ", gid_t " group );
.br
.BI "int fchown(int " fd ", uid_t " owner ", gid_t " group );
.br
.BI "int lchown(const char *" pathname ", uid_t " owner ", gid_t " group );
.sp
.BR "#include <fcntl.h> " "/* Definition of AT_* constants */"
.B #include <unistd.h>
.sp
.PP
.BI "int fchownat(int " dirfd ", const char *" pathname ,
.BI " uid_t " owner ", gid_t " group ", int " flags );
.fi
.sp
.PP
.in -4n
Feature Test Macro Requirements for glibc (see
.BR feature_test_macros (7)):
.in
.sp
.PP
.BR fchown (),
.BR lchown ():
.PD 0
@ -70,7 +68,7 @@ Feature Test Macro Requirements for glibc (see
.\" || _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED
|| /* Glibc versions <= 2.19: */ _BSD_SOURCE
.RE
.sp
.PP
.BR fchownat ():
.PD 0
.ad l
@ -115,13 +113,13 @@ to any group of which that owner is a member.
A privileged process (Linux: with
.BR CAP_CHOWN )
may change the group arbitrarily.
.PP
If the
.I owner
or
.I group
is specified as \-1, then that ID is not changed.
.PP
When the owner or group of an executable file is
changed by an unprivileged user, the
.B S_ISUID
@ -142,7 +140,7 @@ bit is not set) the
.B S_ISGID
bit indicates mandatory locking, and is not cleared by a
.BR chown ().
.PP
When the owner or group of an executable file is changed (by any user),
all capability sets for the file are cleared.
.\"
@ -152,7 +150,7 @@ The
system call operates in exactly the same way as
.BR chown (),
except for the differences described here.
.PP
If the pathname given in
.I pathname
is relative, then it is interpreted relative to the directory
@ -162,7 +160,7 @@ referred to by the file descriptor
the calling process, as is done by
.BR chown ()
for a relative pathname).
.PP
If
.I pathname
is relative and
@ -174,13 +172,13 @@ then
is interpreted relative to the current working
directory of the calling process (like
.BR chown ()).
.PP
If
.I pathname
is absolute, then
.I dirfd
is ignored.
.PP
The
.I flags
argument is a bit mask created by ORing together
@ -232,7 +230,7 @@ is set appropriately.
.SH ERRORS
Depending on the filesystem,
errors other than those listed below can be returned.
.PP
The more general errors for
.BR chown ()
are listed below.
@ -324,7 +322,7 @@ library support was added to glibc in version 2.4.
.BR fchown (),
.BR lchown ():
4.4BSD, SVr4, POSIX.1-2001, POSIX.1-2008.
.PP
The 4.4BSD version can be
used only by the superuser (that is, ordinary users cannot give away files).
.\" chown():
@ -333,7 +331,7 @@ used only by the superuser (that is, ordinary users cannot give away files).
.\" fchown():
.\" SVr4 documents additional EINVAL, EIO, EINTR, and ENOLINK
.\" error conditions.
.PP
.BR fchownat ():
POSIX.1-2008.
.SH NOTES
@ -433,7 +431,7 @@ The glibc
and
.BR lchown ()
wrapper functions transparently deal with the variations across kernel versions.
.PP
In versions of Linux prior to 2.1.81 (and distinct from 2.1.46),
.BR chown ()
did not follow symbolic links.
@ -458,7 +456,7 @@ or as a username (which is converted to a user ID by using
.BR getpwnam (3)
to perform a lookup in the system password file).
.SS Program source
.nf
.EX
#include <pwd.h>
#include <stdio.h>
#include <stdlib.h>
@ -495,7 +493,7 @@ main(int argc, char *argv[])
exit(EXIT_SUCCESS);
}
.fi
.EE
.SH SEE ALSO
.BR chgrp (1),
.BR chown (1),