From: Richard Jones Date: Wed, 12 Aug 2009 16:40:22 +0000 (+0100) Subject: Add documentation for SELinux configuration. X-Git-Tag: 1.0.67~40 X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=a9b0a6d54fe5fa6564f657650d4608240c71ea3a;p=libguestfs.git Add documentation for SELinux configuration. Also use L to link between sections. --- diff --git a/guestfs.pod b/guestfs.pod index 4d462f3..bbc594a 100644 --- a/guestfs.pod +++ b/guestfs.pod @@ -78,7 +78,7 @@ are blocking calls. You can use the low-level event API to do non-blocking operations instead. All functions that return integers, return C<-1> on error. See -section ERROR HANDLING below for how to handle errors. +section L below for how to handle errors. =head2 guestfs_h * @@ -87,7 +87,7 @@ Create a handle by calling C. Call C to free the handle and release all resources used. For information on using multiple handles and threads, see the section -MULTIPLE HANDLES AND MULTIPLE THREADS below. +L below. =head2 guestfs_create @@ -104,7 +104,7 @@ After configuring the handle, you have to call C and C. You may also want to configure error handling for the handle. See -ERROR HANDLING section below. +L section below. =head2 guestfs_close @@ -316,6 +316,11 @@ Only supports Linux guests (not Windows, BSD, etc). Architecture limitations (eg. won't work for a PPC guest on an X86 host). +=item * + +For SELinux guests, you may need to enable SELinux and load policy +first. See L in this manpage. + =back The two main API calls to run commands are C and @@ -337,6 +342,39 @@ directory, plus additional information about each one. C can be used to recursively list files. +=head2 SELINUX + +We support SELinux guests. To ensure that labeling happens correctly +in SELinux guests, you need to enable SELinux and load the guest's +policy: + +=over 4 + +=item 1. + +Before launching, do: + + guestfs_set_selinux (g, 1); + +=item 2. + +After mounting the guest's filesystem(s), load the policy. This +is best done by running the L command in the +guest itself: + + guestfs_sh (g, "/usr/sbin/load_policy"); + +(Older versions of C require you to specify the +name of the policy file). + +=back + +This will work for running commands and editing existing files. + +When new files are created, you may need to label them explicitly, +for example by running the external command +C. + =head1 HIGH-LEVEL API ACTIONS =head2 ABI GUARANTEE @@ -935,7 +973,7 @@ Set the default qemu binary that libguestfs uses. If not set, then the qemu which was found at compile time by the configure script is used. -See also L above. +See also L above. =item TMPDIR