aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2003-07-03 10:07:04 +0000
committerEric Andersen <andersen@codepoet.org>2003-07-03 10:07:04 +0000
commit9e48045e45df7e3e205575a4eb3dc39d634b05aa (patch)
treee8f993dffc34380fbcc54cc858c81da594bdb95b /include
parentc48d49ad988a4163cff7f38ee4bd1f9886d0ed11 (diff)
downloadbusybox-9e48045e45df7e3e205575a4eb3dc39d634b05aa.tar.gz
Patch from Russell Coker:
I've attached my latest SE Linux patch for busybox against the latest CVS version of busybox.
Diffstat (limited to 'include')
-rw-r--r--include/libbb.h15
-rw-r--r--include/usage.h15
2 files changed, 24 insertions, 6 deletions
diff --git a/include/libbb.h b/include/libbb.h
index 7b3ac4b85..edb8a6ed4 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -39,6 +39,9 @@
#include <features.h>
#include "config.h"
+#ifdef CONFIG_SELINUX
+#include <proc_secure.h>
+#endif
#include "pwd_.h"
#include "grp_.h"
@@ -394,7 +397,11 @@ void bb_xasprintf(char **string_ptr, const char *format, ...) __attribute__ ((fo
#define FAIL_DELAY 3
extern void change_identity ( const struct passwd *pw );
-extern void run_shell ( const char *shell, int loginshell, const char *command, const char **additional_args );
+extern void run_shell ( const char *shell, int loginshell, const char *command, const char **additional_args
+#ifdef CONFIG_SELINUX
+ , security_id_t sid
+#endif
+);
extern int run_parts(char **args, const unsigned char test_mode);
extern int restricted_shell ( const char *shell );
extern void setup_environment ( const char *shell, int loginshell, int changeenv, const struct passwd *pw );
@@ -425,7 +432,11 @@ typedef struct {
char short_cmd[16];
} procps_status_t;
-extern procps_status_t * procps_scan(int save_user_arg0);
+extern procps_status_t * procps_scan(int save_user_arg0
+#ifdef CONFIG_SELINUX
+ , int use_selinux, security_id_t *sid
+#endif
+);
extern unsigned short compare_string_array(const char *string_array[], const char *key);
extern int my_query_module(const char *name, int which, void **buf, size_t *bufsize, size_t *ret);
diff --git a/include/usage.h b/include/usage.h
index 701b40daa..e0cfa7d2f 100644
--- a/include/usage.h
+++ b/include/usage.h
@@ -882,6 +882,12 @@
"\t-u\tthe hardware clock is kept in coordinated universal time\n" \
"\t-l\tthe hardware clock is kept in local time"
+#ifdef CONFIG_SELINUX
+#define USAGE_SELINUX(a, b) a
+#else
+#define USAGE_SELINUX(a, b) b
+#endif
+
#define id_trivial_usage \
"[OPTIONS]... [USERNAME]"
#define id_full_usage \
@@ -889,6 +895,7 @@
"Options:\n" \
"\t-g\tprints only the group ID\n" \
"\t-u\tprints only the user ID\n" \
+ USAGE_SELINUX("\t-c\tprints only the security context\n", "") \
"\t-n\tprint a name instead of a number (with for -ug)\n" \
"\t-r\tprints the real user ID instead of the effective ID (with -ug)"
#define id_example_usage \
@@ -1347,7 +1354,7 @@
#define USAGE_AUTOWIDTH(a)
#endif
#define ls_trivial_usage \
- "[-1Aa" USAGE_LS_TIMESTAMPS("c") "Cd" USAGE_LS_TIMESTAMPS("e") USAGE_LS_FILETYPES("F") "iln" USAGE_LS_FILETYPES("p") USAGE_LS_FOLLOWLINKS("L") USAGE_LS_RECURSIVE("R") USAGE_LS_SORTFILES("rS") "s" USAGE_AUTOWIDTH("T") USAGE_LS_TIMESTAMPS("tu") USAGE_LS_SORTFILES("v") USAGE_AUTOWIDTH("w") "x" USAGE_LS_SORTFILES("X") USAGE_HUMAN_READABLE("h") USAGE_NOT_HUMAN_READABLE("") "k] [filenames...]"
+ "[-1Aa" USAGE_LS_TIMESTAMPS("c") "Cd" USAGE_LS_TIMESTAMPS("e") USAGE_LS_FILETYPES("F") "iln" USAGE_LS_FILETYPES("p") USAGE_LS_FOLLOWLINKS("L") USAGE_LS_RECURSIVE("R") USAGE_LS_SORTFILES("rS") "s" USAGE_AUTOWIDTH("T") USAGE_LS_TIMESTAMPS("tu") USAGE_LS_SORTFILES("v") USAGE_AUTOWIDTH("w") "x" USAGE_LS_SORTFILES("X") USAGE_HUMAN_READABLE("h") USAGE_NOT_HUMAN_READABLE("") "k" USAGE_SELINUX("K", "") "] [filenames...]"
#define ls_full_usage \
"List directory contents\n\n" \
"Options:\n" \
@@ -1377,8 +1384,7 @@
USAGE_LS_SORTFILES("\t-X\tsort the listing by extension\n") \
USAGE_HUMAN_READABLE( \
"\t-h\tprint sizes in human readable format (e.g., 1K 243M 2G )\n" \
- "\t-k\tprint sizes in kilobytes(default)") USAGE_NOT_HUMAN_READABLE( \
- "\t-k\tprint sizes in kilobytes(compatibility)")
+ USAGE_SELINUX("\t-k\tprint security context\n\t-K\tprint security context in long format\n", "")
#define lsmod_trivial_usage \
""
@@ -1786,7 +1792,8 @@
""
#define ps_full_usage \
"Report process status\n" \
- "\nThis version of ps accepts no options."
+ USAGE_SELINUX("\nOptions:\n\t-c\tshow SE Linux context", "\nThis version of ps accepts no options.")
+
#define ps_example_usage \
"$ ps\n" \
" PID Uid Gid State Command\n" \