Compare commits
12
Commits
master
...
1_36_stable
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1a64f6a20a | ||
|
|
38d2d26a5f | ||
|
|
384cd2e436 | ||
|
|
ce839dea92 | ||
|
|
d661cb1977 | ||
|
|
515adcc9f3 | ||
|
|
90f5f2a190 | ||
|
|
07bc5de67b | ||
|
|
64e967fabb | ||
|
|
8d198665a0 | ||
|
|
c0bb90e2fe | ||
|
|
f15dfd86c4 |
No files matched your search
@@ -1,6 +1,6 @@
|
||||
VERSION = 1
|
||||
PATCHLEVEL = 36
|
||||
SUBLEVEL = 0
|
||||
SUBLEVEL = 1
|
||||
EXTRAVERSION =
|
||||
NAME = Unnamed
|
||||
|
||||
|
||||
+12
-3
@@ -56,7 +56,7 @@
|
||||
//kbuild:lib-$(CONFIG_UNZIP) += unzip.o
|
||||
|
||||
//usage:#define unzip_trivial_usage
|
||||
//usage: "[-lnojpq] FILE[.zip] [FILE]... [-x FILE]... [-d DIR]"
|
||||
//usage: "[-lnojpqK] FILE[.zip] [FILE]... [-x FILE]... [-d DIR]"
|
||||
//usage:#define unzip_full_usage "\n\n"
|
||||
//usage: "Extract FILEs from ZIP archive\n"
|
||||
//usage: "\n -l List contents (with -q for short form)"
|
||||
@@ -66,6 +66,7 @@
|
||||
//usage: "\n -p Write to stdout"
|
||||
//usage: "\n -t Test"
|
||||
//usage: "\n -q Quiet"
|
||||
//usage: "\n -K Do not clear SUID bit"
|
||||
//usage: "\n -x FILE Exclude FILEs"
|
||||
//usage: "\n -d DIR Extract into DIR"
|
||||
|
||||
@@ -494,6 +495,7 @@ int unzip_main(int argc, char **argv)
|
||||
OPT_l = (1 << 0),
|
||||
OPT_x = (1 << 1),
|
||||
OPT_j = (1 << 2),
|
||||
OPT_K = (1 << 3),
|
||||
};
|
||||
unsigned opts;
|
||||
smallint quiet = 0;
|
||||
@@ -559,7 +561,7 @@ int unzip_main(int argc, char **argv)
|
||||
|
||||
opts = 0;
|
||||
/* '-' makes getopt return 1 for non-options */
|
||||
while ((i = getopt(argc, argv, "-d:lnotpqxjv")) != -1) {
|
||||
while ((i = getopt(argc, argv, "-d:lnotpqxjvK")) != -1) {
|
||||
switch (i) {
|
||||
case 'd': /* Extract to base directory */
|
||||
base_dir = optarg;
|
||||
@@ -602,6 +604,10 @@ int unzip_main(int argc, char **argv)
|
||||
opts |= OPT_j;
|
||||
break;
|
||||
|
||||
case 'K':
|
||||
opts |= OPT_K;
|
||||
break;
|
||||
|
||||
case 1:
|
||||
if (!src_fn) {
|
||||
/* The zip file */
|
||||
@@ -819,7 +825,10 @@ int unzip_main(int argc, char **argv)
|
||||
# endif
|
||||
if ((cdf.fmt.version_made_by >> 8) == 3) {
|
||||
/* This archive is created on Unix */
|
||||
dir_mode = file_mode = (cdf.fmt.external_attributes >> 16);
|
||||
file_mode = (cdf.fmt.external_attributes >> 16);
|
||||
if (!(opts & OPT_K))
|
||||
file_mode &= ~(mode_t)(S_ISUID | S_ISGID);
|
||||
dir_mode = file_mode;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
+1
-1
@@ -428,7 +428,7 @@ int printf_main(int argc UNUSED_PARAM, char **argv)
|
||||
if (argv[1] && argv[1][0] == '-' && argv[1][1] == '-' && !argv[1][2])
|
||||
argv++;
|
||||
if (!argv[1]) {
|
||||
if (ENABLE_ASH_PRINTF
|
||||
if ((ENABLE_ASH_PRINTF || ENABLE_HUSH_PRINTF)
|
||||
&& applet_name[0] != 'p'
|
||||
) {
|
||||
bb_simple_error_msg("usage: printf FORMAT [ARGUMENT...]");
|
||||
|
||||
+15
-1
@@ -65,15 +65,29 @@ int sleep_main(int argc UNUSED_PARAM, char **argv)
|
||||
{
|
||||
duration_t duration;
|
||||
|
||||
/* Note: sleep_main may be directly called from ash as a builtin.
|
||||
* This brings some complications:
|
||||
* + we can't use xfunc here
|
||||
* + we can't use bb_show_usage
|
||||
* + applet_name can be the name of the shell
|
||||
*/
|
||||
++argv;
|
||||
if (!*argv)
|
||||
if (!*argv) {
|
||||
/* Without this, bare "sleep" in ash shows _ash_ --help */
|
||||
/* (ash can be the "sh" applet as well, so check 2nd char) */
|
||||
if (ENABLE_ASH_SLEEP && applet_name[1] != 'l') {
|
||||
bb_simple_error_msg("sleep: missing operand");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
bb_show_usage();
|
||||
}
|
||||
|
||||
/* GNU sleep accepts "inf", "INF", "infinity" and "INFINITY" */
|
||||
if (strncasecmp(argv[0], "inf", 3) == 0)
|
||||
for (;;)
|
||||
sleep(INT_MAX);
|
||||
|
||||
//FIXME: in ash, "sleep 123qwerty" as a builtin aborts the shell
|
||||
#if ENABLE_FEATURE_FANCY_SLEEP
|
||||
duration = 0;
|
||||
do {
|
||||
|
||||
+1
-1
@@ -720,7 +720,7 @@ static void subCommand(const char *cmd, int num1, int num2)
|
||||
if (deltaLen <= 0) {
|
||||
memcpy(&lp->data[offset], newStr, newLen);
|
||||
if (deltaLen) {
|
||||
memcpy(&lp->data[offset + newLen],
|
||||
memmove(&lp->data[offset + newLen],
|
||||
&lp->data[offset + oldLen],
|
||||
lp->len - offset - oldLen);
|
||||
|
||||
|
||||
+7
-9
@@ -76,16 +76,14 @@ void FAST_FUNC sleep_for_duration(duration_t duration)
|
||||
ts.tv_sec = duration;
|
||||
ts.tv_nsec = (duration - ts.tv_sec) * 1000000000;
|
||||
}
|
||||
/* NB: if ENABLE_ASH_SLEEP, we end up here if "sleep N"
|
||||
* is run in ash. ^C will still work, because ash's signal handler
|
||||
* does not return (it longjumps), the below loop
|
||||
* will not continue looping.
|
||||
* (This wouldn't work in hush)
|
||||
/* NB: ENABLE_ASH_SLEEP requires that we do NOT loop on EINTR here:
|
||||
* otherwise, traps won't execute until we finish looping.
|
||||
*/
|
||||
do {
|
||||
errno = 0;
|
||||
nanosleep(&ts, &ts);
|
||||
} while (errno == EINTR);
|
||||
//do {
|
||||
// errno = 0;
|
||||
// nanosleep(&ts, &ts);
|
||||
//} while (errno == EINTR);
|
||||
nanosleep(&ts, &ts);
|
||||
}
|
||||
#else
|
||||
duration_t FAST_FUNC parse_duration_str(char *str)
|
||||
|
||||
@@ -1178,7 +1178,7 @@ void FAST_FUNC sha1_begin(sha1_ctx_t *ctx)
|
||||
if (!shaNI) {
|
||||
unsigned eax = 7, ebx = ebx, ecx = 0, edx = edx;
|
||||
cpuid(&eax, &ebx, &ecx, &edx);
|
||||
shaNI = ((ebx >> 29) << 1) - 1;
|
||||
shaNI = ((ebx >> 28) & 2) - 1; /* bit 29 -> 1 or -1 */
|
||||
}
|
||||
if (shaNI > 0)
|
||||
ctx->process_block = sha1_process_block64_shaNI;
|
||||
@@ -1232,7 +1232,7 @@ void FAST_FUNC sha256_begin(sha256_ctx_t *ctx)
|
||||
if (!shaNI) {
|
||||
unsigned eax = 7, ebx = ebx, ecx = 0, edx = edx;
|
||||
cpuid(&eax, &ebx, &ecx, &edx);
|
||||
shaNI = ((ebx >> 29) << 1) - 1;
|
||||
shaNI = ((ebx >> 28) & 2) - 1; /* bit 29 -> 1 or -1 */
|
||||
}
|
||||
if (shaNI > 0)
|
||||
ctx->process_block = sha256_process_block64_shaNI;
|
||||
|
||||
+4
-4
@@ -254,7 +254,7 @@ static NOINLINE const char *get_homedir_or_NULL(void)
|
||||
const char *home;
|
||||
|
||||
# if ENABLE_SHELL_ASH || ENABLE_SHELL_HUSH
|
||||
home = state->sh_get_var ? state->sh_get_var("HOME") : getenv("HOME");
|
||||
home = state && state->sh_get_var ? state->sh_get_var("HOME") : getenv("HOME");
|
||||
# else
|
||||
home = getenv("HOME");
|
||||
# endif
|
||||
@@ -825,8 +825,8 @@ static unsigned path_parse(char ***p)
|
||||
res[npth++] = tmp;
|
||||
}
|
||||
/* special case: "match subdirectories of the current directory" */
|
||||
/*res[npth++] = NULL; - filled by xzalloc() */
|
||||
return npth;
|
||||
/*res[npth] = NULL; - filled by xzalloc() */
|
||||
return npth + 1;
|
||||
}
|
||||
|
||||
/* Complete command, directory or file name.
|
||||
@@ -2038,7 +2038,7 @@ static void parse_and_put_prompt(const char *prmt_ptr)
|
||||
if (!cwd_buf) {
|
||||
const char *home;
|
||||
# if EDITING_HAS_sh_get_var
|
||||
cwd_buf = state->sh_get_var
|
||||
cwd_buf = state && state->sh_get_var
|
||||
? xstrdup(state->sh_get_var("PWD"))
|
||||
: xrealloc_getcwd_or_warn(NULL);
|
||||
# else
|
||||
|
||||
+1
-1
@@ -85,8 +85,8 @@
|
||||
* This brings some complications:
|
||||
*
|
||||
* + we can't use xfunc here
|
||||
* + we can't use applet_name
|
||||
* + we can't use bb_show_usage
|
||||
* + applet_name can be the name of the shell
|
||||
* (doesn't apply for killall[5], still should be careful b/c NOFORK)
|
||||
*
|
||||
* kill %n gets translated into kill ' -<process group>' by shell (note space!)
|
||||
|
||||
+4
-5
@@ -11264,8 +11264,8 @@ static smallint mail_var_path_changed;
|
||||
/*
|
||||
* Print appropriate message(s) if mail has arrived.
|
||||
* If mail_var_path_changed is set,
|
||||
* then the value of MAIL has mail_var_path_changed,
|
||||
* so we just update the values.
|
||||
* then the value of MAIL has changed,
|
||||
* so we just update the hash value.
|
||||
*/
|
||||
static void
|
||||
chkmail(void)
|
||||
@@ -11284,10 +11284,9 @@ chkmail(void)
|
||||
int len;
|
||||
|
||||
len = padvance_magic(&mpath, nullstr, 2);
|
||||
if (!len)
|
||||
if (len < 0)
|
||||
break;
|
||||
p = stackblock();
|
||||
break;
|
||||
if (*p == '\0')
|
||||
continue;
|
||||
for (q = p; *q; q++)
|
||||
@@ -11306,8 +11305,8 @@ chkmail(void)
|
||||
if (!mail_var_path_changed && mailtime_hash != new_hash) {
|
||||
if (mailtime_hash != 0)
|
||||
out2str("you have mail\n");
|
||||
mailtime_hash = new_hash;
|
||||
}
|
||||
mailtime_hash = new_hash;
|
||||
mail_var_path_changed = 0;
|
||||
popstackmark(&smark);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user