Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
81e26c4b8e | ||
|
|
0b16a67959 | ||
|
|
4989d05174 | ||
|
|
21e5d0f841 | ||
|
|
cf792a58ab | ||
|
|
0a53eadea5 | ||
|
|
25f07f5898 | ||
|
|
6bb89e1622 | ||
|
|
310bcec4dc | ||
|
|
8fd69c7bdb | ||
|
|
56a361bec1 | ||
|
|
6f13dd1d65 | ||
|
|
3df48bdde9 | ||
|
|
1f684bcde4 | ||
|
|
2cb72bb8de | ||
|
|
87d8ae94a2 | ||
|
|
a3de7190a5 | ||
|
|
f807b8e96e | ||
|
|
2f6dc07d8f | ||
|
|
54916641be | ||
|
|
80cb8796f8 | ||
|
|
ee67c9a60a | ||
|
|
8965e5089e | ||
|
|
e916d48e5a | ||
|
|
442d522f0b |
No files matched your search
@@ -33,6 +33,19 @@ config EXTRA_COMPAT
|
||||
some GNU extensions in libc. You probably only need this option
|
||||
if you plan to run busybox on desktop.
|
||||
|
||||
config FEDORA_COMPAT
|
||||
bool "Building for Fedora distribution"
|
||||
default n
|
||||
help
|
||||
This option makes some tools behave like they do on Fedora.
|
||||
|
||||
At the time of this writing (2017-08) this only affects uname:
|
||||
normally, uname -p (processor) and uname -i (platform)
|
||||
are shown as "unknown", but with this option uname -p
|
||||
shows the same string as uname -m (machine type),
|
||||
and so does uname -i unless machine type is i486/i586/i686 -
|
||||
then uname -i shows "i386".
|
||||
|
||||
config INCLUDE_SUSv2
|
||||
bool "Enable obsolete features removed before SUSv3"
|
||||
default y
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
VERSION = 1
|
||||
PATCHLEVEL = 27
|
||||
SUBLEVEL = 0
|
||||
SUBLEVEL = 2
|
||||
EXTRAVERSION =
|
||||
NAME = Unnamed
|
||||
|
||||
|
||||
+8
-3
@@ -7,14 +7,19 @@
|
||||
#include "libbb.h"
|
||||
#include "bb_archive.h"
|
||||
|
||||
//kbuild:lib-$(CONFIG_ZCAT) += bbunzip.o
|
||||
//kbuild:lib-$(CONFIG_GUNZIP) += bbunzip.o
|
||||
//kbuild:lib-$(CONFIG_BZCAT) += bbunzip.o
|
||||
//kbuild:lib-$(CONFIG_BUNZIP2) += bbunzip.o
|
||||
|
||||
/* lzop_main() uses bbunpack(), need this: */
|
||||
//kbuild:lib-$(CONFIG_LZOP) += bbunzip.o
|
||||
//kbuild:lib-$(CONFIG_LZOPCAT) += bbunzip.o
|
||||
//kbuild:lib-$(CONFIG_UNLZOP) += bbunzip.o
|
||||
/* bzip2_main() too: */
|
||||
//kbuild:lib-$(CONFIG_FEATURE_BZIP2_DECOMPRESS) += bbunzip.o
|
||||
//kbuild:lib-$(CONFIG_BZIP2) += bbunzip.o
|
||||
/* gzip_main() too: */
|
||||
//kbuild:lib-$(CONFIG_FEATURE_GZIP_DECOMPRESS) += bbunzip.o
|
||||
//kbuild:lib-$(CONFIG_GZIP) += bbunzip.o
|
||||
|
||||
/* Note: must be kept in sync with archival/lzop.c */
|
||||
enum {
|
||||
@@ -443,7 +448,7 @@ int gunzip_main(int argc UNUSED_PARAM, char **argv)
|
||||
//applet:IF_BUNZIP2(APPLET(bunzip2, BB_DIR_USR_BIN, BB_SUID_DROP))
|
||||
// APPLET_ODDNAME:name main location suid_type help
|
||||
//applet:IF_BZCAT(APPLET_ODDNAME(bzcat, bunzip2, BB_DIR_USR_BIN, BB_SUID_DROP, bzcat))
|
||||
#if ENABLE_FEATURE_BZIP2_DECOMPRESS
|
||||
#if ENABLE_FEATURE_BZIP2_DECOMPRESS || ENABLE_BUNZIP2 || ENABLE_BZCAT
|
||||
int bunzip2_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int bunzip2_main(int argc UNUSED_PARAM, char **argv)
|
||||
{
|
||||
|
||||
@@ -1938,10 +1938,6 @@ int dpkg_main(int argc UNUSED_PARAM, char **argv)
|
||||
for (i = 0; i < STATUS_HASH_PRIME; i++) {
|
||||
free(status_hashtable[i]);
|
||||
}
|
||||
|
||||
free(status_hashtable);
|
||||
free(package_hashtable);
|
||||
free(name_hashtable);
|
||||
}
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
|
||||
@@ -113,6 +113,7 @@ typedef union {
|
||||
|
||||
#define FIX_ENDIANNESS_ZIP(zip) \
|
||||
do { if (BB_BIG_ENDIAN) { \
|
||||
(zip).fmt.method = SWAP_LE16((zip).fmt.method ); \
|
||||
(zip).fmt.crc32 = SWAP_LE32((zip).fmt.crc32 ); \
|
||||
(zip).fmt.cmpsize = SWAP_LE32((zip).fmt.cmpsize ); \
|
||||
(zip).fmt.ucmpsize = SWAP_LE32((zip).fmt.ucmpsize ); \
|
||||
|
||||
+3
-4
@@ -133,9 +133,8 @@ enum {
|
||||
/* end of input flags */
|
||||
FLAG_TWOBUFS = (1 << 6) * ENABLE_FEATURE_DD_IBS_OBS,
|
||||
FLAG_COUNT = 1 << 7,
|
||||
FLAG_STATUS = 1 << 8,
|
||||
FLAG_STATUS_NONE = 1 << 9,
|
||||
FLAG_STATUS_NOXFER = 1 << 10,
|
||||
FLAG_STATUS_NONE = 1 << 8,
|
||||
FLAG_STATUS_NOXFER = 1 << 9,
|
||||
};
|
||||
|
||||
static void dd_output_status(int UNUSED_PARAM cur_signal)
|
||||
@@ -396,7 +395,7 @@ int dd_main(int argc UNUSED_PARAM, char **argv)
|
||||
n = index_in_strings(status_words, val);
|
||||
if (n < 0)
|
||||
bb_error_msg_and_die(bb_msg_invalid_arg_to, val, "status");
|
||||
G.flags |= FLAG_STATUS << n;
|
||||
G.flags |= FLAG_STATUS_NONE << n;
|
||||
/*continue;*/
|
||||
}
|
||||
#endif
|
||||
|
||||
+3
-2
@@ -16,7 +16,8 @@
|
||||
//config: help
|
||||
//config: rm is used to remove files or directories.
|
||||
|
||||
//applet:IF_RM(APPLET_NOFORK(rm, rm, BB_DIR_BIN, BB_SUID_DROP, rm))
|
||||
//applet:IF_RM(APPLET_NOEXEC(rm, rm, BB_DIR_BIN, BB_SUID_DROP, rm))
|
||||
/* was NOFORK, but then "rm -i FILE" can't be ^C'ed if run by hush */
|
||||
|
||||
//kbuild:lib-$(CONFIG_RM) += rm.o
|
||||
|
||||
@@ -36,7 +37,7 @@
|
||||
|
||||
#include "libbb.h"
|
||||
|
||||
/* This is a NOFORK applet. Be very careful! */
|
||||
/* This is a NOEXEC applet. Be very careful! */
|
||||
|
||||
int rm_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int rm_main(int argc UNUSED_PARAM, char **argv)
|
||||
|
||||
+3
-2
@@ -12,7 +12,8 @@
|
||||
//config: help
|
||||
//config: print a sequence of numbers
|
||||
|
||||
//applet:IF_SEQ(APPLET_NOFORK(seq, seq, BB_DIR_USR_BIN, BB_SUID_DROP, seq))
|
||||
//applet:IF_SEQ(APPLET_NOEXEC(seq, seq, BB_DIR_USR_BIN, BB_SUID_DROP, seq))
|
||||
/* was NOFORK, but then "seq 1 999999999" can't be ^C'ed if run by hush */
|
||||
|
||||
//kbuild:lib-$(CONFIG_SEQ) += seq.o
|
||||
|
||||
@@ -26,7 +27,7 @@
|
||||
|
||||
#include "libbb.h"
|
||||
|
||||
/* This is a NOFORK applet. Be very careful! */
|
||||
/* This is a NOEXEC applet. Be very careful! */
|
||||
|
||||
int seq_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
int seq_main(int argc, char **argv)
|
||||
|
||||
+1
-1
@@ -53,7 +53,7 @@ static void shuffle_lines(char **lines, unsigned numlines)
|
||||
/* RAND_MAX can be as small as 32767 */
|
||||
if (i > RAND_MAX)
|
||||
r ^= rand() << 15;
|
||||
r %= i;
|
||||
r %= i + 1;
|
||||
tmp = lines[i];
|
||||
lines[i] = lines[r];
|
||||
lines[r] = tmp;
|
||||
|
||||
+1
-1
@@ -157,7 +157,7 @@ int uname_main(int argc UNUSED_PARAM, char **argv)
|
||||
strcpy(uname_info.processor, unknown_str);
|
||||
strcpy(uname_info.platform, unknown_str);
|
||||
strcpy(uname_info.os, CONFIG_UNAME_OSNAME);
|
||||
#if 0
|
||||
#if ENABLE_FEDORA_COMPAT
|
||||
/* Fedora does something like this */
|
||||
strcpy(uname_info.processor, uname_info.name.machine);
|
||||
strcpy(uname_info.platform, uname_info.name.machine);
|
||||
|
||||
@@ -38,6 +38,13 @@ int usleep_main(int argc UNUSED_PARAM, char **argv)
|
||||
bb_show_usage();
|
||||
}
|
||||
|
||||
/* Safe wrt NOFORK? (noforks are not allowed to run for
|
||||
* a long time). Try "usleep 99999999" + ^C + "echo $?"
|
||||
* in hush with FEATURE_SH_NOFORK=y.
|
||||
* At least on uclibc, usleep() thanslates to nanosleep()
|
||||
* which returns early on any signal (even caught one),
|
||||
* and uclibc does not loop back on EINTR.
|
||||
*/
|
||||
usleep(xatou(argv[1]));
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
|
||||
@@ -47,10 +47,16 @@ static void FAST_FUNC read_stduu(FILE *src_stream, FILE *dst_stream, int flags U
|
||||
line = xmalloc_fgets_str_len(src_stream, "\n", &line_len);
|
||||
if (!line)
|
||||
break;
|
||||
/* Handle both Unix and MSDOS text, and stray trailing spaces */
|
||||
/* Handle both Unix and MSDOS text.
|
||||
* Note: space should not be trimmed, some encoders use it instead of "`"
|
||||
* for padding of last incomplete 4-char block.
|
||||
*/
|
||||
str_len = line_len;
|
||||
while (--str_len >= 0 && isspace(line[str_len]))
|
||||
while (--str_len >= 0
|
||||
&& (line[str_len] == '\n' || line[str_len] == '\r')
|
||||
) {
|
||||
line[str_len] = '\0';
|
||||
}
|
||||
|
||||
if (strcmp(line, "end") == 0) {
|
||||
return; /* the only non-error exit */
|
||||
@@ -65,7 +71,7 @@ static void FAST_FUNC read_stduu(FILE *src_stream, FILE *dst_stream, int flags U
|
||||
|
||||
encoded_len = line[0] * 4 / 3;
|
||||
/* Check that line is not too short. (we tolerate
|
||||
* overly _long_ line to accommodate possible extra '`').
|
||||
* overly _long_ line to accommodate possible extra "`").
|
||||
* Empty line case is also caught here. */
|
||||
if (str_len <= encoded_len) {
|
||||
break; /* go to bb_error_msg_and_die("short file"); */
|
||||
|
||||
+2
-1
@@ -17,7 +17,8 @@
|
||||
//config: yes is used to repeatedly output a specific string, or
|
||||
//config: the default string `y'.
|
||||
|
||||
//applet:IF_YES(APPLET_NOFORK(yes, yes, BB_DIR_USR_BIN, BB_SUID_DROP, yes))
|
||||
//applet:IF_YES(APPLET_NOEXEC(yes, yes, BB_DIR_USR_BIN, BB_SUID_DROP, yes))
|
||||
/* was NOFORK, but then yes can't be ^C'ed if run by hush */
|
||||
|
||||
//kbuild:lib-$(CONFIG_YES) += yes.o
|
||||
|
||||
|
||||
@@ -52,6 +52,9 @@ xargs, find, shells do it (grep for "spawn_and_wait" and
|
||||
This poses much more serious limitations on what applet can do:
|
||||
|
||||
* all NOEXEC limitations apply.
|
||||
* do not run for a long time or wait for user input:
|
||||
hush shell only handles signals (like ^C) after you return
|
||||
from APPLET_main().
|
||||
* do not ever exit() or exec().
|
||||
- xfuncs are okay. They are using special trick to return
|
||||
to the caller applet instead of dying when they detect "x" condition.
|
||||
|
||||
@@ -14,7 +14,7 @@ env | sort
|
||||
|
||||
while sleep 1; test $cnt != 0; do
|
||||
echo "Trying to reread partition table on $DEVNAME ($cnt)"
|
||||
: $((cnt--))
|
||||
cnt=$((cnt-1))
|
||||
# If device node doesn't exist, it means the device was removed.
|
||||
# Stop trying.
|
||||
test -e "$DEVNAME" || { echo "$DEVNAME doesn't exist, aborting"; exit 1; }
|
||||
|
||||
@@ -30,7 +30,7 @@ test x"$router" != x"" || exec env - sleep "$ping_time"
|
||||
failcnt=0
|
||||
while true; do
|
||||
ping $ping_opts "$router" && exec env - sleep "$ping_time"
|
||||
: $((failcnt++))
|
||||
failcnt=$((failcnt+1))
|
||||
msg "Failed to ping $router, fail count:$failcnt"
|
||||
test $failcnt -ge $max_fail && break
|
||||
env - sleep "$retry_time"
|
||||
|
||||
+3
-1
@@ -778,6 +778,8 @@ ssize_t recv_from_to(int fd, void *buf, size_t len, int flags,
|
||||
|
||||
uint16_t inet_cksum(uint16_t *addr, int len) FAST_FUNC;
|
||||
|
||||
/* 0 if argv[0] is NULL: */
|
||||
unsigned string_array_len(char **argv) FAST_FUNC;
|
||||
void overlapping_strcpy(char *dst, const char *src) FAST_FUNC;
|
||||
char *safe_strncpy(char *dst, const char *src, size_t size) FAST_FUNC;
|
||||
char *strncpy_IFNAMSIZ(char *dst, const char *src) FAST_FUNC;
|
||||
@@ -1106,7 +1108,7 @@ int spawn_and_wait(char **argv) FAST_FUNC;
|
||||
int run_nofork_applet(int applet_no, char **argv) FAST_FUNC;
|
||||
#ifndef BUILD_INDIVIDUAL
|
||||
extern int find_applet_by_name(const char *name) FAST_FUNC;
|
||||
extern void run_applet_no_and_exit(int a, char **argv) NORETURN FAST_FUNC;
|
||||
extern void run_applet_no_and_exit(int a, const char *name, char **argv) NORETURN FAST_FUNC;
|
||||
#endif
|
||||
|
||||
/* Helpers for daemonization.
|
||||
|
||||
+23
-7
@@ -78,6 +78,17 @@
|
||||
#endif
|
||||
|
||||
|
||||
unsigned FAST_FUNC string_array_len(char **argv)
|
||||
{
|
||||
char **start = argv;
|
||||
|
||||
while (*argv)
|
||||
argv++;
|
||||
|
||||
return argv - start;
|
||||
}
|
||||
|
||||
|
||||
#if ENABLE_SHOW_USAGE && !ENABLE_FEATURE_COMPRESS_USAGE
|
||||
static const char usage_messages[] ALIGN1 = UNPACKED_USAGE;
|
||||
#else
|
||||
@@ -866,16 +877,17 @@ static int busybox_main(char **argv)
|
||||
# endif
|
||||
|
||||
# if NUM_APPLETS > 0
|
||||
void FAST_FUNC run_applet_no_and_exit(int applet_no, char **argv)
|
||||
void FAST_FUNC run_applet_no_and_exit(int applet_no, const char *name, char **argv)
|
||||
{
|
||||
int argc = 1;
|
||||
|
||||
while (argv[argc])
|
||||
argc++;
|
||||
int argc = string_array_len(argv);
|
||||
|
||||
/* Reinit some shared global data */
|
||||
xfunc_error_retval = EXIT_FAILURE;
|
||||
applet_name = bb_get_last_path_component_nostrip(argv[0]);
|
||||
/*
|
||||
* We do not use argv[0]: do not want to repeat massaging of
|
||||
* "-/sbin/halt" -> "halt", for example.
|
||||
*/
|
||||
applet_name = name;
|
||||
|
||||
/* Special case. POSIX says "test --help"
|
||||
* should be no different from e.g. "test --foo".
|
||||
@@ -919,7 +931,7 @@ static NORETURN void run_applet_and_exit(const char *name, char **argv)
|
||||
{
|
||||
int applet = find_applet_by_name(name);
|
||||
if (applet >= 0)
|
||||
run_applet_no_and_exit(applet, argv);
|
||||
run_applet_no_and_exit(applet, name, argv);
|
||||
}
|
||||
# endif
|
||||
|
||||
@@ -993,7 +1005,11 @@ int main(int argc UNUSED_PARAM, char **argv)
|
||||
}
|
||||
/* applet_names in this case is just "applet\0\0" */
|
||||
lbb_prepare(applet_names IF_FEATURE_INDIVIDUAL(, argv));
|
||||
# if ENABLE_BUILD_LIBBUSYBOX
|
||||
return SINGLE_APPLET_MAIN(string_array_len(argv), argv);
|
||||
# else
|
||||
return SINGLE_APPLET_MAIN(argc, argv);
|
||||
# endif
|
||||
|
||||
#elif !ENABLE_BUSYBOX && NUM_APPLETS == 0
|
||||
|
||||
|
||||
@@ -119,8 +119,11 @@ static off_t bb_full_fd_action(int src_fd, int dst_fd, off_t size)
|
||||
}
|
||||
out:
|
||||
|
||||
/* some environments don't have munmap(), hide it in #if */
|
||||
#if CONFIG_FEATURE_COPYBUF_KB > 4
|
||||
if (buffer_size > 4 * 1024)
|
||||
munmap(buffer, buffer_size);
|
||||
#endif
|
||||
return status ? -1 : total;
|
||||
}
|
||||
|
||||
|
||||
+1
-3
@@ -379,9 +379,7 @@ getopt32(char **argv, const char *applet_opts, ...)
|
||||
int spec_flgs = 0;
|
||||
|
||||
/* skip 0: some applets cheat: they do not actually HAVE argv[0] */
|
||||
argc = 1;
|
||||
while (argv[argc])
|
||||
argc++;
|
||||
argc = 1 + string_array_len(argv + 1);
|
||||
|
||||
va_start(p, applet_opts);
|
||||
|
||||
|
||||
+19
-27
@@ -11,6 +11,12 @@
|
||||
#include "libbb.h"
|
||||
#include "inet_common.h"
|
||||
|
||||
#if 0
|
||||
# define dbg(...) bb_error_msg(__VA_ARGS__)
|
||||
#else
|
||||
# define dbg(...) ((void)0)
|
||||
#endif
|
||||
|
||||
int FAST_FUNC INET_resolve(const char *name, struct sockaddr_in *s_in, int hostfirst)
|
||||
{
|
||||
struct hostent *hp;
|
||||
@@ -33,9 +39,7 @@ int FAST_FUNC INET_resolve(const char *name, struct sockaddr_in *s_in, int hostf
|
||||
}
|
||||
/* If we expect this to be a hostname, try hostname database first */
|
||||
if (hostfirst) {
|
||||
#ifdef DEBUG
|
||||
bb_error_msg("gethostbyname(%s)", name);
|
||||
#endif
|
||||
dbg("gethostbyname(%s)", name);
|
||||
hp = gethostbyname(name);
|
||||
if (hp) {
|
||||
memcpy(&s_in->sin_addr, hp->h_addr_list[0],
|
||||
@@ -45,9 +49,7 @@ int FAST_FUNC INET_resolve(const char *name, struct sockaddr_in *s_in, int hostf
|
||||
}
|
||||
#if ENABLE_FEATURE_ETC_NETWORKS
|
||||
/* Try the NETWORKS database to see if this is a known network. */
|
||||
#ifdef DEBUG
|
||||
bb_error_msg("getnetbyname(%s)", name);
|
||||
#endif
|
||||
dbg("getnetbyname(%s)", name);
|
||||
np = getnetbyname(name);
|
||||
if (np) {
|
||||
s_in->sin_addr.s_addr = htonl(np->n_net);
|
||||
@@ -61,8 +63,8 @@ int FAST_FUNC INET_resolve(const char *name, struct sockaddr_in *s_in, int hostf
|
||||
#ifdef DEBUG
|
||||
res_init();
|
||||
_res.options |= RES_DEBUG;
|
||||
bb_error_msg("gethostbyname(%s)", name);
|
||||
#endif
|
||||
dbg("gethostbyname(%s)", name);
|
||||
hp = gethostbyname(name);
|
||||
if (!hp) {
|
||||
return -1;
|
||||
@@ -93,17 +95,12 @@ char* FAST_FUNC INET_rresolve(struct sockaddr_in *s_in, int numeric, uint32_t ne
|
||||
smallint is_host;
|
||||
|
||||
if (s_in->sin_family != AF_INET) {
|
||||
#ifdef DEBUG
|
||||
bb_error_msg("rresolve: unsupported address family %d!",
|
||||
s_in->sin_family);
|
||||
#endif
|
||||
dbg("rresolve: unsupported address family %d!", s_in->sin_family);
|
||||
errno = EAFNOSUPPORT;
|
||||
return NULL;
|
||||
}
|
||||
nip = s_in->sin_addr.s_addr;
|
||||
#ifdef DEBUG
|
||||
bb_error_msg("rresolve: %08x mask:%08x num:%08x", (unsigned)nip, netmask, numeric);
|
||||
#endif
|
||||
dbg("rresolve: %08x mask:%08x num:%08x", (unsigned)nip, netmask, numeric);
|
||||
if (numeric & 0x0FFF)
|
||||
return xmalloc_sockaddr2dotted_noport((void*)s_in);
|
||||
if (nip == INADDR_ANY) {
|
||||
@@ -117,10 +114,8 @@ char* FAST_FUNC INET_rresolve(struct sockaddr_in *s_in, int numeric, uint32_t ne
|
||||
pn = cache;
|
||||
while (pn) {
|
||||
if (pn->nip == nip && pn->is_host == is_host) {
|
||||
#ifdef DEBUG
|
||||
bb_error_msg("rresolve: found %s %08x in cache",
|
||||
dbg("rresolve: found %s %08x in cache",
|
||||
(is_host ? "host" : "net"), (unsigned)nip);
|
||||
#endif
|
||||
return xstrdup(pn->name);
|
||||
}
|
||||
pn = pn->next;
|
||||
@@ -128,19 +123,18 @@ char* FAST_FUNC INET_rresolve(struct sockaddr_in *s_in, int numeric, uint32_t ne
|
||||
|
||||
name = NULL;
|
||||
if (is_host) {
|
||||
#ifdef DEBUG
|
||||
bb_error_msg("sockaddr2host_noport(%08x)", (unsigned)nip);
|
||||
#endif
|
||||
dbg("sockaddr2host_noport(%08x)", (unsigned)nip);
|
||||
name = xmalloc_sockaddr2host_noport((void*)s_in);
|
||||
} else if (ENABLE_FEATURE_ETC_NETWORKS) {
|
||||
}
|
||||
#if ENABLE_FEATURE_ETC_NETWORKS
|
||||
else {
|
||||
struct netent *np;
|
||||
#ifdef DEBUG
|
||||
bb_error_msg("getnetbyaddr(%08x)", (unsigned)ntohl(nip));
|
||||
#endif
|
||||
dbg("getnetbyaddr(%08x)", (unsigned)ntohl(nip));
|
||||
np = getnetbyaddr(ntohl(nip), AF_INET);
|
||||
if (np)
|
||||
name = xstrdup(np->n_name);
|
||||
}
|
||||
#endif
|
||||
if (!name)
|
||||
name = xmalloc_sockaddr2dotted_noport((void*)s_in);
|
||||
|
||||
@@ -183,10 +177,8 @@ int FAST_FUNC INET6_resolve(const char *name, struct sockaddr_in6 *sin6)
|
||||
char* FAST_FUNC INET6_rresolve(struct sockaddr_in6 *sin6, int numeric)
|
||||
{
|
||||
if (sin6->sin6_family != AF_INET6) {
|
||||
#ifdef DEBUG
|
||||
bb_error_msg("rresolve: unsupported address family %d!",
|
||||
dbg("rresolve: unsupported address family %d!",
|
||||
sin6->sin6_family);
|
||||
#endif
|
||||
errno = EAFNOSUPPORT;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
+10
-2
@@ -13,9 +13,17 @@ ssize_t FAST_FUNC safe_write(int fd, const void *buf, size_t count)
|
||||
{
|
||||
ssize_t n;
|
||||
|
||||
do {
|
||||
for (;;) {
|
||||
n = write(fd, buf, count);
|
||||
} while (n < 0 && errno == EINTR);
|
||||
if (n >= 0 || errno != EINTR)
|
||||
break;
|
||||
/* Some callers set errno=0, are upset when they see EINTR.
|
||||
* Returning EINTR is wrong since we retry write(),
|
||||
* the "error" was transient.
|
||||
*/
|
||||
errno = 0;
|
||||
/* repeat the write() */
|
||||
}
|
||||
|
||||
return n;
|
||||
}
|
||||
@@ -16,6 +16,7 @@
|
||||
*/
|
||||
|
||||
#include "busybox.h" /* uses applet tables */
|
||||
#include "NUM_APPLETS.h"
|
||||
|
||||
/* This does a fork/exec in one call, using vfork(). Returns PID of new child,
|
||||
* -1 for failure. Runs argv[0], searching path if that has no / in it. */
|
||||
@@ -156,7 +157,7 @@ int FAST_FUNC run_nofork_applet(int applet_no, char **argv)
|
||||
int FAST_FUNC spawn_and_wait(char **argv)
|
||||
{
|
||||
int rc;
|
||||
#if ENABLE_FEATURE_PREFER_APPLETS
|
||||
#if ENABLE_FEATURE_PREFER_APPLETS && (NUM_APPLETS > 1)
|
||||
int a = find_applet_by_name(argv[0]);
|
||||
|
||||
if (a >= 0) {
|
||||
@@ -179,7 +180,7 @@ int FAST_FUNC spawn_and_wait(char **argv)
|
||||
* as of yet (and that should probably always stay true).
|
||||
*/
|
||||
/* xfunc_error_retval and applet_name are init by: */
|
||||
run_applet_no_and_exit(a, argv);
|
||||
run_applet_no_and_exit(a, argv[0], argv);
|
||||
}
|
||||
# endif
|
||||
}
|
||||
|
||||
@@ -54,18 +54,18 @@ for app; do
|
||||
fi
|
||||
|
||||
if ! yes '' | make oldconfig >busybox_make_${app}.log 2>&1; then
|
||||
: $((fail++))
|
||||
fail=$((fail+1))
|
||||
echo "Config error for ${app}"
|
||||
mv .config busybox_config_${app}
|
||||
elif ! make $makeopts >>busybox_make_${app}.log 2>&1; then
|
||||
: $((fail++))
|
||||
fail=$((fail+1))
|
||||
grep -i -e error: -e warning: busybox_make_${app}.log
|
||||
echo "Build error for ${app}"
|
||||
mv .config busybox_config_${app}
|
||||
elif ! grep -q '^#define NUM_APPLETS 1$' include/NUM_APPLETS.h; then
|
||||
grep -i -e error: -e warning: busybox_make_${app}.log
|
||||
mv busybox busybox_${app}
|
||||
: $((fail++))
|
||||
fail=$((fail+1))
|
||||
echo "NUM_APPLETS != 1 for ${app}: `cat include/NUM_APPLETS.h`"
|
||||
mv .config busybox_config_${app}
|
||||
else
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@
|
||||
//config:
|
||||
//config:config FEATURE_BEEP_FREQ
|
||||
//config: int "default frequency"
|
||||
//config: range 0 2147483647
|
||||
//config: range 20 50000 # allowing 0 here breaks the build
|
||||
//config: default 4000
|
||||
//config: depends on BEEP
|
||||
//config: help
|
||||
|
||||
+12
-8
@@ -227,7 +227,8 @@
|
||||
|
||||
#if ENABLE_FEATURE_INETD_RPC
|
||||
# if defined(__UCLIBC__) && ! defined(__UCLIBC_HAS_RPC__)
|
||||
# error "You need to build uClibc with UCLIBC_HAS_RPC for NFS support"
|
||||
# warning "You probably need to build uClibc with UCLIBC_HAS_RPC for NFS support"
|
||||
/* not #error, since user may be using e.g. libtirpc instead */
|
||||
# endif
|
||||
# include <rpc/rpc.h>
|
||||
# include <rpc/pmap_clnt.h>
|
||||
@@ -1513,8 +1514,11 @@ int inetd_main(int argc UNUSED_PARAM, char **argv)
|
||||
} /* for (;;) */
|
||||
}
|
||||
|
||||
#if !BB_MMU
|
||||
#if ENABLE_FEATURE_INETD_SUPPORT_BUILTIN_ECHO \
|
||||
|| ENABLE_FEATURE_INETD_SUPPORT_BUILTIN_DISCARD
|
||||
# if !BB_MMU
|
||||
static const char *const cat_args[] = { "cat", NULL };
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
@@ -1525,14 +1529,14 @@ static const char *const cat_args[] = { "cat", NULL };
|
||||
/* ARGSUSED */
|
||||
static void FAST_FUNC echo_stream(int s, servtab_t *sep UNUSED_PARAM)
|
||||
{
|
||||
#if BB_MMU
|
||||
# if BB_MMU
|
||||
while (1) {
|
||||
ssize_t sz = safe_read(s, line, LINE_SIZE);
|
||||
if (sz <= 0)
|
||||
break;
|
||||
xwrite(s, line, sz);
|
||||
}
|
||||
#else
|
||||
# else
|
||||
/* We are after vfork here! */
|
||||
/* move network socket to stdin/stdout */
|
||||
xmove_fd(s, STDIN_FILENO);
|
||||
@@ -1542,7 +1546,7 @@ static void FAST_FUNC echo_stream(int s, servtab_t *sep UNUSED_PARAM)
|
||||
xopen(bb_dev_null, O_WRONLY);
|
||||
BB_EXECVP("cat", (char**)cat_args);
|
||||
/* on failure we return to main, which does exit(EXIT_FAILURE) */
|
||||
#endif
|
||||
# endif
|
||||
}
|
||||
static void FAST_FUNC echo_dg(int s, servtab_t *sep)
|
||||
{
|
||||
@@ -1566,10 +1570,10 @@ static void FAST_FUNC echo_dg(int s, servtab_t *sep)
|
||||
/* ARGSUSED */
|
||||
static void FAST_FUNC discard_stream(int s, servtab_t *sep UNUSED_PARAM)
|
||||
{
|
||||
#if BB_MMU
|
||||
# if BB_MMU
|
||||
while (safe_read(s, line, LINE_SIZE) > 0)
|
||||
continue;
|
||||
#else
|
||||
# else
|
||||
/* We are after vfork here! */
|
||||
/* move network socket to stdin */
|
||||
xmove_fd(s, STDIN_FILENO);
|
||||
@@ -1580,7 +1584,7 @@ static void FAST_FUNC discard_stream(int s, servtab_t *sep UNUSED_PARAM)
|
||||
xdup2(STDOUT_FILENO, STDERR_FILENO);
|
||||
BB_EXECVP("cat", (char**)cat_args);
|
||||
/* on failure we return to main, which does exit(EXIT_FAILURE) */
|
||||
#endif
|
||||
# endif
|
||||
}
|
||||
/* ARGSUSED */
|
||||
static void FAST_FUNC discard_dg(int s, servtab_t *sep UNUSED_PARAM)
|
||||
|
||||
+2
-2
@@ -1199,11 +1199,11 @@ static void send_client_hello_and_alloc_hsd(tls_state_t *tls, const char *sni)
|
||||
};
|
||||
struct client_hello *record;
|
||||
int len;
|
||||
int sni_len = sni ? strnlen(sni, 127) : 0;
|
||||
int sni_len = sni ? strnlen(sni, 127 - 9) : 0;
|
||||
|
||||
len = sizeof(*record);
|
||||
if (sni_len)
|
||||
len += 11 + strlen(sni);
|
||||
len += 11 + sni_len;
|
||||
record = tls_get_outbuf(tls, len);
|
||||
memset(record, 0, len);
|
||||
|
||||
|
||||
@@ -85,7 +85,8 @@ asm( \
|
||||
"addl %%eax,%0 \n\t" \
|
||||
"adcl %%edx,%1 \n\t" \
|
||||
"adcl $0,%2 \n\t" \
|
||||
:"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "m"(i), "m"(j) :"%eax","%edx","%cc");
|
||||
:"=rm"(c0), "=rm"(c1), "=rm"(c2): "0"(c0), "1"(c1), "2"(c2), "m"(i), "m"(j) :"%eax","%edx","%cc");
|
||||
//bbox: ^^^ replaced "=r" with "=rm": %ebx is not available on shared build
|
||||
|
||||
/******************************************************************************/
|
||||
#elif defined(PSTM_X86_64)
|
||||
|
||||
@@ -78,7 +78,8 @@ asm( \
|
||||
"addl %%eax,%0 \n\t" \
|
||||
"adcl %%edx,%1 \n\t" \
|
||||
"adcl $0,%2 \n\t" \
|
||||
:"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "m"(i) :"%eax","%edx","%cc");
|
||||
:"=rm"(c0), "=rm"(c1), "=rm"(c2): "0"(c0), "1"(c1), "2"(c2), "m"(i) :"%eax","%edx","%cc");
|
||||
//bbox: ^^^ replaced "=r" with "=rm": %ebx is not available on shared build
|
||||
|
||||
#define SQRADD2(i, j) \
|
||||
asm( \
|
||||
@@ -90,7 +91,8 @@ asm( \
|
||||
"addl %%eax,%0 \n\t" \
|
||||
"adcl %%edx,%1 \n\t" \
|
||||
"adcl $0,%2 \n\t" \
|
||||
:"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "m"(i), "m"(j) :"%eax","%edx","%cc");
|
||||
:"=rm"(c0), "=rm"(c1), "=rm"(c2): "0"(c0), "1"(c1), "2"(c2), "m"(i), "m"(j) :"%eax","%edx","%cc");
|
||||
//bbox: ^^^ replaced "=r" with "=rm": %ebx is not available on shared build
|
||||
|
||||
#define SQRADDSC(i, j) \
|
||||
asm( \
|
||||
|
||||
+6
-5
@@ -718,15 +718,16 @@ int svc_main(int argc UNUSED_PARAM, char **argv)
|
||||
argv[1] = command;
|
||||
command[1] = '\0';
|
||||
|
||||
/* getopt32() was already called:
|
||||
* reset the libc getopt() function, which keeps internal state.
|
||||
*/
|
||||
GETOPT_RESET();
|
||||
|
||||
do {
|
||||
if (opts & 1) {
|
||||
int r;
|
||||
|
||||
command[0] = *optstring;
|
||||
|
||||
/* getopt() was already called by getopt32():
|
||||
* reset the libc getopt() function's internal state.
|
||||
*/
|
||||
GETOPT_RESET();
|
||||
r = sv(argv);
|
||||
if (r)
|
||||
return 1;
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
#!/bin/sh
|
||||
|
||||
run_testsuite=false
|
||||
run_testsuite=true
|
||||
|
||||
run_single_test=false
|
||||
run_single_test=true
|
||||
|
||||
test -d "$1" || { echo "'$1' is not a directory"; exit 1; }
|
||||
test -x "$1/scripts/randomtest" || { echo "No scripts/randomtest in '$1'"; exit 1; }
|
||||
|
||||
@@ -40,6 +44,28 @@ while sleep 1; do
|
||||
fi
|
||||
tail -n10 -- "$dir/testsuite/runtest.log"
|
||||
fi
|
||||
if $run_single_test; then
|
||||
(
|
||||
cd -- "$dir" || exit 1
|
||||
echo "Running make_single_applets.sh in $dir..."
|
||||
|
||||
if grep -q '# CONFIG_FEATURE_TFTP_GET is not set' .config \
|
||||
&& grep -q '# CONFIG_FEATURE_TFTP_PUT is not set' .config \
|
||||
; then
|
||||
# If both off, tftp[d] is ifdefed out and test fails.
|
||||
# Enable one:
|
||||
sed 's/# CONFIG_FEATURE_TFTP_GET is not set/CONFIG_FEATURE_TFTP_GET=y/' -i .config
|
||||
fi
|
||||
|
||||
./make_single_applets.sh
|
||||
)
|
||||
if test $? != 0; then
|
||||
echo "Failed make_single_applets.sh in $dir"
|
||||
exit 1 # you may comment this out...
|
||||
let fail++
|
||||
continue
|
||||
fi
|
||||
fi
|
||||
rm -rf -- "$dir"
|
||||
let cnt++
|
||||
done
|
||||
+10
-4
@@ -4022,15 +4022,19 @@ sprint_status48(char *s, int status, int sigonly)
|
||||
|
||||
col = 0;
|
||||
if (!WIFEXITED(status)) {
|
||||
if (JOBS && WIFSTOPPED(status))
|
||||
#if JOBS
|
||||
if (WIFSTOPPED(status))
|
||||
st = WSTOPSIG(status);
|
||||
else
|
||||
#endif
|
||||
st = WTERMSIG(status);
|
||||
if (sigonly) {
|
||||
if (st == SIGINT || st == SIGPIPE)
|
||||
goto out;
|
||||
if (JOBS && WIFSTOPPED(status))
|
||||
#if JOBS
|
||||
if (WIFSTOPPED(status))
|
||||
goto out;
|
||||
#endif
|
||||
}
|
||||
st &= 0x7f;
|
||||
//TODO: use bbox's get_signame? strsignal adds ~600 bytes to text+rodata
|
||||
@@ -4182,8 +4186,10 @@ dowait(int block, struct job *job)
|
||||
goto out;
|
||||
}
|
||||
/* The process wasn't found in job list */
|
||||
if (JOBS && !WIFSTOPPED(status))
|
||||
#if JOBS
|
||||
if (!WIFSTOPPED(status))
|
||||
jobless--;
|
||||
#endif
|
||||
out:
|
||||
INT_ON;
|
||||
|
||||
@@ -7688,7 +7694,7 @@ tryexec(IF_FEATURE_SH_STANDALONE(int applet_no,) char *cmd, char **argv, char **
|
||||
clearenv();
|
||||
while (*envp)
|
||||
putenv(*envp++);
|
||||
run_applet_no_and_exit(applet_no, argv);
|
||||
run_applet_no_and_exit(applet_no, cmd, argv);
|
||||
}
|
||||
/* re-exec ourselves with the new arguments */
|
||||
execve(bb_busybox_exec_path, argv, envp);
|
||||
|
||||
+37
-22
@@ -1486,8 +1486,6 @@ typedef struct save_arg_t {
|
||||
|
||||
static void save_and_replace_G_args(save_arg_t *sv, char **argv)
|
||||
{
|
||||
int n;
|
||||
|
||||
sv->sv_argv0 = argv[0];
|
||||
sv->sv_g_argv = G.global_argv;
|
||||
sv->sv_g_argc = G.global_argc;
|
||||
@@ -1497,10 +1495,7 @@ static void save_and_replace_G_args(save_arg_t *sv, char **argv)
|
||||
G.global_argv = argv;
|
||||
IF_HUSH_SET(G.global_args_malloced = 0;)
|
||||
|
||||
n = 1;
|
||||
while (*++argv)
|
||||
n++;
|
||||
G.global_argc = n;
|
||||
G.global_argc = 1 + string_array_len(argv + 1);
|
||||
}
|
||||
|
||||
static void restore_G_args(save_arg_t *sv, char **argv)
|
||||
@@ -6817,13 +6812,11 @@ static void exec_function(char ***to_free,
|
||||
char **argv)
|
||||
{
|
||||
# if BB_MMU
|
||||
int n = 1;
|
||||
int n;
|
||||
|
||||
argv[0] = G.global_argv[0];
|
||||
G.global_argv = argv;
|
||||
while (*++argv)
|
||||
n++;
|
||||
G.global_argc = n;
|
||||
G.global_argc = n = 1 + string_array_len(argv + 1);
|
||||
/* On MMU, funcp->body is always non-NULL */
|
||||
n = run_list(funcp->body);
|
||||
fflush_all();
|
||||
@@ -7070,8 +7063,10 @@ static NOINLINE void pseudo_exec_argv(nommu_save_t *nommu_save,
|
||||
if (APPLET_IS_NOEXEC(a)) {
|
||||
/* Do not leak open fds from opened script files etc */
|
||||
close_all_FILE_list();
|
||||
/* Without this, "rm -i FILE" can't be ^C'ed: */
|
||||
switch_off_special_sigs(G.special_sig_mask);
|
||||
debug_printf_exec("running applet '%s'\n", argv[0]);
|
||||
run_applet_no_and_exit(a, argv);
|
||||
run_applet_no_and_exit(a, argv[0], argv);
|
||||
}
|
||||
# endif
|
||||
/* Re-exec ourselves */
|
||||
@@ -7732,6 +7727,24 @@ static NOINLINE int run_pipe(struct pipe *pi)
|
||||
add_vars(old_vars);
|
||||
/* clean_up_and_ret0: */
|
||||
restore_redirects(squirrel);
|
||||
/*
|
||||
* Try "usleep 99999999" + ^C + "echo $?"
|
||||
* with FEATURE_SH_NOFORK=y.
|
||||
*/
|
||||
if (!funcp) {
|
||||
/* It was builtin or nofork.
|
||||
* if this would be a real fork/execed program,
|
||||
* it should have died if a fatal sig was received.
|
||||
* But OTOH, there was no separate process,
|
||||
* the sig was sent to _shell_, not to non-existing
|
||||
* child.
|
||||
* Let's just handle ^C only, this one is obvious:
|
||||
* we aren't ok with exitcode 0 when ^C was pressed
|
||||
* during builtin/nofork.
|
||||
*/
|
||||
if (sigismember(&G.pending_set, SIGINT))
|
||||
rcode = 128 + SIGINT;
|
||||
}
|
||||
clean_up_and_ret1:
|
||||
free(argv_expanded);
|
||||
IF_HAS_KEYWORDS(if (pi->pi_inverted) rcode = !rcode;)
|
||||
@@ -7747,6 +7760,14 @@ static NOINLINE int run_pipe(struct pipe *pi)
|
||||
if (rcode == 0) {
|
||||
debug_printf_exec(": run_nofork_applet '%s' '%s'...\n",
|
||||
argv_expanded[0], argv_expanded[1]);
|
||||
/*
|
||||
* Note: signals (^C) can't interrupt here.
|
||||
* We remember them and they will be acted upon
|
||||
* after applet returns.
|
||||
* This makes applets which can run for a long time
|
||||
* and/or wait for user input ineligible for NOFORK:
|
||||
* for example, "yes" or "rm" (rm -i waits for input).
|
||||
*/
|
||||
rcode = run_nofork_applet(n, argv_expanded);
|
||||
}
|
||||
goto clean_up_and_ret;
|
||||
@@ -8167,7 +8188,7 @@ static int run_list(struct pipe *pi)
|
||||
/* Last command's pid goes to $! */
|
||||
G.last_bg_pid = pi->cmds[pi->num_cmds - 1].pid;
|
||||
debug_printf_exec(": cmd&: exitcode EXIT_SUCCESS\n");
|
||||
/* Check pi->pi_inverted? "! sleep 1 & echo $?": bash says 1. dash and ash says 0 */
|
||||
/* Check pi->pi_inverted? "! sleep 1 & echo $?": bash says 1. dash and ash say 0 */
|
||||
rcode = EXIT_SUCCESS;
|
||||
goto check_traps;
|
||||
} else {
|
||||
@@ -8829,12 +8850,8 @@ static int FAST_FUNC builtin_true(char **argv UNUSED_PARAM)
|
||||
#if ENABLE_HUSH_TEST || ENABLE_HUSH_ECHO || ENABLE_HUSH_PRINTF || ENABLE_HUSH_KILL
|
||||
static int run_applet_main(char **argv, int (*applet_main_func)(int argc, char **argv))
|
||||
{
|
||||
int argc = 0;
|
||||
while (*argv) {
|
||||
argc++;
|
||||
argv++;
|
||||
}
|
||||
return applet_main_func(argc, argv - argc);
|
||||
int argc = string_array_len(argv);
|
||||
return applet_main_func(argc, argv);
|
||||
}
|
||||
#endif
|
||||
#if ENABLE_HUSH_TEST || BASH_TEST2
|
||||
@@ -9381,10 +9398,7 @@ static int FAST_FUNC builtin_set(char **argv)
|
||||
/* This realloc's G.global_argv */
|
||||
G.global_argv = pp = add_strings_to_strings(g_argv, argv, /*dup:*/ 1);
|
||||
|
||||
n = 1;
|
||||
while (*++pp)
|
||||
n++;
|
||||
G.global_argc = n;
|
||||
G.global_argc = 1 + string_array_len(pp + 1);
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
|
||||
@@ -9805,6 +9819,7 @@ static int wait_for_child_or_signal(struct pipe *waitfor_pipe, pid_t waitfor_pid
|
||||
/* So, did we get a signal? */
|
||||
sig = check_and_run_traps();
|
||||
if (sig /*&& sig != SIGCHLD - always true */) {
|
||||
/* Do this for any (non-ignored) signal, not only for ^C */
|
||||
ret = 128 + sig;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -405,9 +405,7 @@ shell_builtin_ulimit(char **argv)
|
||||
*/
|
||||
GETOPT_RESET();
|
||||
|
||||
argc = 1;
|
||||
while (argv[argc])
|
||||
argc++;
|
||||
argc = string_array_len(argv);
|
||||
|
||||
opts = 0;
|
||||
while (1) {
|
||||
|
||||
@@ -185,6 +185,8 @@ struct hd_geometry {
|
||||
|
||||
#define HDIO_GETGEO 0x0301 /* get device geometry */
|
||||
|
||||
/* TODO: #if ENABLE_FEATURE_FDISK_WRITABLE */
|
||||
/* (currently fdisk_sun/sgi.c do not have proper WRITABLE #ifs) */
|
||||
static const char msg_building_new_label[] ALIGN1 =
|
||||
"Building a new %s. Changes will remain in memory only,\n"
|
||||
"until you decide to write them. After that the previous content\n"
|
||||
@@ -192,6 +194,7 @@ static const char msg_building_new_label[] ALIGN1 =
|
||||
|
||||
static const char msg_part_already_defined[] ALIGN1 =
|
||||
"Partition %u is already defined, delete it before re-adding\n";
|
||||
/* #endif */
|
||||
|
||||
|
||||
struct partition {
|
||||
|
||||
@@ -47,7 +47,7 @@ test_mke2fs() {
|
||||
kilobytes=60
|
||||
while true; do
|
||||
test_mke2fs || exit 1
|
||||
: $((kilobytes++))
|
||||
kilobytes=$((kilobytes+1))
|
||||
test $kilobytes = 200 && break
|
||||
done
|
||||
|
||||
@@ -56,7 +56,7 @@ done
|
||||
kilobytes=$((1 * 8*1024 - 50))
|
||||
while true; do
|
||||
test_mke2fs || exit 1
|
||||
: $((kilobytes++))
|
||||
kilobytes=$((kilobytes+1))
|
||||
test $kilobytes = $((1 * 8*1024 + 300)) && break
|
||||
done
|
||||
|
||||
@@ -65,7 +65,7 @@ done
|
||||
kilobytes=$((2 * 8*1024 - 50))
|
||||
while true; do
|
||||
test_mke2fs || exit 1
|
||||
: $((kilobytes++))
|
||||
kilobytes=$((kilobytes+1))
|
||||
test $kilobytes = $((2 * 8*1024 + 400)) && break
|
||||
done
|
||||
|
||||
@@ -74,7 +74,7 @@ done
|
||||
kilobytes=$((3 * 8*1024 - 50))
|
||||
while true; do
|
||||
test_mke2fs || exit 1
|
||||
: $((kilobytes++))
|
||||
kilobytes=$((kilobytes+1))
|
||||
test $kilobytes = $((3 * 8*1024 + 500)) && break
|
||||
done
|
||||
|
||||
@@ -83,7 +83,7 @@ done
|
||||
kilobytes=$((4 * 8*1024 - 50))
|
||||
while true; do
|
||||
test_mke2fs || exit 1
|
||||
: $((kilobytes++))
|
||||
kilobytes=$((kilobytes+1))
|
||||
test $kilobytes = $((4 * 8*1024 + 600)) && break
|
||||
done
|
||||
|
||||
@@ -92,7 +92,7 @@ done
|
||||
kilobytes=$((5 * 8*1024 - 50))
|
||||
while true; do
|
||||
test_mke2fs || exit 1
|
||||
: $((kilobytes++))
|
||||
kilobytes=$((kilobytes+1))
|
||||
test $kilobytes = $((5 * 8*1024 + 700)) && break
|
||||
done
|
||||
exit
|
||||
|
||||
+2
-1
@@ -246,7 +246,8 @@
|
||||
/* This is just a warning of a common mistake. Possibly this should be a
|
||||
* uclibc faq entry rather than in busybox... */
|
||||
# if defined(__UCLIBC__) && ! defined(__UCLIBC_HAS_RPC__)
|
||||
# error "You need to build uClibc with UCLIBC_HAS_RPC for NFS support"
|
||||
# warning "You probably need to build uClibc with UCLIBC_HAS_RPC for NFS support"
|
||||
/* not #error, since user may be using e.g. libtirpc instead */
|
||||
# endif
|
||||
# include <rpc/rpc.h>
|
||||
# include <rpc/pmap_prot.h>
|
||||
|
||||
@@ -62,7 +62,8 @@ int setpriv_main(int argc UNUSED_PARAM, char **argv)
|
||||
|
||||
opt_complementary = "-1";
|
||||
applet_long_options = setpriv_longopts;
|
||||
opts = getopt32(argv, "");
|
||||
opts = getopt32(argv, "+");
|
||||
|
||||
if (opts) {
|
||||
if (prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0))
|
||||
bb_simple_perror_msg_and_die("prctl: NO_NEW_PRIVS");
|
||||
|
||||
Reference in new issue
Block a user