mirror of
https://github.com/SELinuxProject/selinux
synced 2024-12-24 15:02:44 +00:00
policycoreutils/semodule: Improve man page and unify it with --help
Unify the way parameters are described in man pages and --help message. Explain special syntax allowing the user to specify multiple modules when using -i/u/r/E mods. Point out that priority has to be specified in order to remove module at different priority than 400 and that "-d" disables all instances of given module across priorities. Resolves: rhbz#1320565, rhbz#1337192 Signed-off-by: Vit Mojzis <vmojzis@redhat.com>
This commit is contained in:
parent
c99739a6aa
commit
a0c4e64238
@ -3,7 +3,7 @@
|
|||||||
semodule \- Manage SELinux policy modules.
|
semodule \- Manage SELinux policy modules.
|
||||||
|
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
.B semodule [options]... MODE [MODES]...
|
.B semodule [option]... MODE...
|
||||||
.br
|
.br
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
.PP
|
.PP
|
||||||
@ -15,7 +15,7 @@ any other transaction. semodule acts on module packages created
|
|||||||
by semodule_package. Conventionally, these files have a .pp suffix
|
by semodule_package. Conventionally, these files have a .pp suffix
|
||||||
(policy package), although this is not mandated in any way.
|
(policy package), although this is not mandated in any way.
|
||||||
|
|
||||||
.SH "OPTIONS"
|
.SH "MODES"
|
||||||
.TP
|
.TP
|
||||||
.B \-R, \-\-reload
|
.B \-R, \-\-reload
|
||||||
force a reload of policy
|
force a reload of policy
|
||||||
@ -36,16 +36,11 @@ deprecated, alias for --install
|
|||||||
deprecated, alias for --install
|
deprecated, alias for --install
|
||||||
.TP
|
.TP
|
||||||
.B \-r,\-\-remove=MODULE_NAME
|
.B \-r,\-\-remove=MODULE_NAME
|
||||||
remove existing module
|
remove existing module at desired priority (defaults to -X 400)
|
||||||
.TP
|
.TP
|
||||||
.B \-l[KIND],\-\-list-modules[=KIND]
|
.B \-l[KIND],\-\-list-modules[=KIND]
|
||||||
display list of installed modules (other than base)
|
display list of installed modules (other than base)
|
||||||
.TP
|
.TP
|
||||||
.B \-E,\-\-extract=MODULE_PKG
|
|
||||||
Extract a module from the store as an HLL or CIL file to the current directory.
|
|
||||||
A module is extracted as HLL by default. The name of the module written is
|
|
||||||
<module-name>.<lang_ext>
|
|
||||||
.TP
|
|
||||||
.B KIND:
|
.B KIND:
|
||||||
.TP
|
.TP
|
||||||
standard
|
standard
|
||||||
@ -57,12 +52,18 @@ list all modules
|
|||||||
.B \-X,\-\-priority=PRIORITY
|
.B \-X,\-\-priority=PRIORITY
|
||||||
set priority for following operations (1-999)
|
set priority for following operations (1-999)
|
||||||
.TP
|
.TP
|
||||||
.B \-e,\-\-enabled=MODULE_NAME
|
.B \-e,\-\-enable=MODULE_NAME
|
||||||
enable module
|
enable module
|
||||||
.TP
|
.TP
|
||||||
.B \-d,\-\-disable=MODULE_NAME
|
.B \-d,\-\-disable=MODULE_NAME
|
||||||
disable module
|
disable module
|
||||||
.TP
|
.TP
|
||||||
|
.B \-E,\-\-extract=MODULE_PKG
|
||||||
|
Extract a module from the store as an HLL or CIL file to the current directory.
|
||||||
|
A module is extracted as HLL by default. The name of the module written is
|
||||||
|
<module-name>.<lang_ext>
|
||||||
|
.SH "OPTIONS"
|
||||||
|
.TP
|
||||||
.B \-s,\-\-store
|
.B \-s,\-\-store
|
||||||
name of the store to operate on
|
name of the store to operate on
|
||||||
.TP
|
.TP
|
||||||
@ -101,17 +102,22 @@ only modules listed in \-\-extract after this option.
|
|||||||
$ semodule \-b base.pp
|
$ semodule \-b base.pp
|
||||||
# Install or replace a non-base policy package.
|
# Install or replace a non-base policy package.
|
||||||
$ semodule \-i httpd.pp
|
$ semodule \-i httpd.pp
|
||||||
|
# Install or replace all non-base modules in the current directory.
|
||||||
|
# This syntax can be used with -i/u/r/E, but no other option can be entered after the module names
|
||||||
|
$ semodule \-i *.pp
|
||||||
|
# Install or replace all modules in the current directory.
|
||||||
|
$ ls *.pp | grep \-Ev "base.pp|enableaudit.pp" | xargs /usr/sbin/semodule \-b base.pp \-i
|
||||||
# List non-base modules.
|
# List non-base modules.
|
||||||
$ semodule \-l
|
$ semodule \-l
|
||||||
|
# List all modules including priorities
|
||||||
|
$ semodule \-lfull
|
||||||
|
# Remove a module at priority 100
|
||||||
|
$ semodule \-X 100 \-r wireshark
|
||||||
# Turn on all AVC Messages for which SELinux currently is "dontaudit"ing.
|
# Turn on all AVC Messages for which SELinux currently is "dontaudit"ing.
|
||||||
$ semodule \-DB
|
$ semodule \-DB
|
||||||
# Turn "dontaudit" rules back on.
|
# Turn "dontaudit" rules back on.
|
||||||
$ semodule \-B
|
$ semodule \-B
|
||||||
# Install or replace all non-base modules in the current directory.
|
# Disable a module (all instances of given module across priorities will be disabled).
|
||||||
$ semodule \-i *.pp
|
|
||||||
# Install or replace all modules in the current directory.
|
|
||||||
$ ls *.pp | grep \-Ev "base.pp|enableaudit.pp" | xargs /usr/sbin/semodule \-b base.pp \-i
|
|
||||||
# Disable a module.
|
|
||||||
$ semodule \-d alsa
|
$ semodule \-d alsa
|
||||||
# Install a module at a specific priority.
|
# Install a module at a specific priority.
|
||||||
$ semodule \-X 100 \-i alsa.pp
|
$ semodule \-X 100 \-i alsa.pp
|
||||||
|
@ -120,13 +120,14 @@ static void create_signal_handlers(void)
|
|||||||
|
|
||||||
static void usage(char *progname)
|
static void usage(char *progname)
|
||||||
{
|
{
|
||||||
printf("usage: %s [options]... MODE [MODES]...\n", progname);
|
printf("usage: %s [option]... MODE...\n", progname);
|
||||||
printf("Manage SELinux policy modules.\n");
|
printf("Manage SELinux policy modules.\n");
|
||||||
printf("MODES:\n");
|
printf("MODES:\n");
|
||||||
printf(" -R, --reload reload policy\n");
|
printf(" -R, --reload reload policy\n");
|
||||||
printf(" -B, --build build and reload policy\n");
|
printf(" -B, --build build and reload policy\n");
|
||||||
|
printf(" -D,--disable_dontaudit Remove dontaudits from policy\n");
|
||||||
printf(" -i,--install=MODULE_PKG install a new module\n");
|
printf(" -i,--install=MODULE_PKG install a new module\n");
|
||||||
printf(" -r,--remove=MODULE_NAME remove existing module\n");
|
printf(" -r,--remove=MODULE_NAME remove existing module at desired priority\n");
|
||||||
printf(" -l[KIND],--list-modules[=KIND] display list of installed modules\n");
|
printf(" -l[KIND],--list-modules[=KIND] display list of installed modules\n");
|
||||||
printf(" KIND: standard list highest priority, enabled modules\n");
|
printf(" KIND: standard list highest priority, enabled modules\n");
|
||||||
printf(" full list all modules\n");
|
printf(" full list all modules\n");
|
||||||
@ -134,12 +135,11 @@ static void usage(char *progname)
|
|||||||
printf(" -e,--enable=MODULE_NAME enable module\n");
|
printf(" -e,--enable=MODULE_NAME enable module\n");
|
||||||
printf(" -d,--disable=MODULE_NAME disable module\n");
|
printf(" -d,--disable=MODULE_NAME disable module\n");
|
||||||
printf(" -E,--extract=MODULE_NAME extract module\n");
|
printf(" -E,--extract=MODULE_NAME extract module\n");
|
||||||
printf("Other options:\n");
|
printf("Options:\n");
|
||||||
printf(" -s,--store name of the store to operate on\n");
|
printf(" -s,--store name of the store to operate on\n");
|
||||||
printf(" -N,-n,--noreload do not reload policy after commit\n");
|
printf(" -N,-n,--noreload do not reload policy after commit\n");
|
||||||
printf(" -h,--help print this message and quit\n");
|
printf(" -h,--help print this message and quit\n");
|
||||||
printf(" -v,--verbose be verbose\n");
|
printf(" -v,--verbose be verbose\n");
|
||||||
printf(" -D,--disable_dontaudit Remove dontaudits from policy\n");
|
|
||||||
printf(" -P,--preserve_tunables Preserve tunables in policy\n");
|
printf(" -P,--preserve_tunables Preserve tunables in policy\n");
|
||||||
printf(" -C,--ignore-module-cache Rebuild CIL modules compiled from HLL files\n");
|
printf(" -C,--ignore-module-cache Rebuild CIL modules compiled from HLL files\n");
|
||||||
printf(" -p,--path use an alternate path for the policy root\n");
|
printf(" -p,--path use an alternate path for the policy root\n");
|
||||||
|
Loading…
Reference in New Issue
Block a user