diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/applets.h | 2 | ||||
-rw-r--r-- | include/libbb.h | 8 | ||||
-rw-r--r-- | include/usage.h | 70 |
3 files changed, 72 insertions, 8 deletions
diff --git a/include/applets.h b/include/applets.h index 214e63aa2..3aaf011eb 100644 --- a/include/applets.h +++ b/include/applets.h | |||
@@ -69,6 +69,7 @@ USE_CAL(APPLET(cal, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) | |||
69 | USE_CAT(APPLET(cat, _BB_DIR_BIN, _BB_SUID_NEVER)) | 69 | USE_CAT(APPLET(cat, _BB_DIR_BIN, _BB_SUID_NEVER)) |
70 | USE_CATV(APPLET(catv, _BB_DIR_BIN, _BB_SUID_NEVER)) | 70 | USE_CATV(APPLET(catv, _BB_DIR_BIN, _BB_SUID_NEVER)) |
71 | USE_CHATTR(APPLET(chattr, _BB_DIR_BIN, _BB_SUID_NEVER)) | 71 | USE_CHATTR(APPLET(chattr, _BB_DIR_BIN, _BB_SUID_NEVER)) |
72 | USE_CHCON(APPLET(chcon, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) | ||
72 | USE_CHGRP(APPLET(chgrp, _BB_DIR_BIN, _BB_SUID_NEVER)) | 73 | USE_CHGRP(APPLET(chgrp, _BB_DIR_BIN, _BB_SUID_NEVER)) |
73 | USE_CHMOD(APPLET(chmod, _BB_DIR_BIN, _BB_SUID_NEVER)) | 74 | USE_CHMOD(APPLET(chmod, _BB_DIR_BIN, _BB_SUID_NEVER)) |
74 | USE_CHOWN(APPLET(chown, _BB_DIR_BIN, _BB_SUID_NEVER)) | 75 | USE_CHOWN(APPLET(chown, _BB_DIR_BIN, _BB_SUID_NEVER)) |
@@ -249,6 +250,7 @@ USE_ROUTE(APPLET(route, _BB_DIR_SBIN, _BB_SUID_NEVER)) | |||
249 | USE_RPM(APPLET(rpm, _BB_DIR_BIN, _BB_SUID_NEVER)) | 250 | USE_RPM(APPLET(rpm, _BB_DIR_BIN, _BB_SUID_NEVER)) |
250 | USE_RPM2CPIO(APPLET(rpm2cpio, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) | 251 | USE_RPM2CPIO(APPLET(rpm2cpio, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) |
251 | USE_RUN_PARTS(APPLET_ODDNAME(run-parts, run_parts, _BB_DIR_BIN, _BB_SUID_NEVER, run_parts)) | 252 | USE_RUN_PARTS(APPLET_ODDNAME(run-parts, run_parts, _BB_DIR_BIN, _BB_SUID_NEVER, run_parts)) |
253 | USE_RUNCON(APPLET(runcon, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) | ||
252 | USE_RUNLEVEL(APPLET(runlevel, _BB_DIR_SBIN, _BB_SUID_NEVER)) | 254 | USE_RUNLEVEL(APPLET(runlevel, _BB_DIR_SBIN, _BB_SUID_NEVER)) |
253 | USE_RUNSV(APPLET(runsv, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) | 255 | USE_RUNSV(APPLET(runsv, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) |
254 | USE_RUNSVDIR(APPLET(runsvdir, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) | 256 | USE_RUNSVDIR(APPLET(runsvdir, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) |
diff --git a/include/libbb.h b/include/libbb.h index 93edbdc3f..e07fa7587 100644 --- a/include/libbb.h +++ b/include/libbb.h | |||
@@ -742,7 +742,7 @@ void *md5_end(void *resbuf, md5_ctx_t *ctx); | |||
742 | uint32_t *crc32_filltable(int endian); | 742 | uint32_t *crc32_filltable(int endian); |
743 | 743 | ||
744 | 744 | ||
745 | enum { /* DO NOT CHANGE THESE VALUES! cp.c depends on them. */ | 745 | enum { /* DO NOT CHANGE THESE VALUES! cp.c, mv.c, install.c depend on them. */ |
746 | FILEUTILS_PRESERVE_STATUS = 1, | 746 | FILEUTILS_PRESERVE_STATUS = 1, |
747 | FILEUTILS_DEREFERENCE = 2, | 747 | FILEUTILS_DEREFERENCE = 2, |
748 | FILEUTILS_RECUR = 4, | 748 | FILEUTILS_RECUR = 4, |
@@ -750,9 +750,13 @@ enum { /* DO NOT CHANGE THESE VALUES! cp.c depends on them. */ | |||
750 | FILEUTILS_INTERACTIVE = 0x10, | 750 | FILEUTILS_INTERACTIVE = 0x10, |
751 | FILEUTILS_MAKE_HARDLINK = 0x20, | 751 | FILEUTILS_MAKE_HARDLINK = 0x20, |
752 | FILEUTILS_MAKE_SOFTLINK = 0x40, | 752 | FILEUTILS_MAKE_SOFTLINK = 0x40, |
753 | #if ENABLE_SELINUX | ||
754 | FILEUTILS_PRESERVE_SECURITY_CONTEXT = 0x80, | ||
755 | FILEUTILS_SET_SECURITY_CONTEXT = 0x100 | ||
756 | #endif | ||
753 | }; | 757 | }; |
754 | #define FILEUTILS_CP_OPTSTR "pdRfils" | ||
755 | 758 | ||
759 | #define FILEUTILS_CP_OPTSTR "pdRfils" USE_SELINUX("c") | ||
756 | extern const char *applet_name; | 760 | extern const char *applet_name; |
757 | extern const char BB_BANNER[]; | 761 | extern const char BB_BANNER[]; |
758 | 762 | ||
diff --git a/include/usage.h b/include/usage.h index 4d1ecb8f5..23703736f 100644 --- a/include/usage.h +++ b/include/usage.h | |||
@@ -198,6 +198,24 @@ | |||
198 | " -R Recursively list subdirectories\n" \ | 198 | " -R Recursively list subdirectories\n" \ |
199 | " -v Set the file's version/generation number" | 199 | " -v Set the file's version/generation number" |
200 | 200 | ||
201 | #define chcon_trivial_usage \ | ||
202 | "[OPTIONS] CONTEXT FILE...\n" \ | ||
203 | " chcon [OPTIONS] [-u USER] [-r ROLE] [-l RANGE] [-t TYPE] FILE...\n" \ | ||
204 | " chcon [OPTIONS] --reference=RFILE FILE...\n" | ||
205 | #define chcon_full_usage \ | ||
206 | "Change the security context of each FILE to CONTEXT\n\n" \ | ||
207 | " -c, --changes Like verbose but report only when a change is made\n" \ | ||
208 | " -h, --no-dereference Affect symbolic links instead of any referenced file\n" \ | ||
209 | " (available only on systems with lchown system call)\n" \ | ||
210 | " -f, --silent, --quiet Suppress most error messages\n" \ | ||
211 | " --reference=RFILE Use RFILE's group instead of using a CONTEXT value\n" \ | ||
212 | " -u, --user=USER Set user USER in the target security context\n" \ | ||
213 | " -r, --role=ROLE Set role ROLE in the target security context\n" \ | ||
214 | " -t, --type=TYPE Set type TYPE in the target security context\n" \ | ||
215 | " -l, --range=RANGE Set range RANGE in the target security context\n" \ | ||
216 | " -R, --recursive Recurse subdirs\n" \ | ||
217 | " -v, --verbose Verbose mode" \ | ||
218 | |||
201 | #define chgrp_trivial_usage \ | 219 | #define chgrp_trivial_usage \ |
202 | "[-Rh"USE_DESKTOP("cvf")"]... GROUP FILE..." | 220 | "[-Rh"USE_DESKTOP("cvf")"]... GROUP FILE..." |
203 | #define chgrp_full_usage \ | 221 | #define chgrp_full_usage \ |
@@ -404,6 +422,9 @@ | |||
404 | "Copy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY" \ | 422 | "Copy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY" \ |
405 | "\n\nOptions:\n" \ | 423 | "\n\nOptions:\n" \ |
406 | " -a Same as -dpR\n" \ | 424 | " -a Same as -dpR\n" \ |
425 | USE_SELINUX( \ | ||
426 | " -c Preserves security context\n" \ | ||
427 | ) \ | ||
407 | " -d,-P Preserve links\n" \ | 428 | " -d,-P Preserve links\n" \ |
408 | " -H,-L Dereference all symlinks (implied by default)\n" \ | 429 | " -H,-L Dereference all symlinks (implied by default)\n" \ |
409 | " -p Preserve file attributes if possible\n" \ | 430 | " -p Preserve file attributes if possible\n" \ |
@@ -1321,7 +1342,8 @@ | |||
1321 | "Print information for USERNAME or the current user" \ | 1342 | "Print information for USERNAME or the current user" \ |
1322 | "\n\nOptions:\n" \ | 1343 | "\n\nOptions:\n" \ |
1323 | USE_SELINUX( \ | 1344 | USE_SELINUX( \ |
1324 | " -c Prints only the security context\n") \ | 1345 | " -Z prints only the security context\n" \ |
1346 | ) \ | ||
1325 | " -g Prints only the group ID\n" \ | 1347 | " -g Prints only the group ID\n" \ |
1326 | " -u Prints only the user ID\n" \ | 1348 | " -u Prints only the user ID\n" \ |
1327 | " -n Print a name instead of a number\n" \ | 1349 | " -n Print a name instead of a number\n" \ |
@@ -1540,7 +1562,10 @@ | |||
1540 | " -m Set permission modes\n" \ | 1562 | " -m Set permission modes\n" \ |
1541 | " -o Set ownership\n" \ | 1563 | " -o Set ownership\n" \ |
1542 | " -p Preserve date\n" \ | 1564 | " -p Preserve date\n" \ |
1543 | " -s Strip symbol tables" | 1565 | " -s Strip symbol tables" \ |
1566 | USE_SELINUX( \ | ||
1567 | "\n -Z Set security context of copy" \ | ||
1568 | ) | ||
1544 | 1569 | ||
1545 | #define ip_trivial_usage \ | 1570 | #define ip_trivial_usage \ |
1546 | "[OPTIONS] {address | link | route | tunnel | rule} {COMMAND}" | 1571 | "[OPTIONS] {address | link | route | tunnel | rule} {COMMAND}" |
@@ -1850,7 +1875,9 @@ | |||
1850 | USE_SELINUX( \ | 1875 | USE_SELINUX( \ |
1851 | "\n -k Print security context") \ | 1876 | "\n -k Print security context") \ |
1852 | USE_SELINUX( \ | 1877 | USE_SELINUX( \ |
1853 | "\n -K Print security context in long format") | 1878 | "\n -K Print security context in long format") \ |
1879 | USE_SELINUX( \ | ||
1880 | "\n -Z Print security context and permission") | ||
1854 | 1881 | ||
1855 | #define lsattr_trivial_usage \ | 1882 | #define lsattr_trivial_usage \ |
1856 | "[-Radlv] [files...]" | 1883 | "[-Radlv] [files...]" |
@@ -1995,7 +2022,11 @@ | |||
1995 | "Create the DIRECTORY(ies) if they do not already exist" \ | 2022 | "Create the DIRECTORY(ies) if they do not already exist" \ |
1996 | "\n\nOptions:\n" \ | 2023 | "\n\nOptions:\n" \ |
1997 | " -m Set permission mode (as in chmod), not rwxrwxrwx - umask\n" \ | 2024 | " -m Set permission mode (as in chmod), not rwxrwxrwx - umask\n" \ |
1998 | " -p No error if existing, make parent directories as needed" | 2025 | " -p No error if existing, make parent directories as needed" \ |
2026 | USE_SELINUX( \ | ||
2027 | "\n -Z Set security context" \ | ||
2028 | ) | ||
2029 | |||
1999 | #define mkdir_example_usage \ | 2030 | #define mkdir_example_usage \ |
2000 | "$ mkdir /tmp/foo\n" \ | 2031 | "$ mkdir /tmp/foo\n" \ |
2001 | "$ mkdir /tmp/foo\n" \ | 2032 | "$ mkdir /tmp/foo\n" \ |
@@ -2040,7 +2071,10 @@ | |||
2040 | #define mkfifo_full_usage \ | 2071 | #define mkfifo_full_usage \ |
2041 | "Create a named pipe (identical to 'mknod name p')" \ | 2072 | "Create a named pipe (identical to 'mknod name p')" \ |
2042 | "\n\nOptions:\n" \ | 2073 | "\n\nOptions:\n" \ |
2043 | " -m Create the pipe using the specified mode (default a=rw)" | 2074 | " -m Create the pipe using the specified mode (default a=rw)" \ |
2075 | USE_SELINUX( \ | ||
2076 | "\n -Z Set security context" \ | ||
2077 | ) | ||
2044 | 2078 | ||
2045 | #define mkfs_minix_trivial_usage \ | 2079 | #define mkfs_minix_trivial_usage \ |
2046 | "[-c | -l filename] [-nXX] [-iXX] /dev/name [blocks]" | 2080 | "[-c | -l filename] [-nXX] [-iXX] /dev/name [blocks]" |
@@ -2062,7 +2096,11 @@ | |||
2062 | "\n\nTYPEs include:\n" \ | 2096 | "\n\nTYPEs include:\n" \ |
2063 | " b: Make a block (buffered) device\n" \ | 2097 | " b: Make a block (buffered) device\n" \ |
2064 | " c or u: Make a character (un-buffered) device\n" \ | 2098 | " c or u: Make a character (un-buffered) device\n" \ |
2065 | " p: Make a named pipe. MAJOR and MINOR are ignored for named pipes" | 2099 | " p: Make a named pipe. MAJOR and MINOR are ignored for named pipes" \ |
2100 | USE_SELINUX( \ | ||
2101 | "\n -Z Set security context" \ | ||
2102 | ) | ||
2103 | |||
2066 | #define mknod_example_usage \ | 2104 | #define mknod_example_usage \ |
2067 | "$ mknod /dev/fd0 b 2 0\n" \ | 2105 | "$ mknod /dev/fd0 b 2 0\n" \ |
2068 | "$ mknod -m 644 /tmp/pipe p\n" | 2106 | "$ mknod -m 644 /tmp/pipe p\n" |
@@ -2698,6 +2736,20 @@ | |||
2698 | #define rpm2cpio_full_usage \ | 2736 | #define rpm2cpio_full_usage \ |
2699 | "Output a cpio archive of the rpm file" | 2737 | "Output a cpio archive of the rpm file" |
2700 | 2738 | ||
2739 | #define runcon_trivial_usage \ | ||
2740 | "[-c] [-u USER] [-r ROLE] [-t TYPE] [-l RANGE] COMMAND [args]\n" \ | ||
2741 | " runcon CONTEXT COMMAND [args]" | ||
2742 | #define runcon_full_usage \ | ||
2743 | "runcon [-c] [-u USER] [-r ROLE] [-t TYPE] [-l RANGE] COMMAND [args]\n" \ | ||
2744 | "runcon CONTEXT COMMAND [args]\n" \ | ||
2745 | "Run a program in a different security context\n\n" \ | ||
2746 | " CONTEXT Complete security context\n" \ | ||
2747 | " -c, --compute Compute process transition context before modifying\n" \ | ||
2748 | " -t, --type=TYPE Type (for same role as parent)\n" \ | ||
2749 | " -u, --user=USER User identity\n" \ | ||
2750 | " -r, --role=ROLE Role\n" \ | ||
2751 | " -l, --range=RNG Levelrange" \ | ||
2752 | |||
2701 | #define run_parts_trivial_usage \ | 2753 | #define run_parts_trivial_usage \ |
2702 | "[-t] [-a ARG] [-u MASK] DIRECTORY" | 2754 | "[-t] [-a ARG] [-u MASK] DIRECTORY" |
2703 | #define run_parts_full_usage \ | 2755 | #define run_parts_full_usage \ |
@@ -2924,6 +2976,9 @@ | |||
2924 | " -f Display filesystem status\n" \ | 2976 | " -f Display filesystem status\n" \ |
2925 | " -L,-l Dereference links\n" \ | 2977 | " -L,-l Dereference links\n" \ |
2926 | " -t Display info in terse form" \ | 2978 | " -t Display info in terse form" \ |
2979 | USE_SELINUX( \ | ||
2980 | "\n -Z Print security context" \ | ||
2981 | ) \ | ||
2927 | USE_FEATURE_STAT_FORMAT( \ | 2982 | USE_FEATURE_STAT_FORMAT( \ |
2928 | "\n\nValid format sequences for files:\n" \ | 2983 | "\n\nValid format sequences for files:\n" \ |
2929 | " %a Access rights in octal\n" \ | 2984 | " %a Access rights in octal\n" \ |
@@ -2958,6 +3013,9 @@ | |||
2958 | " %c Total file nodes in file system\n" \ | 3013 | " %c Total file nodes in file system\n" \ |
2959 | " %d Free file nodes in file system\n" \ | 3014 | " %d Free file nodes in file system\n" \ |
2960 | " %f Free blocks in file system\n" \ | 3015 | " %f Free blocks in file system\n" \ |
3016 | USE_SELINUX( \ | ||
3017 | " %C Security context in SELinux\n" \ | ||
3018 | ) \ | ||
2961 | " %i File System ID in hex\n" \ | 3019 | " %i File System ID in hex\n" \ |
2962 | " %l Maximum length of filenames\n" \ | 3020 | " %l Maximum length of filenames\n" \ |
2963 | " %n File name\n" \ | 3021 | " %n File name\n" \ |