diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2013-12-31 23:22:36 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2013-12-31 23:22:36 +0100 |
commit | 198b02f7dd61c6cb9fd4c379dc56edcf537a7ee1 (patch) | |
tree | 055b2ab0f2636e100781ddefdbf95417e44bb6df | |
parent | 61be8e46a80749fe5bb16bc8f831c689d21a4e34 (diff) | |
download | busybox-w32-198b02f7dd61c6cb9fd4c379dc56edcf537a7ee1.tar.gz busybox-w32-198b02f7dd61c6cb9fd4c379dc56edcf537a7ee1.tar.bz2 busybox-w32-198b02f7dd61c6cb9fd4c379dc56edcf537a7ee1.zip |
fix failures found by randomconfig builds
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | libbb/Kbuild.src | 2 | ||||
-rw-r--r-- | libbb/correct_password.c | 9 | ||||
-rw-r--r-- | libbb/in_ether.c | 1 | ||||
-rw-r--r-- | libbb/nuke_str.c | 21 | ||||
-rwxr-xr-x | scripts/randomtest | 2 | ||||
-rwxr-xr-x | testsuite/awk.tests | 6 | ||||
-rwxr-xr-x | testsuite/tar.tests | 6 |
7 files changed, 34 insertions, 13 deletions
diff --git a/libbb/Kbuild.src b/libbb/Kbuild.src index c5d86c092..a6468f171 100644 --- a/libbb/Kbuild.src +++ b/libbb/Kbuild.src | |||
@@ -144,7 +144,7 @@ lib-$(CONFIG_DELUSER) += update_passwd.o | |||
144 | lib-$(CONFIG_PASSWD) += pw_encrypt.o update_passwd.o obscure.o | 144 | lib-$(CONFIG_PASSWD) += pw_encrypt.o update_passwd.o obscure.o |
145 | lib-$(CONFIG_CHPASSWD) += pw_encrypt.o update_passwd.o | 145 | lib-$(CONFIG_CHPASSWD) += pw_encrypt.o update_passwd.o |
146 | lib-$(CONFIG_CRYPTPW) += pw_encrypt.o | 146 | lib-$(CONFIG_CRYPTPW) += pw_encrypt.o |
147 | lib-$(CONFIG_SULOGIN) += pw_encrypt.o | 147 | lib-$(CONFIG_SULOGIN) += pw_encrypt.o correct_password.o |
148 | lib-$(CONFIG_VLOCK) += pw_encrypt.o correct_password.o | 148 | lib-$(CONFIG_VLOCK) += pw_encrypt.o correct_password.o |
149 | lib-$(CONFIG_SU) += pw_encrypt.o correct_password.o | 149 | lib-$(CONFIG_SU) += pw_encrypt.o correct_password.o |
150 | lib-$(CONFIG_LOGIN) += pw_encrypt.o correct_password.o | 150 | lib-$(CONFIG_LOGIN) += pw_encrypt.o correct_password.o |
diff --git a/libbb/correct_password.c b/libbb/correct_password.c index 5727c65fb..acadf3914 100644 --- a/libbb/correct_password.c +++ b/libbb/correct_password.c | |||
@@ -30,15 +30,6 @@ | |||
30 | 30 | ||
31 | #include "libbb.h" | 31 | #include "libbb.h" |
32 | 32 | ||
33 | void FAST_FUNC nuke_str(char *str) | ||
34 | { | ||
35 | if (str) { | ||
36 | while (*str) | ||
37 | *str++ = 0; | ||
38 | /* or: memset(str, 0, strlen(str)); - not as small as above */ | ||
39 | } | ||
40 | } | ||
41 | |||
42 | /* Ask the user for a password. | 33 | /* Ask the user for a password. |
43 | * Return 1 without asking if PW has an empty password. | 34 | * Return 1 without asking if PW has an empty password. |
44 | * Return -1 on EOF, error while reading input, or timeout. | 35 | * Return -1 on EOF, error while reading input, or timeout. |
diff --git a/libbb/in_ether.c b/libbb/in_ether.c index dadadbafe..1de383bde 100644 --- a/libbb/in_ether.c +++ b/libbb/in_ether.c | |||
@@ -3,6 +3,7 @@ | |||
3 | * Utility routines. | 3 | * Utility routines. |
4 | */ | 4 | */ |
5 | 5 | ||
6 | //kbuild:lib-$(CONFIG_ARP) += in_ether.o | ||
6 | //kbuild:lib-$(CONFIG_IFCONFIG) += in_ether.o | 7 | //kbuild:lib-$(CONFIG_IFCONFIG) += in_ether.o |
7 | //kbuild:lib-$(CONFIG_IFENSLAVE) += in_ether.o | 8 | //kbuild:lib-$(CONFIG_IFENSLAVE) += in_ether.o |
8 | 9 | ||
diff --git a/libbb/nuke_str.c b/libbb/nuke_str.c new file mode 100644 index 000000000..56b808bc7 --- /dev/null +++ b/libbb/nuke_str.c | |||
@@ -0,0 +1,21 @@ | |||
1 | /* vi: set sw=4 ts=4: */ | ||
2 | /* | ||
3 | * Utility routines. | ||
4 | * | ||
5 | * Copyright (C) 2008 Denys Vlasenko | ||
6 | * | ||
7 | * Licensed under GPLv2, see file LICENSE in this source tree. | ||
8 | */ | ||
9 | |||
10 | //kbuild:lib-y += nuke_str.o | ||
11 | |||
12 | #include "libbb.h" | ||
13 | |||
14 | void FAST_FUNC nuke_str(char *str) | ||
15 | { | ||
16 | if (str) { | ||
17 | while (*str) | ||
18 | *str++ = 0; | ||
19 | /* or: memset(str, 0, strlen(str)); - not as small as above */ | ||
20 | } | ||
21 | } | ||
diff --git a/scripts/randomtest b/scripts/randomtest index a102593d3..d2b26bc76 100755 --- a/scripts/randomtest +++ b/scripts/randomtest | |||
@@ -65,6 +65,7 @@ if test x"$LIBC" = x"uclibc"; then | |||
65 | | grep -v CONFIG_BUILD_LIBBUSYBOX \ | 65 | | grep -v CONFIG_BUILD_LIBBUSYBOX \ |
66 | | grep -v CONFIG_PIE \ | 66 | | grep -v CONFIG_PIE \ |
67 | \ | 67 | \ |
68 | | grep -v CONFIG_FEATURE_TOUCH_NODEREF \ | ||
68 | | grep -v CONFIG_FEATURE_2_4_MODULES \ | 69 | | grep -v CONFIG_FEATURE_2_4_MODULES \ |
69 | >.config.new | 70 | >.config.new |
70 | mv .config.new .config | 71 | mv .config.new .config |
@@ -72,6 +73,7 @@ if test x"$LIBC" = x"uclibc"; then | |||
72 | echo '# CONFIG_BUILD_LIBBUSYBOX is not set' >>.config | 73 | echo '# CONFIG_BUILD_LIBBUSYBOX is not set' >>.config |
73 | echo '# CONFIG_PIE is not set' >>.config | 74 | echo '# CONFIG_PIE is not set' >>.config |
74 | echo '# CONFIG_FEATURE_2_4_MODULES is not set' >>.config | 75 | echo '# CONFIG_FEATURE_2_4_MODULES is not set' >>.config |
76 | echo '# CONFIG_FEATURE_TOUCH_NODEREF is not set' >>.config | ||
75 | fi | 77 | fi |
76 | 78 | ||
77 | # If STATIC, remove some things. | 79 | # If STATIC, remove some things. |
diff --git a/testsuite/awk.tests b/testsuite/awk.tests index 50b2a8328..132afc6a9 100755 --- a/testsuite/awk.tests +++ b/testsuite/awk.tests | |||
@@ -269,10 +269,12 @@ testing "awk FS assignment" "awk '{FS=\":\"; print \$1}'" \ | |||
269 | "" \ | 269 | "" \ |
270 | "a:b c:d\ne:f g:h" | 270 | "a:b c:d\ne:f g:h" |
271 | 271 | ||
272 | optional FEATURE_AWK_LIBM | ||
272 | testing "awk large integer" \ | 273 | testing "awk large integer" \ |
273 | "awk 'BEGIN{n=(2^31)-1; print n, int(n), n%1, ++n, int(n), n%1}'" \ | 274 | "awk 'BEGIN{n=(2^31)-1; print n, int(n), n%1, ++n, int(n), n%1}'" \ |
274 | "2147483647 2147483647 0 2147483648 2147483648 0\n" \ | 275 | "2147483647 2147483647 0 2147483648 2147483648 0\n" \ |
275 | "" "" | 276 | "" "" |
277 | SKIP= | ||
276 | 278 | ||
277 | testing "awk length(array)" \ | 279 | testing "awk length(array)" \ |
278 | "awk 'BEGIN{ A[1]=2; A[\"qwe\"]=\"asd\"; print length(A)}'" \ | 280 | "awk 'BEGIN{ A[1]=2; A[\"qwe\"]=\"asd\"; print length(A)}'" \ |
@@ -285,11 +287,13 @@ testing "awk -f and ARGC" \ | |||
285 | "do re mi\n" \ | 287 | "do re mi\n" \ |
286 | '{print $2; print ARGC;}' \ | 288 | '{print $2; print ARGC;}' \ |
287 | 289 | ||
290 | optional FEATURE_AWK_GNU_EXTENSIONS | ||
288 | testing "awk -e and ARGC" \ | 291 | testing "awk -e and ARGC" \ |
289 | "awk -e '{print \$2; print ARGC;}' input" \ | 292 | "awk -e '{print \$2; print ARGC;}' input" \ |
290 | "re\n2\n" \ | 293 | "re\n2\n" \ |
291 | "do re mi\n" \ | 294 | "do re mi\n" \ |
292 | "" \ | 295 | "" |
296 | SKIP= | ||
293 | 297 | ||
294 | # testing "description" "command" "result" "infile" "stdin" | 298 | # testing "description" "command" "result" "infile" "stdin" |
295 | 299 | ||
diff --git a/testsuite/tar.tests b/testsuite/tar.tests index 93ba5f004..9ea89f15f 100755 --- a/testsuite/tar.tests +++ b/testsuite/tar.tests | |||
@@ -25,10 +25,12 @@ tar: short read | |||
25 | SKIP= | 25 | SKIP= |
26 | 26 | ||
27 | optional FEATURE_SEAMLESS_GZ | 27 | optional FEATURE_SEAMLESS_GZ |
28 | # In NOMMU case, "invalid magic" message comes from gunzip child process. | ||
29 | # Otherwise, it comes from tar. | ||
30 | # Need to fix output up to avoid false positive. | ||
28 | testing "Empty file is not a tarball.tar.gz" '\ | 31 | testing "Empty file is not a tarball.tar.gz" '\ |
29 | tar xvzf - 2>&1; echo $? | 32 | { tar xvzf - 2>&1; echo $?; } | grep -Fv "invalid magic" |
30 | ' "\ | 33 | ' "\ |
31 | tar: invalid magic | ||
32 | tar: short read | 34 | tar: short read |
33 | 1 | 35 | 1 |
34 | " \ | 36 | " \ |