aboutsummaryrefslogtreecommitdiff
path: root/selinux
diff options
context:
space:
mode:
Diffstat (limited to 'selinux')
-rw-r--r--selinux/chcon.c33
-rw-r--r--selinux/getenforce.c3
-rw-r--r--selinux/getsebool.c5
-rw-r--r--selinux/load_policy.c4
-rw-r--r--selinux/matchpathcon.c10
-rw-r--r--selinux/runcon.c22
-rw-r--r--selinux/selinuxenabled.c4
-rw-r--r--selinux/sestatus.c6
-rw-r--r--selinux/setenforce.c4
-rw-r--r--selinux/setfiles.c40
-rw-r--r--selinux/setsebool.c5
11 files changed, 136 insertions, 0 deletions
diff --git a/selinux/chcon.c b/selinux/chcon.c
index e00cdda1b..8644502b5 100644
--- a/selinux/chcon.c
+++ b/selinux/chcon.c
@@ -7,6 +7,39 @@
*
* Licensed under GPLv2, see file LICENSE in this source tree.
*/
+
+//usage:#define chcon_trivial_usage
+//usage: "[OPTIONS] CONTEXT FILE..."
+//usage: "\n chcon [OPTIONS] [-u USER] [-r ROLE] [-l RANGE] [-t TYPE] FILE..."
+//usage: IF_FEATURE_CHCON_LONG_OPTIONS(
+//usage: "\n chcon [OPTIONS] --reference=RFILE FILE..."
+//usage: )
+//usage:#define chcon_full_usage "\n\n"
+//usage: "Change the security context of each FILE to CONTEXT\n"
+//usage: IF_FEATURE_CHCON_LONG_OPTIONS(
+//usage: "\n -v,--verbose Verbose"
+//usage: "\n -c,--changes Report changes made"
+//usage: "\n -h,--no-dereference Affect symlinks instead of their targets"
+//usage: "\n -f,--silent,--quiet Suppress most error messages"
+//usage: "\n --reference=RFILE Use RFILE's group instead of using a CONTEXT value"
+//usage: "\n -u,--user=USER Set user/role/type/range in the target"
+//usage: "\n -r,--role=ROLE security context"
+//usage: "\n -t,--type=TYPE"
+//usage: "\n -l,--range=RANGE"
+//usage: "\n -R,--recursive Recurse"
+//usage: )
+//usage: IF_NOT_FEATURE_CHCON_LONG_OPTIONS(
+//usage: "\n -v Verbose"
+//usage: "\n -c Report changes made"
+//usage: "\n -h Affect symlinks instead of their targets"
+//usage: "\n -f Suppress most error messages"
+//usage: "\n -u USER Set user/role/type/range in the target security context"
+//usage: "\n -r ROLE"
+//usage: "\n -t TYPE"
+//usage: "\n -l RNG"
+//usage: "\n -R Recurse"
+//usage: )
+
#include <getopt.h>
#include <selinux/context.h>
diff --git a/selinux/getenforce.c b/selinux/getenforce.c
index d9d9d0f65..56611d693 100644
--- a/selinux/getenforce.c
+++ b/selinux/getenforce.c
@@ -7,6 +7,9 @@
* Licensed under GPLv2, see file LICENSE in this source tree.
*/
+//usage:#define getenforce_trivial_usage NOUSAGE_STR
+//usage:#define getenforce_full_usage ""
+
#include "libbb.h"
int getenforce_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
diff --git a/selinux/getsebool.c b/selinux/getsebool.c
index 924356cae..e8f0fefb0 100644
--- a/selinux/getsebool.c
+++ b/selinux/getsebool.c
@@ -7,6 +7,11 @@
* Licensed under GPLv2, see file LICENSE in this source tree.
*/
+//usage:#define getsebool_trivial_usage
+//usage: "-a or getsebool boolean..."
+//usage:#define getsebool_full_usage "\n\n"
+//usage: " -a Show all selinux booleans"
+
#include "libbb.h"
int getsebool_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
diff --git a/selinux/load_policy.c b/selinux/load_policy.c
index 8fc92dbf3..ce139dbf2 100644
--- a/selinux/load_policy.c
+++ b/selinux/load_policy.c
@@ -4,6 +4,10 @@
*
* Licensed under GPLv2, see file LICENSE in this source tree.
*/
+
+//usage:#define load_policy_trivial_usage NOUSAGE_STR
+//usage:#define load_policy_full_usage ""
+
#include "libbb.h"
int load_policy_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
diff --git a/selinux/matchpathcon.c b/selinux/matchpathcon.c
index ec49077c8..9e5728eb3 100644
--- a/selinux/matchpathcon.c
+++ b/selinux/matchpathcon.c
@@ -5,6 +5,16 @@
*
* Licensed under GPLv2, see file LICENSE in this source tree.
*/
+
+//usage:#define matchpathcon_trivial_usage
+//usage: "[-n] [-N] [-f file_contexts_file] [-p prefix] [-V]"
+//usage:#define matchpathcon_full_usage "\n\n"
+//usage: " -n Don't display path"
+//usage: "\n -N Don't use translations"
+//usage: "\n -f Use alternate file_context file"
+//usage: "\n -p Use prefix to speed translations"
+//usage: "\n -V Verify file context on disk matches defaults"
+
#include "libbb.h"
static int print_matchpathcon(char *path, int noprint)
diff --git a/selinux/runcon.c b/selinux/runcon.c
index 54349b25c..f0b21269f 100644
--- a/selinux/runcon.c
+++ b/selinux/runcon.c
@@ -28,6 +28,28 @@
*
* Licensed under GPLv2, see file LICENSE in this source tree.
*/
+
+//usage:#define runcon_trivial_usage
+//usage: "[-c] [-u USER] [-r ROLE] [-t TYPE] [-l RANGE] PROG ARGS\n"
+//usage: "runcon CONTEXT PROG ARGS"
+//usage:#define runcon_full_usage "\n\n"
+//usage: "Run PROG in a different security context\n"
+//usage: "\n CONTEXT Complete security context\n"
+//usage: IF_FEATURE_RUNCON_LONG_OPTIONS(
+//usage: "\n -c,--compute Compute process transition context before modifying"
+//usage: "\n -t,--type=TYPE Type (for same role as parent)"
+//usage: "\n -u,--user=USER User identity"
+//usage: "\n -r,--role=ROLE Role"
+//usage: "\n -l,--range=RNG Levelrange"
+//usage: )
+//usage: IF_NOT_FEATURE_RUNCON_LONG_OPTIONS(
+//usage: "\n -c Compute process transition context before modifying"
+//usage: "\n -t TYPE Type (for same role as parent)"
+//usage: "\n -u USER User identity"
+//usage: "\n -r ROLE Role"
+//usage: "\n -l RNG Levelrange"
+//usage: )
+
#include <getopt.h>
#include <selinux/context.h>
#include <selinux/flask.h>
diff --git a/selinux/selinuxenabled.c b/selinux/selinuxenabled.c
index aa4e63f74..ce830dc22 100644
--- a/selinux/selinuxenabled.c
+++ b/selinux/selinuxenabled.c
@@ -6,6 +6,10 @@
*
* Licensed under GPLv2, see file LICENSE in this source tree.
*/
+
+//usage:#define selinuxenabled_trivial_usage NOUSAGE_STR
+//usage:#define selinuxenabled_full_usage ""
+
#include "libbb.h"
int selinuxenabled_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
diff --git a/selinux/sestatus.c b/selinux/sestatus.c
index aa12e806c..0bd1a0dda 100644
--- a/selinux/sestatus.c
+++ b/selinux/sestatus.c
@@ -8,6 +8,12 @@
* Licensed under GPLv2, see file LICENSE in this source tree.
*/
+//usage:#define sestatus_trivial_usage
+//usage: "[-vb]"
+//usage:#define sestatus_full_usage "\n\n"
+//usage: " -v Verbose"
+//usage: "\n -b Display current state of booleans"
+
#include "libbb.h"
extern char *selinux_mnt;
diff --git a/selinux/setenforce.c b/selinux/setenforce.c
index be5432147..c5bc0a5a6 100644
--- a/selinux/setenforce.c
+++ b/selinux/setenforce.c
@@ -7,6 +7,10 @@
* Licensed under GPLv2, see file LICENSE in this source tree.
*/
+//usage:#define setenforce_trivial_usage
+//usage: "[Enforcing | Permissive | 1 | 0]"
+//usage:#define setenforce_full_usage ""
+
#include "libbb.h"
/* These strings are arranged so that odd ones
diff --git a/selinux/setfiles.c b/selinux/setfiles.c
index 989510e3d..ca3fd9361 100644
--- a/selinux/setfiles.c
+++ b/selinux/setfiles.c
@@ -4,6 +4,46 @@
Port to BusyBox (c) 2007 by Yuichi Nakamura <ynakam@hitachisoft.jp>
*/
+//usage:#define setfiles_trivial_usage
+//usage: "[-dnpqsvW] [-e DIR]... [-o FILE] [-r alt_root_path]"
+//usage: IF_FEATURE_SETFILES_CHECK_OPTION(
+//usage: " [-c policyfile] spec_file"
+//usage: )
+//usage: " pathname"
+//usage:#define setfiles_full_usage "\n\n"
+//usage: "Reset file contexts under pathname according to spec_file\n"
+//usage: IF_FEATURE_SETFILES_CHECK_OPTION(
+//usage: "\n -c FILE Check the validity of the contexts against the specified binary policy"
+//usage: )
+//usage: "\n -d Show which specification matched each file"
+//usage: "\n -l Log changes in file labels to syslog"
+//usage: "\n -n Don't change any file labels"
+//usage: "\n -q Suppress warnings"
+//usage: "\n -r DIR Use an alternate root path"
+//usage: "\n -e DIR Exclude DIR"
+//usage: "\n -F Force reset of context to match file_context for customizable files"
+//usage: "\n -o FILE Save list of files with incorrect context"
+//usage: "\n -s Take a list of files from stdin (instead of command line)"
+//usage: "\n -v Show changes in file labels, if type or role are changing"
+//usage: "\n -vv Show changes in file labels, if type, role, or user are changing"
+//usage: "\n -W Display warnings about entries that had no matching files"
+//usage:
+//usage:#define restorecon_trivial_usage
+//usage: "[-iFnRv] [-e EXCLUDEDIR]... [-o FILE] [-f FILE]"
+//usage:#define restorecon_full_usage "\n\n"
+//usage: "Reset security contexts of files in pathname\n"
+//usage: "\n -i Ignore files that don't exist"
+//usage: "\n -f FILE File with list of files to process"
+//usage: "\n -e DIR Directory to exclude"
+//usage: "\n -R,-r Recurse"
+//usage: "\n -n Don't change any file labels"
+//usage: "\n -o FILE Save list of files with incorrect context"
+//usage: "\n -v Verbose"
+//usage: "\n -vv Show changed labels"
+//usage: "\n -F Force reset of context to match file_context"
+//usage: "\n for customizable files, or the user section,"
+//usage: "\n if it has changed"
+
#include "libbb.h"
#if ENABLE_FEATURE_SETFILES_CHECK_OPTION
#include <sepol/sepol.h>
diff --git a/selinux/setsebool.c b/selinux/setsebool.c
index a8cc00407..ec682e5c5 100644
--- a/selinux/setsebool.c
+++ b/selinux/setsebool.c
@@ -8,6 +8,11 @@
* Licensed under GPLv2, see file LICENSE in this source tree.
*/
+//usage:#define setsebool_trivial_usage
+//usage: "boolean value"
+//usage:#define setsebool_full_usage "\n\n"
+//usage: "Change boolean setting"
+
#include "libbb.h"
int setsebool_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;