Changeset View
Changeset View
Standalone View
Standalone View
lib/libc/sys/chown.2
Show All 22 Lines | |||||
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||||
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||||
.\" SUCH DAMAGE. | .\" SUCH DAMAGE. | ||||
.\" | .\" | ||||
.\" @(#)chown.2 8.4 (Berkeley) 4/19/94 | .\" @(#)chown.2 8.4 (Berkeley) 4/19/94 | ||||
.\" $FreeBSD$ | .\" $FreeBSD$ | ||||
.\" | .\" | ||||
.Dd December 1, 2017 | .Dd Octover 20, 2018 | ||||
.Dt CHOWN 2 | .Dt CHOWN 2 | ||||
.Os | .Os | ||||
.Sh NAME | .Sh NAME | ||||
.Nm chown , | .Nm chown , | ||||
.Nm fchown , | .Nm fchown , | ||||
.Nm lchown , | .Nm lchown , | ||||
.Nm fchownat | .Nm fchownat | ||||
.Nd change owner and group of a file | .Nd change owner and group of a file | ||||
▲ Show 20 Lines • Show All 73 Lines • ▼ Show 20 Lines | |||||
are constructed by a bitwise-inclusive OR of flags from the following | are constructed by a bitwise-inclusive OR of flags from the following | ||||
list, defined in | list, defined in | ||||
.In fcntl.h : | .In fcntl.h : | ||||
.Bl -tag -width indent | .Bl -tag -width indent | ||||
.It Dv AT_SYMLINK_NOFOLLOW | .It Dv AT_SYMLINK_NOFOLLOW | ||||
If | If | ||||
.Fa path | .Fa path | ||||
names a symbolic link, ownership of the symbolic link is changed. | names a symbolic link, ownership of the symbolic link is changed. | ||||
.It Dv AT_BENEATH | |||||
Do not allow to change ownership of a file which is not a child of | |||||
the starting directory. | |||||
.El | .El | ||||
.Pp | .Pp | ||||
If | If | ||||
.Fn fchownat | .Fn fchownat | ||||
is passed the special value | is passed the special value | ||||
.Dv AT_FDCWD | .Dv AT_FDCWD | ||||
in the | in the | ||||
.Fa fd | .Fa fd | ||||
▲ Show 20 Lines • Show All 93 Lines • ▼ Show 20 Lines | |||||
.It Bq Er ENOTDIR | .It Bq Er ENOTDIR | ||||
The | The | ||||
.Fa path | .Fa path | ||||
argument is not an absolute path and | argument is not an absolute path and | ||||
.Fa fd | .Fa fd | ||||
is neither | is neither | ||||
.Dv AT_FDCWD | .Dv AT_FDCWD | ||||
nor a file descriptor associated with a directory. | nor a file descriptor associated with a directory. | ||||
.It Bq Er ENOTCAPABLE | |||||
.Fa path | |||||
was absolute or a ".." component leading to a directory outside of | |||||
the directory hierarchy rooted by the start directory, and the | |||||
.Dv AT_BENEATH | |||||
flag was specified. | |||||
.El | .El | ||||
.Sh SEE ALSO | .Sh SEE ALSO | ||||
.Xr chgrp 1 , | .Xr chgrp 1 , | ||||
.Xr chflags 2 , | .Xr chflags 2 , | ||||
.Xr chmod 2 , | .Xr chmod 2 , | ||||
.Xr flock 2 , | .Xr flock 2 , | ||||
.Xr chown 8 | .Xr chown 8 | ||||
.Sh STANDARDS | .Sh STANDARDS | ||||
Show All 31 Lines |