o Document mac_prepare() and associated functions

o Link mac_get_pid.3 to mac_get.3
o Update SEE ALSO to refer to mac_prepare, and added missing references
o Remove clause #3 on my work
o Update mac_get.3 for the updated MAC API

Sponsored by:	DARPA, Network Associates Laboratories
Obtained from:	TrustedBSD Project
This commit is contained in:
Chris Costello 2003-01-15 00:45:31 +00:00
parent c66af8d5e0
commit 76a829fd1d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=109263
8 changed files with 61 additions and 33 deletions

View file

@ -54,6 +54,7 @@ MAN+= acl.3 \
mac_free.3 \
mac_is_present_np.3 \
mac_get.3 \
mac_prepare.3 \
mac_set.3 \
mac_text.3 \
posix1e.3
@ -73,7 +74,12 @@ MLINKS+=acl_delete.3 acl_delete_def_file.3 \
extattr.3 extattr_string_to_namespace.3 \
mac_get.3 mac_get_fd.3 \
mac_get.3 mac_get_file.3 \
mac_get.3 mac_get_pid.3 \
mac_get.3 mac_get_proc.3 \
mac_prepare.3 mac_prepare_file_label.3 \
mac_prepare.3 mac_prepare_ifnet_label.3 \
mac_prepare.3 mac_prepare_process_label.3 \
mac_set.3 mac_set_link.3 \
mac_set.3 mac_set_fd.3 \
mac_set.3 mac_set_file.3 \
mac_set.3 mac_set_proc.3 \

View file

@ -125,8 +125,10 @@ support for POSIX.1e interfaces and features
is
.Ud .
.Sh SEE ALSO
.Xr mac 3 ,
.Xr mac_free 3 ,
.Xr mac_get 3 ,
.Xr mac_prepare 3 ,
.Xr mac_set 3 ,
.Xr mac_text 3 ,
.Xr mac 9

View file

@ -61,8 +61,10 @@ function.
.Sh SEE ALSO
.Xr mac 3 ,
.Xr mac_get 3 ,
.Xr mac_prepare 3 ,
.Xr mac_set 3 ,
.Xr mac_text 3
.Xr mac_text 3 ,
.Xr mac 9
.Sh STANDARDS
POSIX.1e is described in IEEE POSIX.1e draft 17.
Discussion of the draft

View file

@ -15,9 +15,6 @@
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\" 3. The name of the author may not be used to endorse or promote
.\" products derived from this software without specific prior written
.\" permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
@ -45,21 +42,25 @@
.Lb libc
.Sh SYNOPSIS
.In sys/mac.h
.Ft mac_t
.Fn mac_get_file "const char *path_p"
.Ft mac_t
.Fn mac_get_fd "int fd"
.Ft mac_t
.Fn mac_get_proc
.Ft int
.Fn mac_get_file "const char *path" "mac_t label"
.Ft int
.Fn mac_get_fd "int fd" "mac_t label"
.Ft int
.Fn mac_get_pid "pid_t pid" "mac_t label"
.Ft int
.Fn mac_get_proc "mac_t label"
.Sh DESCRIPTION
The
.Fn mac_get_file
and
.Fn mac_get_fd
functions return the MAC label associated
with the file referenced by
the pathname pointed to by
.Fa path_p
functions fill in
.Fa label
(which must first be allocated by
.Xr mac_prepare 3 )
with the MAC label associated with the file referenced by
.Fa path
or the file descriptor specified by
.Fa fd ,
respectively.
@ -67,42 +68,52 @@ Note that this function will fail on socket descriptors.
For information on
getting MAC labels on socket descriptors see
.Xr getsockopt 2 .
.Pp
The
.Fn mac_get_proc
function returns a MAC label associated
with the requesting process.
and
.Fn mac_get_pid
functions fill in
.Fa label
(which must first be allocated by
.Xr mac_prepare 3 )
with the MAC label associated
with the requesting process
or the specified process, respectively.
.Sh ERRORS
.Bl -tag -width Er
.It Bq Er EACCES
A component of
.Fa path_p
.Fa path
is not searchable,
or MAC read access to the file
is denied.
.It Bq Er ENAMETOOLONG
The pathname pointed to by
.Fa path_p
.Fa path
exceeds
.Dv PATH_MAX ,
or a component of the pathname exceeds
.Dv NAME_MAX .
.It Bq Er ENOENT
A component of
.Fa path_p
.Fa path
does not exist.
.It Bq Er ENOMEM
Insufficient memory is available
to allocate a new MAC label structure.
.It Bq Er ENOTDIR
A component of
.Fa path_p
.Fa path
is not a directory.
.El
.Sh SEE ALSO
.Xr mac 3 ,
.Xr mac_free 3 ,
.Xr mac_text 3 ,
.Xr mac_prepare 3 ,
.Xr mac_set 3 ,
.Xr mac_text 3
.Xr mac 9
.Sh STANDARDS
POSIX.1e is described in IEEE POSIX.1e draft 17.
Discussion of the draft

View file

@ -15,9 +15,6 @@
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\" 3. The name of the author may not be used to endorse or promote
.\" products derived from this software without specific prior written
.\" permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
@ -74,4 +71,10 @@ is not valid.
Insufficient memory was available to allocate internal storage.
.El
.Sh SEE ALSO
.Xr mac 3
.Xr mac 3 ,
.Xr mac_free 3 ,
.Xr mac_get 3 ,
.Xr mac_prepare 3 ,
.Xr mac_set 3 ,
.Xr mac_text 3 ,
.Xr mac 9

View file

@ -15,9 +15,6 @@
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\" 3. The name of the author may not be used to endorse or promote
.\" products derived from this software without specific prior written
.\" permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
@ -74,4 +71,10 @@ is not valid.
Insufficient memory was available to allocate internal storage.
.El
.Sh SEE ALSO
.Xr mac 3
.Xr mac 3 ,
.Xr mac_free 3 ,
.Xr mac_get 3 ,
.Xr mac_prepare 3 ,
.Xr mac_set 3 ,
.Xr mac_text 3 ,
.Xr mac 9

View file

@ -85,7 +85,7 @@ and its effective user ID is equal to
the owner of the file,
or has appropriate privileges.
.Sh RETURN VALUES
.Rv -std mac_set_fd mac_set_file mac_set_proc
.Rv -std mac_set_fd mac_set_file mac_set_link mac_set_proc
.Sh ERRORS
.Bl -tag -width Er
.It Bq Er EACCES
@ -133,4 +133,6 @@ is not a directory.
.Xr mac 3 ,
.Xr mac_free 3 ,
.Xr mac_get 3 ,
.Xr mac_is_present_np 3 ,
.Xr mac_prepare 3 ,
.Xr mac_text 3

View file

@ -15,9 +15,6 @@
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\" 3. The name of the author may not be used to endorse or promote
.\" products derived from this software without specific prior written
.\" permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
@ -85,6 +82,8 @@ to allocate internal storage.
.Xr mac 3 ,
.Xr mac_free 3 ,
.Xr mac_get 3 ,
.Xr mac_is_present_np 3 ,
.Xr mac_prepare 3 ,
.Xr mac_set 3 ,
.Xr maclabel 7
.Sh STANDARDS