fix failures found by randomconfig builds

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko 2013-12-31 23:22:36 +01:00
parent 61be8e46a8
commit 198b02f7dd
7 changed files with 34 additions and 13 deletions

View File

@ -144,7 +144,7 @@ lib-$(CONFIG_DELUSER) += update_passwd.o
lib-$(CONFIG_PASSWD) += pw_encrypt.o update_passwd.o obscure.o
lib-$(CONFIG_CHPASSWD) += pw_encrypt.o update_passwd.o
lib-$(CONFIG_CRYPTPW) += pw_encrypt.o
lib-$(CONFIG_SULOGIN) += pw_encrypt.o
lib-$(CONFIG_SULOGIN) += pw_encrypt.o correct_password.o
lib-$(CONFIG_VLOCK) += pw_encrypt.o correct_password.o
lib-$(CONFIG_SU) += pw_encrypt.o correct_password.o
lib-$(CONFIG_LOGIN) += pw_encrypt.o correct_password.o

View File

@ -30,15 +30,6 @@
#include "libbb.h"
void FAST_FUNC nuke_str(char *str)
{
if (str) {
while (*str)
*str++ = 0;
/* or: memset(str, 0, strlen(str)); - not as small as above */
}
}
/* Ask the user for a password.
* Return 1 without asking if PW has an empty password.
* Return -1 on EOF, error while reading input, or timeout.

View File

@ -3,6 +3,7 @@
* Utility routines.
*/
//kbuild:lib-$(CONFIG_ARP) += in_ether.o
//kbuild:lib-$(CONFIG_IFCONFIG) += in_ether.o
//kbuild:lib-$(CONFIG_IFENSLAVE) += in_ether.o

21
libbb/nuke_str.c Normal file
View File

@ -0,0 +1,21 @@
/* vi: set sw=4 ts=4: */
/*
* Utility routines.
*
* Copyright (C) 2008 Denys Vlasenko
*
* Licensed under GPLv2, see file LICENSE in this source tree.
*/
//kbuild:lib-y += nuke_str.o
#include "libbb.h"
void FAST_FUNC nuke_str(char *str)
{
if (str) {
while (*str)
*str++ = 0;
/* or: memset(str, 0, strlen(str)); - not as small as above */
}
}

View File

@ -65,6 +65,7 @@ if test x"$LIBC" = x"uclibc"; then
| grep -v CONFIG_BUILD_LIBBUSYBOX \
| grep -v CONFIG_PIE \
\
| grep -v CONFIG_FEATURE_TOUCH_NODEREF \
| grep -v CONFIG_FEATURE_2_4_MODULES \
>.config.new
mv .config.new .config
@ -72,6 +73,7 @@ if test x"$LIBC" = x"uclibc"; then
echo '# CONFIG_BUILD_LIBBUSYBOX is not set' >>.config
echo '# CONFIG_PIE is not set' >>.config
echo '# CONFIG_FEATURE_2_4_MODULES is not set' >>.config
echo '# CONFIG_FEATURE_TOUCH_NODEREF is not set' >>.config
fi
# If STATIC, remove some things.

View File

@ -269,10 +269,12 @@ testing "awk FS assignment" "awk '{FS=\":\"; print \$1}'" \
"" \
"a:b c:d\ne:f g:h"
optional FEATURE_AWK_LIBM
testing "awk large integer" \
"awk 'BEGIN{n=(2^31)-1; print n, int(n), n%1, ++n, int(n), n%1}'" \
"2147483647 2147483647 0 2147483648 2147483648 0\n" \
"" ""
SKIP=
testing "awk length(array)" \
"awk 'BEGIN{ A[1]=2; A[\"qwe\"]=\"asd\"; print length(A)}'" \
@ -285,11 +287,13 @@ testing "awk -f and ARGC" \
"do re mi\n" \
'{print $2; print ARGC;}' \
optional FEATURE_AWK_GNU_EXTENSIONS
testing "awk -e and ARGC" \
"awk -e '{print \$2; print ARGC;}' input" \
"re\n2\n" \
"do re mi\n" \
"" \
""
SKIP=
# testing "description" "command" "result" "infile" "stdin"

View File

@ -25,10 +25,12 @@ tar: short read
SKIP=
optional FEATURE_SEAMLESS_GZ
# In NOMMU case, "invalid magic" message comes from gunzip child process.
# Otherwise, it comes from tar.
# Need to fix output up to avoid false positive.
testing "Empty file is not a tarball.tar.gz" '\
tar xvzf - 2>&1; echo $?
{ tar xvzf - 2>&1; echo $?; } | grep -Fv "invalid magic"
' "\
tar: invalid magic
tar: short read
1
" \