Commit Graph

660 Commits

Author SHA1 Message Date
Paul Fox
986ab525b8 ensure that corrupted file extraction causes both a message and
a failure exit code.  delay the error exit until all (good) files
have been extracted.

filesystem errors (nodes of wrong type, permission problems, etc)
still cause immediate failure.
2006-03-27 23:09:14 +00:00
Bernhard Reutner-Fischer
df10094870 - revert back to r14406 2006-03-13 19:04:00 +00:00
Rob Landley
c5b1d4d6b1 Patch from Denis Vlasenko to add xstat() and use it. 2006-03-13 15:45:16 +00:00
Rob Landley
bc68cd14cc Patch from Denis Vlasenko turning static const int (which gets emitted into
the busybox binary) into enums (which don't).
2006-03-10 19:22:06 +00:00
Rob Landley
49a5599ae9 Patch from Denis Vlasenko to make unlzma smaller. 2006-03-09 17:51:25 +00:00
Bernhard Reutner-Fischer
07a79e75f5 - backout using features which are not available with the previous stable
version of make (3.71.1).
2006-03-09 09:03:37 +00:00
Rob Landley
dfba741457 Robert P. Day removed 8 gazillion occurrences of "extern" on function
definitions.  (That should only be on prototypes.)
2006-03-06 20:47:33 +00:00
Rob Landley
688ed0d760 Patch from Robert P. Day, moving byte order checks to use platform.h macros. 2006-03-04 22:40:25 +00:00
Bernhard Reutner-Fischer
022eb311d5 - use absolute path for top_builddir and top_srcdir.
Fixes make trying to include the very same file in an endless loop.
2006-03-02 17:33:25 +00:00
Bernhard Reutner-Fischer
5d26126b9e - fixes parallel builds (make -j)
- use less resources for the buildsystem itself
2006-03-01 22:54:48 +00:00
Rob Landley
e7c43b66d7 Cleanup patch from Denis Vlasenko. Mostly variants of removing the if(x)
from before "if(x) free(x)".
2006-03-01 16:39:45 +00:00
"Vladimir N. Oleynik"
325da7b509 use bb_xstrndup vs strndup. Thanks rfelker. 2006-03-01 05:39:41 +00:00
Rob Landley
0a7c8ef6e2 Patch from Denis Vlasenko to constify things and fix a few typos. 2006-02-22 17:01:00 +00:00
Rob Landley
d6e14d8bee Don't build directory libraries unless we're building an applet that needs it.
Cherry-picked from Devin Bayer's big MacOS X patch.
2006-02-21 19:11:35 +00:00
Rob Landley
06249fee39 Bug 640: a filename of length exactly 100 could bleed into the next field on
display or extract.  (Only shows up when no gnu longname extension, either
because it's disabled or because tarball hasn't got it.)
2006-02-20 19:28:53 +00:00
Rob Landley
eb00afb2d5 The gentoo security guys found another way to segfault busybox's decompression
code: we can do a null dereference if one of our huffman tables has all zero
length codes.  This fixes it.  (Thanks solar.)
2006-02-20 02:18:03 +00:00
Rob Landley
efae294b15 Fix for an integer overflow bug that could cause a segfault on certain
pathological archives.

(Unlikely to have security implications, the only way to trigger it basically
wound up doing memset(dbuf,x,2^31) and triggering an immediate segfault.  The
test basically gives us a more polite error message.)

Thanks to Ned Ludd and the Gentoo security guys for finding this.
2006-02-17 05:19:40 +00:00
Rob Landley
2c98c40ec8 The tendency of vi to auto-indent can be really annoying at times. 2006-02-17 05:12:03 +00:00
Rob Landley
f856eabcde More whitespace than you can possibly imagine... 2006-02-17 03:43:49 +00:00
Mike Frysinger
b38673fb9f make the build system puuuuuuuuuuurty 2006-02-02 01:41:53 +00:00
Eric Andersen
2cdd4d56ff passing around an int as a void* is a very bad idea 2006-01-30 18:33:12 +00:00
Eric Andersen
d78aea8b8e sort out yet more type issues 2006-01-30 18:00:02 +00:00
Eric Andersen
f55289f4b9 fixup a few types to prevent gcc (rightfully) whining about mixing
signed and unsigned, unmatches pointer target types, etc
2006-01-30 17:27:00 +00:00
Bernhard Reutner-Fischer
20f4000086 - add some ATTRIBUTE_UNUSED.
- use shorter boilerplate while at it.
2006-01-30 17:17:14 +00:00
Tim Riker
c1ef7bdd8d just whitespace 2006-01-25 00:08:53 +00:00
Bernhard Reutner-Fischer
86f5c9906b - add platform.h.
- use shorter boilerplate while at it.
2006-01-22 22:55:11 +00:00
Rob Landley
c1d69906a0 Patch from Aurelien Jacobs to add unlzma. (A new decompression type,
see www.7-zip.org)
2006-01-20 18:28:50 +00:00
Bernhard Reutner-Fischer
7ca61b6f33 - shared libbusybox.
- IMA compilation option (aka IPO, IPA,..)
Please holler if i broke something..
2006-01-15 14:04:57 +00:00
Rob Landley
9e4100bf95 Don't return 0 when there's an error. 2006-01-10 06:19:56 +00:00
Rob Landley
e569553aa0 Bug 547: writing out the tar file header before we confirm we can actually
open and read from the file isn't something we can recover from after the
fact.  Resequence things to check first, write second.
2006-01-09 03:07:44 +00:00
Mike Frysinger
5990efb795 use MAP_PRIVATE instead of MAP_SHARED for uClinux systems (see Bug 550) 2006-01-04 07:31:19 +00:00
Bernhard Reutner-Fischer
823f80f5ad - silence warning about unused param
needs revisit later on like many others to use ATTRIBUTE_UNUSED from platform.h
2005-12-29 21:17:05 +00:00
Rob Landley
1a78103306 Bug 601: When we fork an archiver and feed stuff to it through a pipe, if
we don't close the pipe the child process won't exit, and we'll hang in
waitpid().
2005-12-16 21:33:10 +00:00
Bernhard Reutner-Fischer
126da9ec2d - typo: s/sucess/success/g
What's up with loginutils/su.c line 42: "SYSLOG_SUCESS" ? Please have a look..
2005-12-12 11:20:39 +00:00
"Vladimir N. Oleynik"
a62b0e7459 reduce 3 warning if compile with -W 2005-12-06 12:20:57 +00:00
Rob Landley
5412843e79 I noticed that "tar tvjf file.tbz" was segfaulting. This fixed it. 2005-11-12 02:54:06 +00:00
Rob Landley
f3d6c94c7f Add --no-same-owner and --no-same-permissions options to tar. 2005-10-27 22:49:08 +00:00
Rob Landley
a4d45d423f The fact "tar tvjf thing.tbz" didn't work was due to the "-1" in -r11859,
which was apparently never tested.  That meant that there always had
to be at least one unparsed argument left over, which is not the case for
tar.
2005-10-16 08:42:18 +00:00
Rob Landley
60fe7bfa41 Whitespace and curly bracket cleanup (our tabstop is 4 in busybox),
and switch more stuff from CONFIG to ENABLE.
2005-10-16 03:54:49 +00:00
"Vladimir N. Oleynik"
84e7511607 llist must initialize, add loses ifdef, small indent correction 2005-10-15 06:32:38 +00:00
Rob Landley
3ee6c24ea2 Add --exclude option (to make uClibc-0.9.28 headers install using busybox tar).
I have no idea how to apply bb_getopt_complementally to a --longopt that
has no short option.  The documentation from vodz has a bad case of
babelfish poisoning, and I can't understand it.  It sort of seems to
suggest there is a way, but what it is I have no idea.  So I used \n as
the short option, which is fairly unlikely to be used for something else. :)
2005-10-15 03:06:21 +00:00
"Vladimir N. Oleynik"
f704b27b5b - new bb_opt_complementally syntax, use [-:?] only - 'free' chars
- new bb_getopt_ulflags features: check max and min args, convert first argv to options special for ar and tar applets
- use bb_default_error_retval for env applet
2005-10-14 09:56:52 +00:00
Bernhard Reutner-Fischer
309dc2d642 - typo in makefile variable: s/archvial/archival/ 2005-10-13 10:19:35 +00:00
"Vladimir N. Oleynik"
6c35c7c976 usage bb_dev_null 2005-10-12 15:34:25 +00:00
"Vladimir N. Oleynik"
f1ab127077 Prepend '-' to the first argument if required, more const, indent 2005-10-12 08:34:27 +00:00
"Vladimir N. Oleynik"
f588869696 new featured bb_opt_complementally, correct argc checking 2005-10-12 08:17:29 +00:00
Rob Landley
161aae7273 There doesn't seem to be a standard header for makedev(), but this is close. 2005-10-11 20:17:30 +00:00
"Vladimir N. Oleynik"
064f04e7e2 - use complementally '!' to '?' - 'ask' is best 'free' char for this.
- more long opt compatibility, can set flag for long opt struct now
- more logic: check opt-depend requires and global requires, special for 'id' and 'start-stop-daemon' applets.
2005-10-11 14:38:01 +00:00
"Vladimir N. Oleynik"
083d3f49c2 bb_mkdep: Rewroted. removed problem "include name must uniq", speed up * 3.
e2fsprogs: remove confuse bb_mkdep. Use internal e2fsprogs includes only.
other: remove confuse bb_mkdep.
2005-10-10 11:35:17 +00:00
Bernhard Reutner-Fischer
0b42a6a8cf - remove superfluous C statements ";;" in decompress_unzip.c, dpkg_deb.c ifconfig.c
- gzip.c: see if O_NOFOLLOW is defined before using it, else take alternate path
closes bug #221 (partially; The rest will follow later).
2005-10-07 11:34:50 +00:00
"Vladimir N. Oleynik"
39a841cecf change interface to bb_xasprintf() - more perfect for me.
ln.c: error_msg(str)->error_msg(%s, str) - remove standart "feature" for hackers
reduce 100 bytes don't care in sum
2005-09-29 16:18:57 +00:00
Rob Landley
1ff789c567 Stop gcc4 from nit-picking about signedness of char *. 2005-09-25 03:12:26 +00:00
Mike Frysinger
62f18e1f20 use the shorter license header 2005-09-24 07:16:29 +00:00
Mike Frysinger
0d4ee68be5 use brief license line 2005-09-24 06:01:57 +00:00
Bernhard Reutner-Fischer
d5bd137a24 - rename libbb's password helpers as suggested in libbb.h
my_getpwnam -> bb_xgetpwnam  /* dies on error */
  my_getgrnam -> bb_xgetgrnam  /* dies on error */
  my_getgrgid -> bb_getgrgid
  my_getpwuid -> bb_getpwuid
  my_getug    -> bb_getug
2005-09-20 21:06:17 +00:00
Rob Landley
2d2c868aab Patch from Berhnard Fischer to keep duplicate objects out of the library. 2005-09-14 15:41:18 +00:00
"Vladimir N. Oleynik"
0c520e03b9 remove unrequired dependences 2005-09-14 15:36:56 +00:00
Rob Landley
b7128c6236 Cleanup patch by Bernhard Fischer, removing unnecessary includes of
getopt.h, whitespace changes, typos, etc.
2005-09-11 01:05:30 +00:00
"Vladimir N. Oleynik"
1443487c92 typo, thanks, Bernhard Fischer 2005-09-06 13:21:39 +00:00
"Vladimir N. Oleynik"
27421a1878 1) bb_opt_complementaly -> bb_opt_complementally
2) better support long options
3) new flag '!' for bb_opt_complementally: produce bb_show_usage() if BB_GETOPT_ERROR internally
2005-09-05 14:46:07 +00:00
Rob Landley
92255d60b8 Fix for bug 383: attempting to "tar c /" would error out because stripping
trailing / turns that into an empty string.
2005-09-01 11:36:21 +00:00
Rob Landley
29ee76cb2b Anand Avati hit an integer overflow problem in our unzip code. 2005-08-31 22:03:15 +00:00
Rob Landley
c8b8a2d0cf Don't comment warnings, _FIX_ warnings. (And putting in #warnings about
other warnings is just gross.)

On a side note, while I was there, I made the code slightly smaller.
2005-08-30 20:26:17 +00:00
Rob Landley
cc8885f6f3 Dirk Clemens pointed out how easy it is to support bzip2 compression, since we
shell out to an external program to handle gzip anyway...
2005-08-30 03:40:03 +00:00
Mike Frysinger
1eef0c4571 Bernhard Fischer says: use xmalloc() instead of malloc() 2005-08-16 05:32:42 +00:00
Mike Frysinger
cc428da83f punt unused variable 2005-07-30 08:58:19 +00:00
Mike Frysinger
d6a2d41db2 tell people to ignore the save_name warning 2005-07-30 08:57:35 +00:00
Mike Frysinger
69024551bf rename the accept/reject names since accept overrides the accept() socket function 2005-07-30 07:30:26 +00:00
Mike Frysinger
4d00896d05 use toplevel ARFLAGS and update default ARFLAGS to be quiet 2005-07-27 01:09:24 +00:00
Paul Fox
37dd6247dd applying fix for:
0000093: Patch for dpkg - can't handle scripts
	      Attached patch is needed to fix dpkg's support for preinst,
	       postinst etc script files.
2005-07-22 13:17:41 +00:00
Paul Fox
0840b76602 applying fixes from:
0000142: unzip enhancements
2005-07-20 20:26:49 +00:00
Paul Fox
94ff9f1010 applying fix for:
0000262: tar -x doesn't believe it has reached the end of archive
2005-07-20 19:24:13 +00:00
Mike Frysinger
348e84c202 change the hardcoded error constant (0x80000000UL) to a nice flexible define (BB_GETOPT_ERROR) 2005-05-11 00:39:03 +00:00
Mike Frysinger
ae38d65e95 abort if user passes -r or if they dont pass anything 2005-05-09 21:51:41 +00:00
Mike Frysinger
19d7021d99 add comments about ignoring some warnings which are OK 2005-04-23 01:43:07 +00:00
Mike Frysinger
5c9ed9f41a fix printf warning 2005-04-20 00:28:44 +00:00
Eric Andersen
14f5c8d764 Patch from Bernhard Fischer to make a bunch of symbols static
which were otherwise cluttering the global namespace.
2005-04-16 19:39:00 +00:00
Mike Frysinger
4e5936ef95 In Bug 208, bernhardf writes:
On machines with only ANSI compliant compilers, not explitily delcaring
an empty parameter list 'void' causes failure.
2005-04-16 04:30:38 +00:00
Manuel Novoa III
df7bfb433e Bandaid to make "gzip file1 file2 ..." set the decompression lengths correctly
in the 2nd and later headers.  But this and gunzip really need to be rewritten.
2005-03-02 04:10:46 +00:00
Manuel Novoa III
0d8c652c46 When filling the bit buffer, gzip decompression apparently never checked for end of file, causing it to hang on corrupted input. 2005-03-01 19:29:29 +00:00
Eric Andersen
d2fe81706c Takeharu KATO writes:
Hi,

I found that gcc in cvs (HEAD in 2005/02/11) reject the gzip source
in the busybox.

This is caused by changing gcc's error handling behavior(
The gcc check the function prototype more strictly).

I show the compilation log as follow:
-- compilation log

-- compilation log
To fix the problem, apply the patch which is attached with this
mail.

Please take a look the patch and apply the patch into svn repository.
2005-02-11 19:06:51 +00:00
Rob Landley
ec4f3d95e7 Minor in-passing crapectomy. 2004-12-17 05:23:36 +00:00
Rob Landley
a8b98d63e7 Don't document compiler warnings. _FIX_ compiler warnings. 2004-11-16 12:07:04 +00:00
Eric Andersen
0e020d1025 Make certain clients of bb_make_directory default to honoring
the user's umask
2004-10-13 06:25:52 +00:00
Eric Andersen
7daa076d3e egor duda writes:
Hi!

I've created a patch to busybox' build system to allow building it in
separate tree in a manner similar to kbuild from kernel version 2.6.

That is, one runs command like
'make O=/build/some/where/for/specific/target/and/options'
and everything is built in this exact directory, provided that it exists.

I understand that applyingc such invasive changes during 'release
candidates' stage of development is at best unwise. So, i'm currently
asking for comments about this patch, starting from whether such thing
is needed at all to whether it coded properly.

'make check' should work now, and one make creates Makefile in build
directory, so one can run 'make' in build directory after that.

One possible caveat is that if we build in some directory other than
source one, the source directory should be 'distclean'ed first.

egor
2004-10-08 07:46:08 +00:00
Eric Andersen
d952ee2e9e Make it more apparent that archive creation is not supported 2004-10-07 00:35:59 +00:00
Eric Andersen
b225e2a76b Fixup some warnings 2004-08-28 00:43:07 +00:00
Eric Andersen
52499cb9ae Tito writes:
Hi,
I've spent the half night staring at the devilish  my_getpwuid and my_getgrgid functions
trying to find out a way to avoid actual and future potential buffer overflow problems
without breaking existing code.
Finally I've  found a not intrusive way to do this that surely doesn't break existing code
and fixes a couple of problems too.
The attached patch:
1) changes the behaviour of my_getpwuid and my_getgrgid to avoid potetntial buffer overflows
2) fixes all occurences of this function calls in tar.c , id.c , ls.c, whoami.c, logger.c, libbb.h.
3) The behaviour of tar, ls and  logger is unchanged.
4) The behavior of ps with somewhat longer usernames messing up output is fixed.
5) The only bigger change was the increasing of size of the buffers in id.c to avoid
     false negatives (unknown user: xxxxxx) with usernames longer than 8 chars.
     The value i used ( 32 chars ) was taken from the tar header ( see gname and uname).
     Maybe this buffers can be reduced a bit  ( to 16 or whatever ), this is up to you.
6) The increase of size of the binary is not so dramatic:
     size busybox
       text    data     bss     dec     hex filename
     239568    2300   36816  278684   4409c busybox
    size busybox_fixed
       text    data     bss     dec     hex filename
     239616    2300   36816  278732   440cc busybox
7) The behaviour of whoami changed:
    actually it  prints out an username cut down to the size of the buffer.
    This could be fixed by increasing the size of the buffer as in id.c or
    avoid the use of my_getpwuid and use getpwuid directly instead.
    Maybe this colud be also remain unchanged......

Please apply if you think it is ok to do so.
The diff applies on today's cvs tarball (2004-08-25).
Thanks in advance,
Ciao,
Tito
2004-08-26 22:18:59 +00:00
Eric Andersen
4f807a84c5 BusyBox has no business hard coding the number of major and minor bits for a
dev_t.  This is especially important now that the user space concept of a dev_t
and the kernel concept of a dev_t are divergant.  The only bit of user space
allowed to know the number of major and minor bits is include/sys/sysmacros.h
(i.e. part of libc).  When used with a current C library and a 2.6.x kernel,
this fix should allow BusyBox to support wide device major/minor numbers.
 -Erik
2004-07-26 09:11:12 +00:00
Glenn L McGrath
a88ae491e3 Fixup -T (--files-from) option, works for non-directories now 2004-07-21 09:00:39 +00:00
Glenn L McGrath
f34b0e996b Update reference for zip format 2004-06-06 10:22:43 +00:00
Eric Andersen
aaff79a8dd Steve Grubb writes:
Hello,

I found and patched 2 more bugs. The first is a misplaced semi-colon. The second
one is a buffer overflow. I doubt the buffer overflow is triggered in real life.
But you never know what those wily hackers are up to.

Thanks,
Steve Grubb
2004-05-05 10:37:49 +00:00
Glenn L McGrath
faa3546fd7 Fix symlink handling and small memory leak 2004-04-29 09:24:19 +00:00
Glenn L McGrath
c6992feee3 Update my email address, document some of my tasks in the AUTHORS file 2004-04-25 05:11:19 +00:00
Eric Andersen
aff114c33d Larry Doolittle writes:
This is a bulk spelling fix patch against busybox-1.00-pre10.
If anyone gets a corrupted copy (and cares), let me know and
I will make alternate arrangements.

Erik - please apply.

Authors - please check that I didn't corrupt any meaning.

Package importers - see if any of these changes should be
passed to the upstream authors.

I glossed over lots of sloppy capitalizations, missing apostrophes,
mixed American/British spellings, and German-style compound words.

What is "pretect redefined for test" in cmdedit.c?

Good luck on the 1.00 release!

      - Larry
2004-04-14 17:51:38 +00:00
Glenn L McGrath
958ac18d4e Add a comment explaining why we have to check for an extra \n 2004-04-09 06:59:05 +00:00
Eric Andersen
762c64fdf1 rename uncompress.c to decompress_uncompress.c
rename unzip.c to decompress_unzip.c
2004-04-05 13:03:34 +00:00
Eric Andersen
8ee2b27f0c Add missing include files 2004-03-27 11:26:32 +00:00
Eric Andersen
70060d25d2 s/fileno\(stdin\)/STDIN_FILENO/g
s/fileno\(stdout\)/STDOUT_FILENO/g
2004-03-27 10:02:48 +00:00
Eric Andersen
c7bda1ce65 Remove trailing whitespace. Update copyright to include 2004. 2004-03-15 08:29:22 +00:00