Commit Graph

67 Commits

Author SHA1 Message Date
Denis Vlasenko
a80b4a0fa7 tar: improve OLDGNU compat, make old SUN compat configurable 2007-06-21 12:41:59 +00:00
Denis Vlasenko
7510384107 do not do utime() on links, it acts on link targets, and we don't want that.
rename link_name to link_target, less confusing this way.
2007-06-20 14:49:47 +00:00
Denis Vlasenko
940494f813 remove f words 2007-03-04 18:09:50 +00:00
Denis Vlasenko
dcbd51dd28 tar: handle tarfiles with (broken) checksums a-la Sun. 2007-03-03 20:06:59 +00:00
Denis Vlasenko
666da5e2c6 merge post-1.3.0 fixes 2006-12-26 18:17:42 +00:00
Denis Vlasenko
714701c890 tar et al: die if bb_copyfd_size copies less than asked for.
(we have bb_copyfd_exact_size now for that kind of usage)
2006-12-22 00:21:07 +00:00
Denis Vlasenko
c1660fea6d tar: refuse to untar files with "/../" components 2006-11-26 15:42:03 +00:00
Denis Vlasenko
b596335868 tar: correctly skip (and warn about) pax headers.
plug memory leak. save 50 bytes.
Wooohooo! we finally can unpack kernel tarballs!
2006-11-26 01:46:59 +00:00
Denis Vlasenko
87cd4a87e3 tar: small fix and small optimization 2006-11-25 23:47:32 +00:00
Denis Vlasenko
b833ca9d2d tar: buglet fix 2006-11-24 18:53:13 +00:00
Denis Vlasenko
d6772501db tar: fix and sanitize handling of long filenames/linknames
(GNU extensions 'K' and 'L').
We correctly handle them when untarring now, but unfortunately
we still don't use them when tarring! That stupid 100 char limit
is still there!
The biggest problem is that we don't support 'pax' tar format.
Linux kernel tarballs are in this format... shame
2006-11-24 17:21:44 +00:00
Denis Vlasenko
cf30cc82a3 header_verbose_list: stop truncating file size in listing 2006-11-24 14:53:18 +00:00
Denis Vlasenko
376ce1e775 tar:
* unpack: handle tar header fields which are not NUL terminated
* pack: handle 4+GB files correctly
* pack: refuse to store 101+ softlinks (was truncating link
  target name)
* pack: mask mode with 07777
2006-11-24 14:51:01 +00:00
Denis Vlasenko
cba9ef5523 fixes from Vladimir Dronnikov <dronnikov@gmail.ru> 2006-10-10 21:00:47 +00:00
Denis Vlasenko
1385899416 attempt to regularize atoi mess. 2006-10-08 12:49:22 +00:00
Rob Landley
d921b2ecc0 Remove bb_ prefixes from xfuncs.c (and a few other places), consolidate
things like xasprintf() into xfuncs.c, remove xprint_file_by_name() (it only
had one user), clean up lots of #includes...  General cleanup pass.  What I've
been doing for the last couple days.

And it conflicts!  I've removed httpd.c from this checkin due to somebody else
touching that file.  It builds for me.  I have to catch a bus.  (Now you know
why I'm looking forward to Mercurial.)
2006-08-03 15:41:12 +00:00
"Robert P. J. Day"
eea561871b "formated" -> "formatted" throughout the code base. 2006-07-20 19:02:24 +00:00
Rob Landley
534374755d Cleaup read() and write() variants, plus a couple of new functions like
xlseek and fdlength() for the new mkswap.
2006-07-16 08:14:35 +00:00
Rob Landley
ff6e21c2ce Fix tar so it can extract git-generated tarballs, based on a suggestion
from Erik Frederiksen.
2006-07-06 20:30:19 +00:00
"Robert P. J. Day"
63fc1a9e08 Standardize on the vi editing directives being on the first line. 2006-07-02 19:47:05 +00:00
Rob Landley
1ec5b29054 More size shrinkage. 2006-05-29 07:42:02 +00:00
Rob Landley
8bb50782a5 Change llist_add_* to take the address of the list rather than returning the new
head, and change all the callers.
2006-05-26 23:44:51 +00:00
Bernhard Reutner-Fischer
a1bccc0ba8 - typos: s/compatability/compatibility/g;s/compatable/compatible/g; 2006-04-02 20:17:55 +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
"Vladimir N. Oleynik"
325da7b509 use bb_xstrndup vs strndup. Thanks rfelker. 2006-03-01 05:39:41 +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
Tim Riker
c1ef7bdd8d just whitespace 2006-01-25 00:08:53 +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
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
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
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
Eric Andersen
c7bda1ce65 Remove trailing whitespace. Update copyright to include 2004. 2004-03-15 08:29:22 +00:00
Glenn L McGrath
916ba53f1a Fix up hard links 2004-02-20 02:34:42 +00:00
Glenn L McGrath
c9f1fce9bb A strict interpretation of the ustar format requires the type flag to be
interpreted, we cannot depend on the file type being set in the mode
field.
2004-02-20 02:25:18 +00:00
Glenn L McGrath
b0e163a93b Add extra comments, freakout if a pax archive is encoutered. 2004-02-19 08:48:30 +00:00
Glenn L McGrath
a8f756fc7f Remove debugging 2004-02-17 12:04:13 +00:00
Glenn L McGrath
6aa52234e8 Dont strip trailing '/' until _after_ i test to set if its there ! 2004-02-17 11:55:06 +00:00
Glenn L McGrath
e39ee01821 Fix tar hard links 2003-11-27 00:01:43 +00:00
Glenn L McGrath
7ffe133864 As we no longer use function pointers for read in common archiving code
archive_xread can be replaced with bb_full_read, and archive_copy_file
with bb_copyfd*
bb_copyfd is split into two functions bb_copyfd_size and bb_copyfd_eof,
they share a common backend.
2003-11-21 22:24:57 +00:00
Glenn L McGrath
e857122c97 Fix tar-handles-nested-exclude testcase 2003-11-20 10:47:06 +00:00
Glenn L McGrath
f074afc2a0 Dont free filename, its needed in the extracted files list. 2003-11-17 21:58:00 +00:00
Glenn L McGrath
54ac057c00 Fix memory leaks 2003-11-15 00:24:43 +00:00
Glenn L McGrath
e57feeb9e6 Keep trying to find a good header, if we exit it will cause .tar.gz
files to compute incorrect crc and length for gzip
2003-11-14 12:57:14 +00:00
Glenn L McGrath
2685724e23 Fix tar -j support
Use the old fork() method of tar compression support, rather than
read_bz2....
 - (*uncompress)(int in, int out) seems like a more natural interface
for compression code.
 - it might improve performance by seperating the work into one cpu
bound and one io bound process.
 - There is extra code required to do read_[gz|bunzip] since (*uncompress)(int in,
int out) will normally be used by the standalone compression applet.

There have been problems with this method so if you see a "Short read"
error let me know.
2003-11-05 04:55:58 +00:00
Glenn L McGrath
beb3bbd991 Fix handling of hardlinks when OLDGNU and GNU extensions arent enabled. 2003-09-12 06:49:09 +00:00
Glenn L McGrath
ef91bf67ed Use the typeflag to identify if its a hardlink on OLD and GNU posix
modes, fixes a bug extracting hardlinks to symlinks.
2003-09-12 06:31:28 +00:00
Glenn L McGrath
87af49f26b If a tar entry is a regualr file ending in a '/' then its really a
directory.
From http://www.gnu.org/manual/tar/html_node/tar_123.html
REGTYPE
AREGTYPE
    These flags represent a regular file. In order to be compatible with
older versions of tar, a typeflag value of AREGTYPE should be silently
recognized as a regular file. New archives should be created using
REGTYPE. Also, for backward compatibility, tar treats a regular file
whose name ends with a slash as a directory.
2003-09-09 17:41:03 +00:00
Glenn L McGrath
3d5828fb6d Change hardlink handling for tar to work the same way as cpio 2003-08-14 02:55:15 +00:00
Eric Andersen
1b0075d243 Fixup problem unconditionally converting all hard links to symlinks. 2003-07-16 06:29:51 +00:00
Glenn L McGrath
b838420fd5 Handle hard links by converting them to symlinks 2003-06-12 13:47:16 +00:00