[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 47/48] libselinux: Updated selabel_media(5) man page



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


   This patch looks good to me. acked.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk7dH4MACgkQrlYvE4MpobNcVQCgxYM2HShIKJLOUtgehSRAJM7k
OMsAoL9NVGSCAjOmNmDkcMi10HQZA8Xv
=HxMU
-----END PGP SIGNATURE-----
>From 003479936a628ef0431e86bbc2a794fd9b268c6e Mon Sep 17 00:00:00 2001
From: Richard Haines <richard_c_haines@xxxxxxxxxxxxxx>
Date: Thu, 1 Dec 2011 16:24:33 +0000
Subject: [PATCH 47/48] libselinux: Updated selabel_media(5) man page

Updated selabel_media(5) with media context configuration file format and
added media(5) man page that links to it.

Signed-off-by: Richard Haines <richard_c_haines@xxxxxxxxxxxxxx>
Signed-off-by: Eric Paris <eparis@xxxxxxxxxx>
---
 libselinux/man/man5/media.5         |    1 +
 libselinux/man/man5/selabel_media.5 |   86 ++++++++++++++++++++++++++++-------
 2 files changed, 70 insertions(+), 17 deletions(-)
 create mode 100644 libselinux/man/man5/media.5

diff --git a/libselinux/man/man5/media.5 b/libselinux/man/man5/media.5
new file mode 100644
index 0000000..14f00f2
--- /dev/null
+++ b/libselinux/man/man5/media.5
@@ -0,0 +1 @@
+.so man5/selabel_media.5
diff --git a/libselinux/man/man5/selabel_media.5 b/libselinux/man/man5/selabel_media.5
index 796260f..0df1961 100644
--- a/libselinux/man/man5/selabel_media.5
+++ b/libselinux/man/man5/selabel_media.5
@@ -1,37 +1,89 @@
 .\" Hey Emacs! This file is -*- nroff -*- source.
 .\"
 .\" Author: Eamon Walsh (ewalsh@xxxxxxxxxxxxx) 2007
-.TH "selabel_media" "5" "18 Jun 2007" "" "SELinux API documentation"
+.TH "selabel_media" "5" "29 Nov 2011" "Security Enhanced Linux" "SELinux API documentation"
 .SH "NAME"
-selabel_media \- userspace SELinux labeling interface: media contexts backend.
-.SH "SYNOPSIS"
-.B #include <selinux/selinux.h>
+selabel_media \- userspace SELinux labeling interface and configuration file format for the media contexts backend.
 
+.SH "SYNOPSIS"
 .B #include <selinux/label.h>
 .sp
 .BI "int selabel_lookup(struct selabel_handle *" hnd ,
 .in +\w'int selabel_lookup('u
 .BI "security_context_t *" context ,
-
+.br
+.BI "const char *" device_name ", int " unused ");"
+.in
+.sp
+.BI "int selabel_lookup_raw(struct selabel_handle *" hnd ,
+.in +\w'int selabel_lookup('u
+.BI "security_context_t *" context ,
+.br
 .BI "const char *" device_name ", int " unused ");"
 
 .SH "DESCRIPTION"
-The media contexts backend maps from media device names such as "cdrom" or "floppy" into security contexts.  It is used to find the appropriate context for establishing context mounts on these devices.
-
+The media contexts backend maps from media device names such as "cdrom" or "floppy" into security contexts. It is used to find the appropriate context for establishing context mounts on these devices. The returned \fIcontext\fR must be freed using \fBfreecon\fR(3).
+.br
+\fBselabel_lookup\fR(3) describes the function with its return and error codes.
+.sp
 The integer lookup argument is currently unused and should be set to zero.
+.sp
+Any messages generated by \fBselabel_lookup\fR are sent to \fIstderr\fR by default, although this can be changed by \fBselinux_set_callback\fR(3).
+.sp
+.B selabel_lookup_raw
+behaves identically to \fBselabel_lookup\fR but does not perform context translation.
+.sp
+The \fBFILES\fR section details the configuration files used to determine the media context.
 
 .SH "OPTIONS"
-In addition to the global options described in 
-.BR selabel_open (3),
-this backend recognizes the following options:
-
+In addition to the global options described in \fBselabel_open\fR(3), this backend recognizes the following options:
 .TP
 .B SELABEL_OPT_PATH
-A non-null value for this option specifies a path to a file that will be opened in lieu of the standard media contexts file.  
+A non-null value for this option specifies a path to a file that will be opened in lieu of the standard \fImedia\fR contexts file.
 
-.SH "SEE ALSO"
-.BR selabel_open (3),
-.BR selabel_lookup (3),
-.BR selabel_stats (3),
-.BR selinux (8)
+.SH "FILES"
+The media context file used to retrieve a default context depends on the \fBSELABEL_OPT_PATH\fR parameter passed to \fBselabel_open\FR(3). If \fINULL\fR, then the \fBSELABEL_OPT_PATH\fR value will default to the active policy media contexts location (as returned by \fBselinux_media_context_path\fR(3)), otherwise the actual \fBSELABEL_OPT_PATH\fR value specified is used.
+.sp
+The default media contexts file is:
+.RS
+.I /etc/selinux/{SELINUXTYPE}/contexts/files/media
+.RE
+.sp
+Where \fI{SELINUXTYPE}\fR is the entry from the selinux configuration file \fIconfig\fR (see \fBselinux_config\fR(5)).
+.sp
+Should there not be a valid entry in the \fImedia\fR file, then the default \fIremovable_context\fR file will be read (see \fBremovable_context\fR(5)).
 
+.SH "FILE FORMAT"
+Each line within the \fImedia\fR file is as follows:
+.RS
+.I device_name context
+.RE
+.sp
+Where:
+.RS
+.I device_name
+.RS
+The media identifier (e.g. cdrom, floppy, disk and usb).
+.RE
+.I context
+.RS
+The context to be used for labeling the device.
+.RE
+.RE
+.sp
+Example:
+.RS
+# contexts/files/media
+.br
+cdrom system_u:object_r:removable_device_t
+.br
+floppy system_u:object_r:removable_device_t
+.br
+disk system_u:object_r:fixed_disk_device_t
+
+.SH "NOTES"
+If contexts are to be validated, then the global option \fBSELABEL_OPT_VALIDATE\fR must be set before calling \fBselabel_open\fR(3). If
+this is not set, then it is possible for an invalid context to be returned.
+
+.SH "SEE ALSO"
+.BR selinux "(8), " selabel_open "(3), " selabel_lookup "(3), " selabel_stats "(3), " selabel_close "(3), " selinux_set_callback "(3), " selinux_media_context_path "(3), " freecon "(3), " selinux_config "(5), " removable_context "(5) "
-- 
1.7.7.4


[Fedora Users]     [Fedora Legacy]     [Fedora Desktop]     [Yosemite Photos]     [Yosemite News]     [Yosemite Campsites]     [KDE Users]     [Gnome Users]

Powered by Linux