diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/.gitignore | 4 | ||||
-rw-r--r-- | include/archive.h | 51 | ||||
-rw-r--r-- | include/libbb.h | 15 | ||||
-rw-r--r-- | include/unicode.h | 4 | ||||
-rw-r--r-- | include/usage.src.h | 58 |
5 files changed, 47 insertions, 85 deletions
diff --git a/include/.gitignore b/include/.gitignore index f0ce546cf..9d9b6c499 100644 --- a/include/.gitignore +++ b/include/.gitignore | |||
@@ -1,6 +1,10 @@ | |||
1 | /config | 1 | /config |
2 | 2 | ||
3 | /applets.h | ||
3 | /applet_tables.h | 4 | /applet_tables.h |
4 | /autoconf.h | 5 | /autoconf.h |
6 | /bbconfigopts_bz2.h | ||
5 | /bbconfigopts.h | 7 | /bbconfigopts.h |
8 | /NUM_APPLETS.h | ||
6 | /usage_compressed.h | 9 | /usage_compressed.h |
10 | /usage.h | ||
diff --git a/include/archive.h b/include/archive.h index 49c478728..b139dc5be 100644 --- a/include/archive.h +++ b/include/archive.h | |||
@@ -84,6 +84,7 @@ typedef struct archive_handle_t { | |||
84 | # endif | 84 | # endif |
85 | #if ENABLE_FEATURE_TAR_TO_COMMAND | 85 | #if ENABLE_FEATURE_TAR_TO_COMMAND |
86 | char* tar__to_command; | 86 | char* tar__to_command; |
87 | const char* tar__to_command_shell; | ||
87 | #endif | 88 | #endif |
88 | # if ENABLE_FEATURE_TAR_SELINUX | 89 | # if ENABLE_FEATURE_TAR_SELINUX |
89 | char* tar__global_sctx; | 90 | char* tar__global_sctx; |
@@ -159,37 +160,39 @@ typedef struct unpack_info_t { | |||
159 | time_t mtime; | 160 | time_t mtime; |
160 | } unpack_info_t; | 161 | } unpack_info_t; |
161 | 162 | ||
162 | extern archive_handle_t *init_handle(void) FAST_FUNC; | 163 | archive_handle_t *init_handle(void) FAST_FUNC; |
163 | 164 | ||
164 | extern char filter_accept_all(archive_handle_t *archive_handle) FAST_FUNC; | 165 | char filter_accept_all(archive_handle_t *archive_handle) FAST_FUNC; |
165 | extern char filter_accept_list(archive_handle_t *archive_handle) FAST_FUNC; | 166 | char filter_accept_list(archive_handle_t *archive_handle) FAST_FUNC; |
166 | extern char filter_accept_list_reassign(archive_handle_t *archive_handle) FAST_FUNC; | 167 | char filter_accept_list_reassign(archive_handle_t *archive_handle) FAST_FUNC; |
167 | extern char filter_accept_reject_list(archive_handle_t *archive_handle) FAST_FUNC; | 168 | char filter_accept_reject_list(archive_handle_t *archive_handle) FAST_FUNC; |
168 | 169 | ||
169 | extern void unpack_ar_archive(archive_handle_t *ar_archive) FAST_FUNC; | 170 | void unpack_ar_archive(archive_handle_t *ar_archive) FAST_FUNC; |
170 | 171 | ||
171 | extern void data_skip(archive_handle_t *archive_handle) FAST_FUNC; | 172 | void data_skip(archive_handle_t *archive_handle) FAST_FUNC; |
172 | extern void data_extract_all(archive_handle_t *archive_handle) FAST_FUNC; | 173 | void data_extract_all(archive_handle_t *archive_handle) FAST_FUNC; |
173 | extern void data_extract_to_stdout(archive_handle_t *archive_handle) FAST_FUNC; | 174 | void data_extract_to_stdout(archive_handle_t *archive_handle) FAST_FUNC; |
174 | extern void data_extract_to_command(archive_handle_t *archive_handle) FAST_FUNC; | 175 | void data_extract_to_command(archive_handle_t *archive_handle) FAST_FUNC; |
175 | 176 | ||
176 | extern void header_skip(const file_header_t *file_header) FAST_FUNC; | 177 | void header_skip(const file_header_t *file_header) FAST_FUNC; |
177 | extern void header_list(const file_header_t *file_header) FAST_FUNC; | 178 | void header_list(const file_header_t *file_header) FAST_FUNC; |
178 | extern void header_verbose_list(const file_header_t *file_header) FAST_FUNC; | 179 | void header_verbose_list(const file_header_t *file_header) FAST_FUNC; |
179 | 180 | ||
180 | extern char get_header_ar(archive_handle_t *archive_handle) FAST_FUNC; | 181 | char get_header_ar(archive_handle_t *archive_handle) FAST_FUNC; |
181 | extern char get_header_cpio(archive_handle_t *archive_handle) FAST_FUNC; | 182 | char get_header_cpio(archive_handle_t *archive_handle) FAST_FUNC; |
182 | extern char get_header_tar(archive_handle_t *archive_handle) FAST_FUNC; | 183 | char get_header_tar(archive_handle_t *archive_handle) FAST_FUNC; |
183 | extern char get_header_tar_gz(archive_handle_t *archive_handle) FAST_FUNC; | 184 | char get_header_tar_gz(archive_handle_t *archive_handle) FAST_FUNC; |
184 | extern char get_header_tar_bz2(archive_handle_t *archive_handle) FAST_FUNC; | 185 | char get_header_tar_bz2(archive_handle_t *archive_handle) FAST_FUNC; |
185 | extern char get_header_tar_lzma(archive_handle_t *archive_handle) FAST_FUNC; | 186 | char get_header_tar_lzma(archive_handle_t *archive_handle) FAST_FUNC; |
186 | 187 | ||
187 | extern void seek_by_jump(int fd, off_t amount) FAST_FUNC; | 188 | void seek_by_jump(int fd, off_t amount) FAST_FUNC; |
188 | extern void seek_by_read(int fd, off_t amount) FAST_FUNC; | 189 | void seek_by_read(int fd, off_t amount) FAST_FUNC; |
189 | 190 | ||
190 | extern void data_align(archive_handle_t *archive_handle, unsigned boundary) FAST_FUNC; | 191 | const char *strip_unsafe_prefix(const char *str) FAST_FUNC; |
191 | extern const llist_t *find_list_entry(const llist_t *list, const char *filename) FAST_FUNC; | 192 | |
192 | extern const llist_t *find_list_entry2(const llist_t *list, const char *filename) FAST_FUNC; | 193 | void data_align(archive_handle_t *archive_handle, unsigned boundary) FAST_FUNC; |
194 | const llist_t *find_list_entry(const llist_t *list, const char *filename) FAST_FUNC; | ||
195 | const llist_t *find_list_entry2(const llist_t *list, const char *filename) FAST_FUNC; | ||
193 | 196 | ||
194 | /* A bit of bunzip2 internals are exposed for compressed help support: */ | 197 | /* A bit of bunzip2 internals are exposed for compressed help support: */ |
195 | typedef struct bunzip_data bunzip_data; | 198 | typedef struct bunzip_data bunzip_data; |
diff --git a/include/libbb.h b/include/libbb.h index 6564038e9..0006e7e55 100644 --- a/include/libbb.h +++ b/include/libbb.h | |||
@@ -855,14 +855,14 @@ char* xuid2uname(uid_t uid) FAST_FUNC; | |||
855 | char* xgid2group(gid_t gid) FAST_FUNC; | 855 | char* xgid2group(gid_t gid) FAST_FUNC; |
856 | char* uid2uname(uid_t uid) FAST_FUNC; | 856 | char* uid2uname(uid_t uid) FAST_FUNC; |
857 | char* gid2group(gid_t gid) FAST_FUNC; | 857 | char* gid2group(gid_t gid) FAST_FUNC; |
858 | char* uid2uname_utoa(long uid) FAST_FUNC; | 858 | char* uid2uname_utoa(uid_t uid) FAST_FUNC; |
859 | char* gid2group_utoa(long gid) FAST_FUNC; | 859 | char* gid2group_utoa(gid_t gid) FAST_FUNC; |
860 | /* versions which cache results (useful for ps, ls etc) */ | 860 | /* versions which cache results (useful for ps, ls etc) */ |
861 | const char* get_cached_username(uid_t uid) FAST_FUNC; | 861 | const char* get_cached_username(uid_t uid) FAST_FUNC; |
862 | const char* get_cached_groupname(gid_t gid) FAST_FUNC; | 862 | const char* get_cached_groupname(gid_t gid) FAST_FUNC; |
863 | void clear_username_cache(void) FAST_FUNC; | 863 | void clear_username_cache(void) FAST_FUNC; |
864 | /* internally usernames are saved in fixed-sized char[] buffers */ | 864 | /* internally usernames are saved in fixed-sized char[] buffers */ |
865 | enum { USERNAME_MAX_SIZE = 16 - sizeof(int) }; | 865 | enum { USERNAME_MAX_SIZE = 32 - sizeof(uid_t) }; |
866 | #if ENABLE_FEATURE_CHECK_NAMES | 866 | #if ENABLE_FEATURE_CHECK_NAMES |
867 | void die_if_bad_username(const char* name) FAST_FUNC; | 867 | void die_if_bad_username(const char* name) FAST_FUNC; |
868 | #else | 868 | #else |
@@ -1214,10 +1214,17 @@ char *bb_simplify_path(const char *path) FAST_FUNC; | |||
1214 | /* Returns ptr to NUL */ | 1214 | /* Returns ptr to NUL */ |
1215 | char *bb_simplify_abs_path_inplace(char *path) FAST_FUNC; | 1215 | char *bb_simplify_abs_path_inplace(char *path) FAST_FUNC; |
1216 | 1216 | ||
1217 | #define FAIL_DELAY 3 | 1217 | #define LOGIN_FAIL_DELAY 3 |
1218 | extern void bb_do_delay(int seconds) FAST_FUNC; | 1218 | extern void bb_do_delay(int seconds) FAST_FUNC; |
1219 | extern void change_identity(const struct passwd *pw) FAST_FUNC; | 1219 | extern void change_identity(const struct passwd *pw) FAST_FUNC; |
1220 | extern void run_shell(const char *shell, int loginshell, const char *command, const char **additional_args) NORETURN FAST_FUNC; | 1220 | extern void run_shell(const char *shell, int loginshell, const char *command, const char **additional_args) NORETURN FAST_FUNC; |
1221 | |||
1222 | /* Returns $SHELL, getpwuid(getuid())->pw_shell, or DEFAULT_SHELL. | ||
1223 | * Note that getpwuid result might need xstrdup'ing | ||
1224 | * if there is a possibility of intervening getpwxxx() calls. | ||
1225 | */ | ||
1226 | const char *get_shell_name(void); | ||
1227 | |||
1221 | #if ENABLE_SELINUX | 1228 | #if ENABLE_SELINUX |
1222 | extern void renew_current_security_context(void) FAST_FUNC; | 1229 | extern void renew_current_security_context(void) FAST_FUNC; |
1223 | extern void set_current_security_context(security_context_t sid) FAST_FUNC; | 1230 | extern void set_current_security_context(security_context_t sid) FAST_FUNC; |
diff --git a/include/unicode.h b/include/unicode.h index dee02e777..0317a2151 100644 --- a/include/unicode.h +++ b/include/unicode.h | |||
@@ -27,6 +27,7 @@ enum { | |||
27 | # define unicode_strwidth(string) strlen(string) | 27 | # define unicode_strwidth(string) strlen(string) |
28 | # define unicode_status UNICODE_OFF | 28 | # define unicode_status UNICODE_OFF |
29 | # define init_unicode() ((void)0) | 29 | # define init_unicode() ((void)0) |
30 | # define reinit_unicode(LANG) ((void)0) | ||
30 | 31 | ||
31 | #else | 32 | #else |
32 | 33 | ||
@@ -67,6 +68,7 @@ char* FAST_FUNC unicode_conv_to_printable_fixedwidth(/*uni_stat_t *stats,*/ cons | |||
67 | 68 | ||
68 | extern uint8_t unicode_status; | 69 | extern uint8_t unicode_status; |
69 | void init_unicode(void) FAST_FUNC; | 70 | void init_unicode(void) FAST_FUNC; |
71 | void reinit_unicode(const char *LANG) FAST_FUNC; | ||
70 | 72 | ||
71 | # else | 73 | # else |
72 | 74 | ||
@@ -75,9 +77,11 @@ void init_unicode(void) FAST_FUNC; | |||
75 | # if !ENABLE_FEATURE_CHECK_UNICODE_IN_ENV | 77 | # if !ENABLE_FEATURE_CHECK_UNICODE_IN_ENV |
76 | # define unicode_status UNICODE_ON | 78 | # define unicode_status UNICODE_ON |
77 | # define init_unicode() ((void)0) | 79 | # define init_unicode() ((void)0) |
80 | # define reinit_unicode(LANG) ((void)0) | ||
78 | # else | 81 | # else |
79 | extern uint8_t unicode_status; | 82 | extern uint8_t unicode_status; |
80 | void init_unicode(void) FAST_FUNC; | 83 | void init_unicode(void) FAST_FUNC; |
84 | void reinit_unicode(const char *LANG) FAST_FUNC; | ||
81 | # endif | 85 | # endif |
82 | 86 | ||
83 | # undef MB_CUR_MAX | 87 | # undef MB_CUR_MAX |
diff --git a/include/usage.src.h b/include/usage.src.h index c2575b561..d07b408a6 100644 --- a/include/usage.src.h +++ b/include/usage.src.h | |||
@@ -1273,23 +1273,6 @@ INSERT | |||
1273 | "\n -m Show \"mode not cleared\" warnings" \ | 1273 | "\n -m Show \"mode not cleared\" warnings" \ |
1274 | "\n -f Force file system check" \ | 1274 | "\n -f Force file system check" \ |
1275 | 1275 | ||
1276 | #define ftpd_trivial_usage \ | ||
1277 | "[-wvS] [-t N] [-T N] [DIR]" | ||
1278 | #define ftpd_full_usage "\n\n" \ | ||
1279 | "Anonymous FTP server\n" \ | ||
1280 | "\n" \ | ||
1281 | "ftpd should be used as an inetd service.\n" \ | ||
1282 | "ftpd's line for inetd.conf:\n" \ | ||
1283 | " 21 stream tcp nowait root ftpd ftpd /files/to/serve\n" \ | ||
1284 | "It also can be ran from tcpsvd:\n" \ | ||
1285 | " tcpsvd -vE 0.0.0.0 21 ftpd /files/to/serve\n" \ | ||
1286 | "\nOptions:" \ | ||
1287 | "\n -w Allow upload" \ | ||
1288 | "\n -v Log to stderr" \ | ||
1289 | "\n -S Log to syslog" \ | ||
1290 | "\n -t,-T Idle and absolute timeouts" \ | ||
1291 | "\n DIR Change root to this directory" \ | ||
1292 | |||
1293 | #define ftpget_trivial_usage \ | 1276 | #define ftpget_trivial_usage \ |
1294 | "[OPTIONS] HOST [LOCAL_FILE] REMOTE_FILE" | 1277 | "[OPTIONS] HOST [LOCAL_FILE] REMOTE_FILE" |
1295 | #define ftpget_full_usage "\n\n" \ | 1278 | #define ftpget_full_usage "\n\n" \ |
@@ -2499,7 +2482,7 @@ INSERT | |||
2499 | "\n [r]slave Convert [recursively] to a slave subtree" \ | 2482 | "\n [r]slave Convert [recursively] to a slave subtree" \ |
2500 | "\n [r]private Convert [recursively] to a private subtree" \ | 2483 | "\n [r]private Convert [recursively] to a private subtree" \ |
2501 | "\n [un]bindable Make mount point [un]able to be bind mounted" \ | 2484 | "\n [un]bindable Make mount point [un]able to be bind mounted" \ |
2502 | "\n bind Bind a file or directory to another location" \ | 2485 | "\n [r]bind Bind a file or directory [recursively] to another location" \ |
2503 | "\n move Relocate an existing mount point" \ | 2486 | "\n move Relocate an existing mount point" \ |
2504 | ) \ | 2487 | ) \ |
2505 | "\n remount Remount a mounted filesystem, changing flags" \ | 2488 | "\n remount Remount a mounted filesystem, changing flags" \ |
@@ -2546,20 +2529,6 @@ INSERT | |||
2546 | "ras3 reset retension rewind rewoffline seek setblk setdensity\n" \ | 2529 | "ras3 reset retension rewind rewoffline seek setblk setdensity\n" \ |
2547 | "setpart tell unload unlock weof wset" \ | 2530 | "setpart tell unload unlock weof wset" \ |
2548 | 2531 | ||
2549 | #define nameif_trivial_usage \ | ||
2550 | "[-s] [-c FILE] [{IFNAME MACADDR}]" | ||
2551 | #define nameif_full_usage "\n\n" \ | ||
2552 | "Rename network interface while it in the down state\n" \ | ||
2553 | "\nOptions:" \ | ||
2554 | "\n -c FILE Use configuration file (default: /etc/mactab)" \ | ||
2555 | "\n -s Use syslog (LOCAL0 facility)" \ | ||
2556 | "\n IFNAME MACADDR new_interface_name interface_mac_address" \ | ||
2557 | |||
2558 | #define nameif_example_usage \ | ||
2559 | "$ nameif -s dmz0 00:A0:C9:8C:F6:3F\n" \ | ||
2560 | " or\n" \ | ||
2561 | "$ nameif -c /etc/my_mactab_file\n" \ | ||
2562 | |||
2563 | #define nohup_trivial_usage \ | 2532 | #define nohup_trivial_usage \ |
2564 | "PROG ARGS" | 2533 | "PROG ARGS" |
2565 | #define nohup_full_usage "\n\n" \ | 2534 | #define nohup_full_usage "\n\n" \ |
@@ -4098,31 +4067,6 @@ INSERT | |||
4098 | "\n" \ | 4067 | "\n" \ |
4099 | "\nUse 500ms to specify period in milliseconds" \ | 4068 | "\nUse 500ms to specify period in milliseconds" \ |
4100 | 4069 | ||
4101 | #define wget_trivial_usage \ | ||
4102 | IF_FEATURE_WGET_LONG_OPTIONS( \ | ||
4103 | "[-c|--continue] [-s|--spider] [-q|--quiet] [-O|--output-document FILE]\n" \ | ||
4104 | " [--header 'header: value'] [-Y|--proxy on/off] [-P DIR]\n" \ | ||
4105 | " [--no-check-certificate] [-U|--user-agent AGENT]" \ | ||
4106 | IF_FEATURE_WGET_TIMEOUT("[-T SEC] ") " URL" \ | ||
4107 | ) \ | ||
4108 | IF_NOT_FEATURE_WGET_LONG_OPTIONS( \ | ||
4109 | "[-csq] [-O FILE] [-Y on/off] [-P DIR] [-U AGENT]" \ | ||
4110 | IF_FEATURE_WGET_TIMEOUT("[-T SEC] ") " URL" \ | ||
4111 | ) | ||
4112 | #define wget_full_usage "\n\n" \ | ||
4113 | "Retrieve files via HTTP or FTP\n" \ | ||
4114 | "\nOptions:" \ | ||
4115 | "\n -s Spider mode - only check file existence" \ | ||
4116 | "\n -c Continue retrieval of aborted transfer" \ | ||
4117 | "\n -q Quiet" \ | ||
4118 | "\n -P DIR Save to DIR (default .)" \ | ||
4119 | IF_FEATURE_WGET_TIMEOUT( \ | ||
4120 | "\n -T SEC Network read timeout is SEC seconds" \ | ||
4121 | ) \ | ||
4122 | "\n -O FILE Save to FILE ('-' for stdout)" \ | ||
4123 | "\n -U STR Use STR for User-Agent header" \ | ||
4124 | "\n -Y Use proxy ('on' or 'off')" \ | ||
4125 | |||
4126 | #define which_trivial_usage \ | 4070 | #define which_trivial_usage \ |
4127 | "[COMMAND]..." | 4071 | "[COMMAND]..." |
4128 | #define which_full_usage "\n\n" \ | 4072 | #define which_full_usage "\n\n" \ |