PATCH: Add examples to man-pages
The patch below adds one example to the semodule man-page (because I use it all the time while developing policy) and several examples to the semanage man-page.
I tried to catch the most common use-cases, but maybe someone who has more experience with semanage can add some more.
Thomas
Index: semanage/semanage.8
===================================================================
RCS file: /cvsroot/selinux/nsa/selinux-usr/policycoreutils/semanage/semanage.8,v retrieving revision 1.6
semanage.8 +13 -0
@@ -75,7 +75,20 @@ .I \-v, \-\-verbose verbose output +.SH EXAMPLE +.nf +# View SELinux user mappings +$ semanage user -l +# Allow joe to login as staff_u +$ semanage login -a -s staff_u +# Add file-context for everything under /web (used by restorecon) +$ semanage fcontext -a -t httpd_sys_content_t '/web(/.*)?' +# Allow Apache to listen on port 81 +$ semanage port -a -t http_port_t -p tcp 81 +.fi + .SH "AUTHOR" This man page was written by Daniel Walsh <[email protected]> and Russell Coker <[email protected]>. +Examples by Thomas Bleher <[email protected]>.
Index: semodule/semodule.8
===================================================================
RCS file: /cvsroot/selinux/nsa/selinux-usr/policycoreutils/semodule/semodule.8,v retrieving revision 1.2
semodule.8 +2 -1
@@ -58,11 +58,12 @@ $ semodule -i httpd.pp # List non-base modules. $ semodule -l +# Replace all modules with the ones in the current directory +$ semodule -b base.pp `semodule -l | awk '{print "-i " $1 ".pp"}'` .fi .SH SEE ALSO .B checkmodule(8), semodule_package(8) -(8), .SH AUTHORS .nf This manual page was written by Dan Walsh <[email protected]>.