aboutsummaryrefslogtreecommitdiff
path: root/scripts/basic (follow)
Commit message (Collapse)AuthorAgeFilesLines
* fixdep: add fstat error handlingSam James2024-09-271-2/+9
| | | | | | | | | | | | | | | | | | | | | When `fstat` fails, `st` is left uninitialised. In our case, Ben Kohler noticed our release media builds were failing in Gentoo on x86 when building busybox with occasional SIGBUS. This turned out to be EOVERFLOW (from 32-bit ino_t) which wasn't being reported because nothing was checking the return value from `fstat`. Fix that to avoid UB (use of uninit var) and to give a more friendly error to the user. This actually turns out to be fixed already in the kernel from back in 2010 [0] and 2016 [1]. [0] https://github.com/torvalds/linux/commit/a3ba81131aca243bfecfa78c42edec0cd69f72d6 [1] https://github.com/torvalds/linux/commit/46fe94ad18aa7ce6b3dad8c035fb538942020f2b Reported-by: Ben Kohler <bkohler@gentoo.org> Signed-off-by: Sam James <sam@gentoo.org> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* docproc: avoid segfault during file closingYan Zhu2024-04-131-0/+1
| | | | | | | | | In the function find_export_symbols, since the fopen file does not exit when it fails, there is a dereference problem in fclose(fp), which will cause a segmentation fault. Signed-off-by: Yan Zhu <zhuyan2015@foxmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* fixdep: avoid underflow when end of entry doesn't coincide with EOFArsen Arsenović2023-02-271-0/+5
| | | | | | | Bug: https://bugs.gentoo.org/893776 Closes: https://bugs.busybox.net/show_bug.cgi?id=15326 Signed-off-by: Arsen Arsenović <arsen@gentoo.org> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* fix "warning array subscript has type 'char'"Denys Vlasenko2021-04-143-16/+16
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* build system: avoid build failure during bisectionRon Yorston2021-04-131-1/+1
| | | | | | | | | | | | | | | | | | Commit 4bdc914ff (build system: fix compiler warnings) added a test on the return value of fgets() in split-include.c. During bisection it's possible to go back to a state where a configuration value didn't exist. This results in an empty include file corresponding to the missing feature. If a subsequent bisection returns to a state where the feature exists split-include treats the empty file as an error and the build fails. Add a call to ferror() to distinguish between fgets() failing due to an error and due to there being no data to read. Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* build system: fix compiler warningsDenys Vlasenko2019-01-061-1/+2
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* typo fixesManinder Singh2015-05-251-1/+1
| | | | | Signed-off-by: Maninder Singh <maninder1.s@samsung.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* build system: stop including alloca.h, stdlib.h provides itDenys Vlasenko2014-01-092-2/+2
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* suppress "warning: implicit declaration of function 'alloca'"Denys Vlasenko2011-09-152-0/+2
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Fix double words in comments. No code changesMarek Polacek2011-04-161-1/+1
| | | | | Signed-off-by: Marek Polacek <mpolacek@redhat.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* scripts: fix fixdep.c to let it workable in cygwinMacpaul Lin2010-12-181-1/+1
| | | | | | | | | Update retrun character detection in the fixdep.c to let it work in cygwin. Signed-off-by: Macpaul Lin <macpaul@andestech.com> Signed-off-by: Greentime <green.hu@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Revert "scripts: fix fixdep.c to let it workable in cygwin"Denys Vlasenko2010-12-181-1/+1
| | | | This reverts commit 10c36b86574133bb1cd29ad04db64c7953b94ab5.
* scripts: fix fixdep.c to let it workable in cygwinGreentime2010-12-181-1/+1
| | | | | | | | | Update return character detection in the fixdep.c to let it workable in cygwin. Signed-off-by: Macpaul Lin <macpaul@andestech.com> Signed-off-by: Greentime <green.hu@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* *: trailing empty lines removedDenys Vlasenko2010-07-261-1/+0
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* *: introduce and use xfork() and xvfork()Pascal Bellard2010-07-041-1/+1
| | | | | | | | | | | | | | | | function old new delta launch_helper 170 169 -1 setup_heredoc 312 302 -10 handle_dir_common 367 354 -13 expand_vars_to_list 2456 2443 -13 open_transformer 89 74 -15 data_extract_to_command 439 423 -16 do_ipaddr 1406 1389 -17 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/7 up/down: 0/-85) Total: -85 bytes Signed-off-by: Pascal Bellard <pascal.bellard@ads-lu.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* fix extra bogus files generation in include/config/*Denys Vlasenko2010-06-172-7/+13
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Hurd compat fixes. Mostly dealing with absent PATH_MAXJérémie Koenig2010-03-262-12/+14
| | | | | Signed-off-by: Jérémie Koenig <jk@jk.fr.eu.org> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* scripts/basic/docproc.c: remove stray NUL byte from the sourceDenys Vlasenko2010-01-121-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* add .gitignore filesMike Frysinger2009-05-051-0/+4
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* *: mass renaming of USE_XXXX to IF_XXXXDenis Vlasenko2009-04-211-13/+17
| | | | | | and SKIP_XXXX to IF_NOT_XXXX - the second one was especially badly named. It was not skipping anything!
* libbb: [x]fopen_for_{read,write} introduced and used.Denis Vlasenko2008-07-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (by Valdimir) function old new delta config_open2 - 41 +41 config_read 507 542 +35 find_pair 169 187 +18 fopen_for_write - 14 +14 fopen_for_read - 14 +14 find_main 406 418 +12 xfopen_for_write - 10 +10 xfopen_for_read - 10 +10 popstring 134 140 +6 parse_inittab 396 401 +5 next_token 923 928 +5 pack_gzip 1659 1661 +2 bb__parsespent 117 119 +2 fallbackSort 1719 1717 -2 evalvar 1376 1374 -2 qrealloc 36 33 -3 ... ... ... ... singlemount 4579 4569 -10 process_stdin 443 433 -10 patch_main 1111 1101 -10 ifupdown_main 2175 2165 -10 file_action_grep 90 80 -10 uuidcache_init 649 637 -12 hush_main 797 785 -12 read_config 230 217 -13 dpkg_main 3835 3820 -15 read_line_input 3134 3110 -24 sysctl_main 232 203 -29 config_open 40 10 -30 WARN_BAD_LINE 44 - -44 login_main 1714 1575 -139 ------------------------------------------------------------------------------ (add/remove: 5/1 grow/shrink: 8/74 up/down: 174/-737) Total: -563 bytes
* whitespace fixesDenis Vlasenko2007-05-301-26/+26
|
* style fixes. No code changesDenis Vlasenko2007-04-121-2/+2
|
* - sed -e "s/char[[:space:]]*\*[[:space:]]*argv\[\]/char **argv/g"Bernhard Reutner-Fischer2007-04-042-2/+2
|
* fixdep.c: avoit doing memcmp in most casesDenis Vlasenko2006-12-301-3/+3
| | | | | uidgid_get.c: add forgotten copyright notice pwd/grp/shadow: avoid collisions with libc names
* saw commit of vapier@busybox.net (thanks!),Denis Vlasenko2006-12-301-17/+22
| | | | | decided to stop doing FOUR memcmp's per each input character. I should have fixed this much earlier...
* prevent accessing memory that we dont ownMike Frysinger2006-12-301-5/+5
|
* "kernel config" -> "busybox config"Denis Vlasenko2006-11-301-1/+1
| | | | suggested by Roberto A. Foglietta <roberto.foglietta@gmail.com>
* build system: check for ENABLE_, USE_ and SKIP_ (not only for CONFIG_)Denis Vlasenko2006-10-191-15/+21
|
* build system overhaulDenis Vlasenko2006-10-054-0/+1035