summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2010-12-21 04:31:47 (GMT)
committer Denys Vlasenko <vda.linux@googlemail.com>2010-12-21 04:31:47 (GMT)
commit2a1571bfa003233470140a17be4ae4f0239f5a24 (patch)
tree57d2118dfaf31f19a0c5ad0acd8eb89a1c2cbfe7
parent5ab20641d687bfe4d86d255f8c369af54b6026e7 (diff)
downloadbusybox-refs/tags/1_18_1.tar.gz
busybox-refs/tags/1_18_1.tar.bz2
apply post-1.18.0 patches, bump version to 1.18.11_18_1
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--Config.in5
-rw-r--r--Makefile2
-rw-r--r--include/applets.src.h5
-rw-r--r--libbb/pw_encrypt_sha.c50
-rw-r--r--miscutils/chat.c17
-rw-r--r--runit/runsvdir.c7
-rwxr-xr-xscripts/gen_build_files.sh6
-rw-r--r--shell/hush.c45
8 files changed, 75 insertions, 62 deletions
diff --git a/Config.in b/Config.in
index d9c8231..140572e 100644
--- a/Config.in
+++ b/Config.in
@@ -128,8 +128,9 @@ config INSTALL_NO_USR
default n
depends on FEATURE_INSTALLER
help
- Disable use of /usr. busybox --install will install applets
- only to /bin and /sbin, never to /usr/bin or /usr/sbin.
+ Disable use of /usr. busybox --install and "make install"
+ will install applets only to /bin and /sbin,
+ never to /usr/bin or /usr/sbin.
config LOCALE_SUPPORT
bool "Enable locale support (system needs locale for this to work)"
diff --git a/Makefile b/Makefile
index 1a9b676..f690ff4 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
VERSION = 1
PATCHLEVEL = 18
-SUBLEVEL = 0
+SUBLEVEL = 1
EXTRAVERSION =
NAME = Unnamed
diff --git a/include/applets.src.h b/include/applets.src.h
index 06b4fff..f4fab53 100644
--- a/include/applets.src.h
+++ b/include/applets.src.h
@@ -56,6 +56,11 @@ s - suid type:
# define APPLET_NOFORK(name,main,l,s,name2) { #name, #main, l, s, 1, 1 },
#endif
+#if ENABLE_INSTALL_NO_USR
+# define _BB_DIR_USR_BIN _BB_DIR_BIN
+# define _BB_DIR_USR_SBIN _BB_DIR_SBIN
+#endif
+
INSERT
IF_TEST(APPLET_NOFORK([, test, _BB_DIR_USR_BIN, _BB_SUID_DROP, test))
diff --git a/libbb/pw_encrypt_sha.c b/libbb/pw_encrypt_sha.c
index e46848b..8aeaaca 100644
--- a/libbb/pw_encrypt_sha.c
+++ b/libbb/pw_encrypt_sha.c
@@ -3,7 +3,7 @@
*/
/* Prefix for optional rounds specification. */
-static const char str_rounds[] = "rounds=%u$";
+static const char str_rounds[] ALIGN1 = "rounds=%u$";
/* Maximum salt string length. */
#define SALT_LEN_MAX 16
@@ -19,8 +19,8 @@ NOINLINE
sha_crypt(/*const*/ char *key_data, /*const*/ char *salt_data)
{
void (*sha_begin)(void *ctx) FAST_FUNC;
- void (*sha_hash)(const void *buffer, size_t len, void *ctx) FAST_FUNC;
- void (*sha_end)(void *resbuf, void *ctx) FAST_FUNC;
+ void (*sha_hash)(void *ctx, const void *buffer, size_t len) FAST_FUNC;
+ void (*sha_end)(void *ctx, void *resbuf) FAST_FUNC;
int _32or64;
char *result, *resptr;
@@ -103,40 +103,40 @@ sha_crypt(/*const*/ char *key_data, /*const*/ char *salt_data)
/* Add KEY, SALT. */
sha_begin(&ctx);
- sha_hash(key_data, key_len, &ctx);
- sha_hash(salt_data, salt_len, &ctx);
+ sha_hash(&ctx, key_data, key_len);
+ sha_hash(&ctx, salt_data, salt_len);
/* Compute alternate SHA sum with input KEY, SALT, and KEY.
The final result will be added to the first context. */
sha_begin(&alt_ctx);
- sha_hash(key_data, key_len, &alt_ctx);
- sha_hash(salt_data, salt_len, &alt_ctx);
- sha_hash(key_data, key_len, &alt_ctx);
- sha_end(alt_result, &alt_ctx);
+ sha_hash(&alt_ctx, key_data, key_len);
+ sha_hash(&alt_ctx, salt_data, salt_len);
+ sha_hash(&alt_ctx, key_data, key_len);
+ sha_end(&alt_ctx, alt_result);
/* Add result of this to the other context. */
/* Add for any character in the key one byte of the alternate sum. */
for (cnt = key_len; cnt > _32or64; cnt -= _32or64)
- sha_hash(alt_result, _32or64, &ctx);
- sha_hash(alt_result, cnt, &ctx);
+ sha_hash(&ctx, alt_result, _32or64);
+ sha_hash(&ctx, alt_result, cnt);
/* Take the binary representation of the length of the key and for every
1 add the alternate sum, for every 0 the key. */
for (cnt = key_len; cnt != 0; cnt >>= 1)
if ((cnt & 1) != 0)
- sha_hash(alt_result, _32or64, &ctx);
+ sha_hash(&ctx, alt_result, _32or64);
else
- sha_hash(key_data, key_len, &ctx);
+ sha_hash(&ctx, key_data, key_len);
/* Create intermediate result. */
- sha_end(alt_result, &ctx);
+ sha_end(&ctx, alt_result);
/* Start computation of P byte sequence. */
/* For every character in the password add the entire password. */
sha_begin(&alt_ctx);
for (cnt = 0; cnt < key_len; ++cnt)
- sha_hash(key_data, key_len, &alt_ctx);
- sha_end(temp_result, &alt_ctx);
+ sha_hash(&alt_ctx, key_data, key_len);
+ sha_end(&alt_ctx, temp_result);
/* NB: past this point, raw key_data is not used anymore */
@@ -153,8 +153,8 @@ sha_crypt(/*const*/ char *key_data, /*const*/ char *salt_data)
/* For every character in the password add the entire password. */
sha_begin(&alt_ctx);
for (cnt = 0; cnt < 16 + alt_result[0]; ++cnt)
- sha_hash(salt_data, salt_len, &alt_ctx);
- sha_end(temp_result, &alt_ctx);
+ sha_hash(&alt_ctx, salt_data, salt_len);
+ sha_end(&alt_ctx, temp_result);
/* NB: past this point, raw salt_data is not used anymore */
@@ -174,22 +174,22 @@ sha_crypt(/*const*/ char *key_data, /*const*/ char *salt_data)
/* Add key or last result. */
if ((cnt & 1) != 0)
- sha_hash(p_bytes, key_len, &ctx);
+ sha_hash(&ctx, p_bytes, key_len);
else
- sha_hash(alt_result, _32or64, &ctx);
+ sha_hash(&ctx, alt_result, _32or64);
/* Add salt for numbers not divisible by 3. */
if (cnt % 3 != 0)
- sha_hash(s_bytes, salt_len, &ctx);
+ sha_hash(&ctx, s_bytes, salt_len);
/* Add key for numbers not divisible by 7. */
if (cnt % 7 != 0)
- sha_hash(p_bytes, key_len, &ctx);
+ sha_hash(&ctx, p_bytes, key_len);
/* Add key or last result. */
if ((cnt & 1) != 0)
- sha_hash(alt_result, _32or64, &ctx);
+ sha_hash(&ctx, alt_result, _32or64);
else
- sha_hash(p_bytes, key_len, &ctx);
+ sha_hash(&ctx, p_bytes, key_len);
- sha_end(alt_result, &ctx);
+ sha_end(&ctx, alt_result);
}
/* Append encrypted password to result buffer */
diff --git a/miscutils/chat.c b/miscutils/chat.c
index 8b151fd..d8370a9 100644
--- a/miscutils/chat.c
+++ b/miscutils/chat.c
@@ -175,23 +175,24 @@ int chat_main(int argc UNUSED_PARAM, char **argv)
llist_add_to_end(&aborts, arg);
#if ENABLE_FEATURE_CHAT_CLR_ABORT
} else if (DIR_CLR_ABORT == key) {
+ llist_t *l;
// remove the string from abort conditions
// N.B. gotta refresh maximum length too...
-#if ENABLE_FEATURE_CHAT_VAR_ABORT_LEN
+# if ENABLE_FEATURE_CHAT_VAR_ABORT_LEN
max_abort_len = 0;
-#endif
- for (llist_t *l = aborts; l; l = l->link) {
-#if ENABLE_FEATURE_CHAT_VAR_ABORT_LEN
+# endif
+ for (l = aborts; l; l = l->link) {
+# if ENABLE_FEATURE_CHAT_VAR_ABORT_LEN
size_t len = strlen(l->data);
-#endif
- if (!strcmp(arg, l->data)) {
+# endif
+ if (strcmp(arg, l->data) == 0) {
llist_unlink(&aborts, l);
continue;
}
-#if ENABLE_FEATURE_CHAT_VAR_ABORT_LEN
+# if ENABLE_FEATURE_CHAT_VAR_ABORT_LEN
if (len > max_abort_len)
max_abort_len = len;
-#endif
+# endif
}
#endif
} else if (DIR_TIMEOUT == key) {
diff --git a/runit/runsvdir.c b/runit/runsvdir.c
index e77eeff..1666642 100644
--- a/runit/runsvdir.c
+++ b/runit/runsvdir.c
@@ -312,8 +312,11 @@ int runsvdir_main(int argc UNUSED_PARAM, char **argv)
last_mtime = s.st_mtime;
last_dev = s.st_dev;
last_ino = s.st_ino;
- //if (now <= mtime)
- // sleep(1);
+ /* if the svdir changed this very second, wait until the
+ * next second, because we won't be able to detect more
+ * changes within this second */
+ while (time(NULL) == last_mtime)
+ usleep(100000);
need_rescan = do_rescan();
while (fchdir(curdir) == -1) {
warn2_cannot("change directory, pausing", "");
diff --git a/scripts/gen_build_files.sh b/scripts/gen_build_files.sh
index 130269b..620f495 100755
--- a/scripts/gen_build_files.sh
+++ b/scripts/gen_build_files.sh
@@ -18,14 +18,14 @@ generate()
local src="$1" dst="$2" header="$3" insert="$4"
#chk "${dst}"
(
- echo "${header}"
+ printf "%s\n" "${header}"
if grep -qs '^INSERT$' "${src}"; then
sed -n '1,/^INSERT$/p' "${src}"
- echo "${insert}"
+ printf "%s\n" "${insert}"
sed -n '/^INSERT$/,$p' "${src}"
else
if [ -n "${insert}" ]; then
- echo "ERROR: INSERT line missing in: ${src}" 1>&2
+ printf "%s\n" "ERROR: INSERT line missing in: ${src}" 1>&2
fi
cat "${src}"
fi
diff --git a/shell/hush.c b/shell/hush.c
index 26a5074..fa7e4f5 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -6995,27 +6995,30 @@ static int run_list(struct pipe *pi)
#if ENABLE_HUSH_LOOPS
/* Check syntax for "for" */
- for (struct pipe *cpipe = pi; cpipe; cpipe = cpipe->next) {
- if (cpipe->res_word != RES_FOR && cpipe->res_word != RES_IN)
- continue;
- /* current word is FOR or IN (BOLD in comments below) */
- if (cpipe->next == NULL) {
- syntax_error("malformed for");
- debug_leave();
- debug_printf_exec("run_list lvl %d return 1\n", G.run_list_level);
- return 1;
- }
- /* "FOR v; do ..." and "for v IN a b; do..." are ok */
- if (cpipe->next->res_word == RES_DO)
- continue;
- /* next word is not "do". It must be "in" then ("FOR v in ...") */
- if (cpipe->res_word == RES_IN /* "for v IN a b; not_do..."? */
- || cpipe->next->res_word != RES_IN /* FOR v not_do_and_not_in..."? */
- ) {
- syntax_error("malformed for");
- debug_leave();
- debug_printf_exec("run_list lvl %d return 1\n", G.run_list_level);
- return 1;
+ {
+ struct pipe *cpipe;
+ for (cpipe = pi; cpipe; cpipe = cpipe->next) {
+ if (cpipe->res_word != RES_FOR && cpipe->res_word != RES_IN)
+ continue;
+ /* current word is FOR or IN (BOLD in comments below) */
+ if (cpipe->next == NULL) {
+ syntax_error("malformed for");
+ debug_leave();
+ debug_printf_exec("run_list lvl %d return 1\n", G.run_list_level);
+ return 1;
+ }
+ /* "FOR v; do ..." and "for v IN a b; do..." are ok */
+ if (cpipe->next->res_word == RES_DO)
+ continue;
+ /* next word is not "do". It must be "in" then ("FOR v in ...") */
+ if (cpipe->res_word == RES_IN /* "for v IN a b; not_do..."? */
+ || cpipe->next->res_word != RES_IN /* FOR v not_do_and_not_in..."? */
+ ) {
+ syntax_error("malformed for");
+ debug_leave();
+ debug_printf_exec("run_list lvl %d return 1\n", G.run_list_level);
+ return 1;
+ }
}
}
#endif