aboutsummaryrefslogtreecommitdiff
path: root/libbb (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* md5/sha512: a better fix for strict aliasing warningsDenys Vlasenko2013-06-271-3/+3
| | | | | | | The locations *are* well-aligned for direct stores on any architecture. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* md5/sha512: fix strict aliasing warningsMike Frysinger2013-06-191-3/+3
| | | | | | | | | | | | | | | | | | | | 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>
* sulogin: allow system maintenance login if root password is emptyJonathan Liu2013-05-211-1/+3
| | | | | | | | | | | | | | 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>
* ash,hush: history builtinFlemming Madsen2013-04-071-2/+14
| | | | | | | | | | | | | | | | | | function old new delta show_history - 39 +39 builtin_history - 16 +16 historycmd - 13 +13 bltins1 312 324 +12 builtintab 336 344 +8 popstring 134 140 +6 hush_main 1048 1046 -2 ash_main 1398 1396 -2 size_from_HISTFILESIZE 44 40 -4 ------------------------------------------------------------------------------ (add/remove: 3/0 grow/shrink: 3/3 up/down: 94/-8) Total: 86 bytes Signed-off-by: Flemming Madsen <busybox@themadsens.dk> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* lineedit: \W on "/bin" should show "bin", not "/bin"Denys Vlasenko2013-03-291-1/+1
| | | | | | | function old new delta parse_and_put_prompt 793 785 -8 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* lineedit: implement \T \t \A \@ prompts escapes, fix \W escape, drop \!Denys Vlasenko2013-03-291-37/+47
| | | | | | | | function old new delta parse_and_put_prompt 742 793 +51 read_line_input 3836 3826 -10 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* libbb: introduce and use strftime_[YYYYMMDD]HHMMSS()Denys Vlasenko2013-03-292-2/+22
| | | | | | | | | | | | | | | | | | function old new delta strftime_fmt - 53 +53 strftime_YYYYMMDDHHMMSS - 12 +12 strftime_HHMMSS - 12 +12 human_time 44 43 -1 fmtstr_t 9 - -9 step_time 361 345 -16 watch_main 261 232 -29 ------------------------------------------------------------------------------ (add/remove: 3/1 grow/shrink: 0/3 up/down: 77/-55) Total: 22 bytes text data bss dec hex filename 919203 932 17692 937827 e4f63 busybox_old 919209 932 17692 937833 e4f69 busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* lineedit: add handling of \H in promptDenys Vlasenko2013-03-281-5/+45
| | | | | | Based on the patch by Arnaud Rébillout <rebillout@syscom.ch> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* hexdump: don't unconditionally limit the usable address rangeDenys Vlasenko2013-03-271-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* readlink: uClibc supports automatic allocation too nowMike Frysinger2013-03-121-1/+2
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* make --help return exitcode 0. Closes 5612Denys Vlasenko2013-02-281-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* lineedit: initialize delptrShawn J. Goff2013-02-271-0/+1
| | | | | | | | In vi mode, the 'p' and 'P' commands caused a segfault when nothing had been put in the buffer yet because the delptr was not initialized. Signed-off-by: Shawn J. Goff <shawn7400@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* move endofname() to libbbDenys Vlasenko2013-02-261-0/+26
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* vasprintf: return -1 on strdup failureDenys Vlasenko2013-02-101-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* vasprintf: do not use xmalloc, it will deadlock on OOMDenys Vlasenko2013-02-071-3/+5
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* sha3: code shrinkDenys Vlasenko2013-01-201-32/+59
| | | | | | | function old new delta sha3_hash 155 101 -54 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* code shrinkDenys Vlasenko2013-01-171-8/+12
| | | | | | | | function old new delta applet_name_compare 36 31 -5 find_applet_by_name 43 25 -18 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* sha3: s/sha3_process_block76/sha3_process_block72/Denys Vlasenko2013-01-161-4/+4
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* sha3: rename KeccakF->sha3_process_block76.Denys Vlasenko2013-01-161-79/+81
| | | | | | | | This brings the naming more in line with other hashes. Pulled most statics and constants into it. Also noticed that two byte arrays are 1 element too big. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* sha3: cache ctx->bytes_queuedDenys Vlasenko2013-01-151-11/+11
| | | | | | | function old new delta sha3_hash 171 155 -16 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* sha3: remove two "small code" codepaths: I can't reproduce code size win on ↵Denys Vlasenko2013-01-151-43/+18
| | | | | | them anymore Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* sha3: tweak choice of a fast code path for 64-bitDenys Vlasenko2013-01-151-1/+2
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* sha3: cosmetic tweaks to various names, comments. No logic changes.Denys Vlasenko2013-01-151-61/+63
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* sha3: code shrinkDenys Vlasenko2013-01-151-26/+36
| | | | | | | | function old new delta KeccakF 1053 1078 +25 KeccakF_RoundConstants 192 48 -144 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* sha3: code shrinkDenys Vlasenko2013-01-151-13/+18
| | | | | | | function old new delta KeccakF 1064 1053 -11 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* sha3: another speedup for SHA3_SMALL=0 caseDenys Vlasenko2013-01-151-10/+25
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* whitespace fixes. no code changesDenys Vlasenko2013-01-151-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* sha3: make size/speed optimization decision configurableDenys Vlasenko2013-01-152-19/+68
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* whitespace cleanup. no code changesDenys Vlasenko2013-01-144-7/+7
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* sha3sum: new appletLauri Kasanen2013-01-141-0/+194
| | | | | | | | | | | | | | | | | | | | | | function old new delta KeccakF - 496 +496 KeccakF_RoundConstants - 192 +192 sha3_hash - 171 +171 sha3_end - 40 +40 hash_file 274 299 +25 KeccakF_RotationConstants - 25 +25 KeccakF_PiLane - 25 +25 packed_usage 29213 29232 +19 sha3_begin - 18 +18 KeccakF_Mod5 - 10 +10 applet_names 2445 2453 +8 applet_main 1420 1424 +4 applet_nameofs 710 712 +2 ------------------------------------------------------------------------------ (add/remove: 8/0 grow/shrink: 9/7 up/down: 1049/-54) Total: ~995 bytes Signed-off-by: Lauri Kasanen <curaga@operamail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* mark get_shell_name FAST_FUNCDenys Vlasenko2012-10-031-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* top/ps: argv0:"gdm-session-worker [pam/gdm-password]" == comm:"gdm-session-wor"Denys Vlasenko2012-10-021-0/+2
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* lineedit: in !EDITING config, return -1 on fgets errorDenys Vlasenko2012-09-271-1/+2
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* libbb: correctness/size tweaks in signal-related helpersDenys Vlasenko2012-09-271-3/+3
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* top: fix "last CPU" parsingDenys Vlasenko2012-09-061-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* refactor correct_password.c to avoid one ifwalter harms2012-09-041-6/+3
| | | | | Signed-off-by: walter harms <wharms@bfs.de> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* lineedit: fix Alt-D when cursor==0Cliff Frey2012-08-071-3/+3
| | | | | Signed-off-by: Cliff Frey <cliff@meraki.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Simplify copyright/license notice that appears in the binary.Bradley M. Kuhn2012-07-261-3/+3
| | | | | | | | | | | Existing copyright notice for binary would need to be longer to achieve optimal accuracy. This compromise punts to the source for full notices, but does note the years of the copyrights and that there are many authors, all licensing under GPLv2. Signed-off-by: Bradley M. Kuhn <bkuhn@ebb.org> Signed-off-by: Tony Sebro <tony@sfconservancy.org> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* su: do not change to home dir unless -lPascal Bellard2012-06-122-5/+7
| | | | | Signed-off-by: Pascal Bellard <pascal.bellard@ads-lu.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Add comments in keyboard escape sequences tableDenys Vlasenko2012-06-111-5/+10
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* libbb: add missing_syscalls.c: for now, only Android syscallsTias Guns2012-06-101-0/+42
| | | | | Signed-off-by: Tias Guns <tias@ulyssis.org> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* unzip: ignore chmod errorsNatanael Copa2012-05-281-1/+6
| | | | | | | | This makes unzip to FAT filesystems not exit with error. This is similar to how the "normal" unzip works. Signed-off-by: Natanael Copa <natanael.copa@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* busybox: tweak help text and copyright yearDenys Vlasenko2012-05-141-2/+2
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ln: support -T and -vSimon B2012-05-061-1/+1
| | | | | | | | | function old new delta ln_main 445 524 +79 packed_usage 29182 29179 -3 Signed-off-by: Simon B <sburnet@hotmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* get_linux_version_code: don't fail on Linux version strints like "3.0-foo"Andreas Oberritter2012-05-051-7/+4
| | | | | Signed-off-by: Andreas Oberritter <obi@opendreambox.org> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* sendmail: use host rather than NIS domain name for HELORon Yorston2012-04-281-22/+0
| | | | | | | | | | | | | | According to RFC 5321 the argument to HELO "contains the fully-qualified domain name of the SMTP client" or its IP address if no FQDN is available. BusyBox sendmail uses the NIS domain name instead which, in many cases, is likely to be the default "(none)". [vda: yes, I checked my machine and its uts.domainname was indeed "(none)"] Using the host name is more likely to satisfy the intent of the RFC while allowing the otherwise unused safe_getdomainname function to be removed. Signed-off-by: Ron Yorston <rmy@tigress.co.uk> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* lineedit: histfile can get emptied when CONFIG_FEATURE_EDITING_SAVE_ON_EXIT=yDennis Groenen2012-04-261-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When CONFIG_FEATURE_EDITING_SAVE_ON_EXIT is set to y, the histfile will get cleared if the total amount of history lines is less than MAX_HISTORY. Only if the histfile is not empty _and_ the amount of lines currently in memory are equal to or greater than MAX_HISTORY, history saving will work as expected with this feature enabled. Output from defconfig + CONFIG_FEATURE_EDITING_SAVE_ON_EXIT=y: $ echo "foo" > ~/.ash_history $ ./busybox ash ~/busybox/a $ echo "bar" > /dev/null ~/busybox/a $ exit $ cat ~/.ash_history $ Output with the patch applied and same config as above: $ echo "foo" > ~/.ash_history $ ./busybox ash ~/busybox/b $ echo "bar" > /dev/null ~/busybox/b $ exit $ cat ~/.ash_history foo echo "bar" > /dev/null exit $ Signed-off-by: Dennis Groenen <tj.groenen at gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* whitespace fixesDenys Vlasenko2012-04-201-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* fix build breakage found by randconfigDenys Vlasenko2012-04-201-0/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* busybox: tweak help textDenys Vlasenko2012-03-221-3/+6
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>