Add a helper script that lists all applets that
- do or may require SUID provileges (busybox.cfg.suid)
- do not require SUID provileges (busybox.cfg.nosuid)
Some setups prefer to build two busybox binaries, one that is suid which
contains all applets that do or may require suid privileges, and a
second one for all the rest (which drops suid). To ease splitting these
two binaries, generate a list of CONFIG_ items for the suid binary.
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
4b0bb9e0fd added this code in 2007,
then in a2215b98f7 more general fix
was added.
function old new delta
add_cmd_block 98 58 -40
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Based on patch by Paul B. Henson <henson@acm.org>
function old new delta
static.size_suffixes - 32 +32
ubi_tools_main 1141 1148 +7
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
"losetup -d" was not complaining that LOOPDEV is missing.
"losetup -a" was listing only up to /dev/loop9.
"losetup -f" looped forever if llop0 was taken, and never tried
anything after /dev/loop9.
"-o" with other options (say, -r) had no effect.
function old new delta
losetup_main 376 419 +43
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Busybox lsof used the d_type field of a 'struct dirent' to verify whether the
entry is a symbolic link. This field, however, is not portable. On at least
one board [1] I have seen, that field is 0, and the check fails even though
the entry is a link.
The explicit check for a symbolic link is really only needed to skip the
default directory entries '.' and '..'. The directory /proc/<pid>/fd/
should not contain anything else but these two and symbolic links.
With these assumptions, this patch replaces the explicit link check with a
basic check for '.' and '..' (and any hidden file). In the unlikely case that
there are other file types, xmalloc_readlink() will return NULL, and we can
skip the entry.
[1] A MIPS-based board with glibc 2.9, Linux 2.6.32.27.
Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
If the target can tolerate these issues, then gcc is smart enough
to generate the same code (x86_64 produces the same code). If the
target can't, then it needs the memcpy anyways.
libbb/hash_md5_sha.c: In function 'common64_end':
libbb/hash_md5_sha.c:87:4: warning:
dereferencing type-punned pointer will break strict-aliasing rules
*(uint64_t *) (&ctx->wbuffer[64 - 8]) = t;
libbb/hash_md5_sha.c: In function 'sha512_end':
libbb/hash_md5_sha.c:886:4: warning:
dereferencing type-punned pointer will break strict-aliasing rules
*(uint64_t *) (&ctx->wbuffer[128 - 8]) = t;
libbb/hash_md5_sha.c:889:4: warning:
dereferencing type-punned pointer will break strict-aliasing rules
*(uint64_t *) (&ctx->wbuffer[128 - 16]) = t;
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
This also fixes a minor buffer overflow when displaying threads as
add_proc() only expects COMM_LEN bytes, but we give it one more than
that.
Reported-by: Dag Wieers <dag@wieers.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
The current password checking is unable to distinguish between the user
entering an empty password or pressing Control-D. As a result, an empty
password always results in normal startup.
We modify bb_ask to return NULL if Control-D is pressed without entering
a password. The sulogin applet is then modified to only proceed to
normal startup if bb_ask returns NULL. This covers EOF with no password,
interrupt by timeout and ^C.
Signed-off-by: Jonathan Liu <net147@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>