diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/libbb.h | 15 | ||||
-rw-r--r-- | include/usage.h | 15 |
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 @@ | |||
39 | #include <features.h> | 39 | #include <features.h> |
40 | 40 | ||
41 | #include "config.h" | 41 | #include "config.h" |
42 | #ifdef CONFIG_SELINUX | ||
43 | #include <proc_secure.h> | ||
44 | #endif | ||
42 | 45 | ||
43 | #include "pwd_.h" | 46 | #include "pwd_.h" |
44 | #include "grp_.h" | 47 | #include "grp_.h" |
@@ -394,7 +397,11 @@ void bb_xasprintf(char **string_ptr, const char *format, ...) __attribute__ ((fo | |||
394 | 397 | ||
395 | #define FAIL_DELAY 3 | 398 | #define FAIL_DELAY 3 |
396 | extern void change_identity ( const struct passwd *pw ); | 399 | extern void change_identity ( const struct passwd *pw ); |
397 | extern void run_shell ( const char *shell, int loginshell, const char *command, const char **additional_args ); | 400 | extern void run_shell ( const char *shell, int loginshell, const char *command, const char **additional_args |
401 | #ifdef CONFIG_SELINUX | ||
402 | , security_id_t sid | ||
403 | #endif | ||
404 | ); | ||
398 | extern int run_parts(char **args, const unsigned char test_mode); | 405 | extern int run_parts(char **args, const unsigned char test_mode); |
399 | extern int restricted_shell ( const char *shell ); | 406 | extern int restricted_shell ( const char *shell ); |
400 | extern void setup_environment ( const char *shell, int loginshell, int changeenv, const struct passwd *pw ); | 407 | extern void setup_environment ( const char *shell, int loginshell, int changeenv, const struct passwd *pw ); |
@@ -425,7 +432,11 @@ typedef struct { | |||
425 | char short_cmd[16]; | 432 | char short_cmd[16]; |
426 | } procps_status_t; | 433 | } procps_status_t; |
427 | 434 | ||
428 | extern procps_status_t * procps_scan(int save_user_arg0); | 435 | extern procps_status_t * procps_scan(int save_user_arg0 |
436 | #ifdef CONFIG_SELINUX | ||
437 | , int use_selinux, security_id_t *sid | ||
438 | #endif | ||
439 | ); | ||
429 | extern unsigned short compare_string_array(const char *string_array[], const char *key); | 440 | extern unsigned short compare_string_array(const char *string_array[], const char *key); |
430 | 441 | ||
431 | extern int my_query_module(const char *name, int which, void **buf, size_t *bufsize, size_t *ret); | 442 | 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 @@ | |||
882 | "\t-u\tthe hardware clock is kept in coordinated universal time\n" \ | 882 | "\t-u\tthe hardware clock is kept in coordinated universal time\n" \ |
883 | "\t-l\tthe hardware clock is kept in local time" | 883 | "\t-l\tthe hardware clock is kept in local time" |
884 | 884 | ||
885 | #ifdef CONFIG_SELINUX | ||
886 | #define USAGE_SELINUX(a, b) a | ||
887 | #else | ||
888 | #define USAGE_SELINUX(a, b) b | ||
889 | #endif | ||
890 | |||
885 | #define id_trivial_usage \ | 891 | #define id_trivial_usage \ |
886 | "[OPTIONS]... [USERNAME]" | 892 | "[OPTIONS]... [USERNAME]" |
887 | #define id_full_usage \ | 893 | #define id_full_usage \ |
@@ -889,6 +895,7 @@ | |||
889 | "Options:\n" \ | 895 | "Options:\n" \ |
890 | "\t-g\tprints only the group ID\n" \ | 896 | "\t-g\tprints only the group ID\n" \ |
891 | "\t-u\tprints only the user ID\n" \ | 897 | "\t-u\tprints only the user ID\n" \ |
898 | USAGE_SELINUX("\t-c\tprints only the security context\n", "") \ | ||
892 | "\t-n\tprint a name instead of a number (with for -ug)\n" \ | 899 | "\t-n\tprint a name instead of a number (with for -ug)\n" \ |
893 | "\t-r\tprints the real user ID instead of the effective ID (with -ug)" | 900 | "\t-r\tprints the real user ID instead of the effective ID (with -ug)" |
894 | #define id_example_usage \ | 901 | #define id_example_usage \ |
@@ -1347,7 +1354,7 @@ | |||
1347 | #define USAGE_AUTOWIDTH(a) | 1354 | #define USAGE_AUTOWIDTH(a) |
1348 | #endif | 1355 | #endif |
1349 | #define ls_trivial_usage \ | 1356 | #define ls_trivial_usage \ |
1350 | "[-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...]" | 1357 | "[-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...]" |
1351 | #define ls_full_usage \ | 1358 | #define ls_full_usage \ |
1352 | "List directory contents\n\n" \ | 1359 | "List directory contents\n\n" \ |
1353 | "Options:\n" \ | 1360 | "Options:\n" \ |
@@ -1377,8 +1384,7 @@ | |||
1377 | USAGE_LS_SORTFILES("\t-X\tsort the listing by extension\n") \ | 1384 | USAGE_LS_SORTFILES("\t-X\tsort the listing by extension\n") \ |
1378 | USAGE_HUMAN_READABLE( \ | 1385 | USAGE_HUMAN_READABLE( \ |
1379 | "\t-h\tprint sizes in human readable format (e.g., 1K 243M 2G )\n" \ | 1386 | "\t-h\tprint sizes in human readable format (e.g., 1K 243M 2G )\n" \ |
1380 | "\t-k\tprint sizes in kilobytes(default)") USAGE_NOT_HUMAN_READABLE( \ | 1387 | USAGE_SELINUX("\t-k\tprint security context\n\t-K\tprint security context in long format\n", "") |
1381 | "\t-k\tprint sizes in kilobytes(compatibility)") | ||
1382 | 1388 | ||
1383 | #define lsmod_trivial_usage \ | 1389 | #define lsmod_trivial_usage \ |
1384 | "" | 1390 | "" |
@@ -1786,7 +1792,8 @@ | |||
1786 | "" | 1792 | "" |
1787 | #define ps_full_usage \ | 1793 | #define ps_full_usage \ |
1788 | "Report process status\n" \ | 1794 | "Report process status\n" \ |
1789 | "\nThis version of ps accepts no options." | 1795 | USAGE_SELINUX("\nOptions:\n\t-c\tshow SE Linux context", "\nThis version of ps accepts no options.") |
1796 | |||
1790 | #define ps_example_usage \ | 1797 | #define ps_example_usage \ |
1791 | "$ ps\n" \ | 1798 | "$ ps\n" \ |
1792 | " PID Uid Gid State Command\n" \ | 1799 | " PID Uid Gid State Command\n" \ |