<feed xmlns='http://www.w3.org/2005/Atom'>
<title>busybox-w32/archival/libarchive/get_header_tar.c, branch zstd</title>
<subtitle>A mirror of https://github.com/rmyorston/busybox-w32.git
</subtitle>
<id>https://git.lua4.win/busybox-w32/atom?h=zstd</id>
<link rel='self' href='https://git.lua4.win/busybox-w32/atom?h=zstd'/>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/'/>
<updated>2026-03-11T10:14:49+00:00</updated>
<entry>
<title>Merge branch 'busybox' into merge</title>
<updated>2026-03-11T10:14:49+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2026-03-11T10:14:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=ede205bd07573813337b5706acb0cae3b127a36f'/>
<id>urn:sha1:ede205bd07573813337b5706acb0cae3b127a36f</id>
<content type='text'>
</content>
</entry>
<entry>
<title>tar: only strip unsafe components from hardlinks, not symlinks</title>
<updated>2026-02-28T04:59:18+00:00</updated>
<author>
<name>Radoslav Kolev</name>
<email>radoslav.kolev@suse.com</email>
</author>
<published>2026-02-16T09:50:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=599f5dd8fac390c18b79cba4c14c334957605dae'/>
<id>urn:sha1:599f5dd8fac390c18b79cba4c14c334957605dae</id>
<content type='text'>
commit 3fb6b31c7 introduced a check for unsafe components in
tar archive hardlinks, but it was being applied to symlinks too
which broke "Symlinks and hardlinks coexist" tar test.

Signed-off-by: Radoslav Kolev &lt;radoslav.kolev@suse.com&gt;
Signed-off-by: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'busybox' into merge</title>
<updated>2026-02-10T13:49:25+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2026-02-10T13:49:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=0e3015ddb8538f6329c59ed984a9c59bba3f376e'/>
<id>urn:sha1:0e3015ddb8538f6329c59ed984a9c59bba3f376e</id>
<content type='text'>
</content>
</entry>
<entry>
<title>tar: strip unsafe hardlink components - GNU tar does the same</title>
<updated>2026-01-29T11:01:56+00:00</updated>
<author>
<name>Denys Vlasenko</name>
<email>vda.linux@googlemail.com</email>
</author>
<published>2026-01-29T10:48:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=3fb6b31c716669e12f75a2accd31bb7685b1a1cb'/>
<id>urn:sha1:3fb6b31c716669e12f75a2accd31bb7685b1a1cb</id>
<content type='text'>
Defends against files like these (python reproducer):

import tarfile
ti = tarfile.TarInfo("leak_hosts")
ti.type = tarfile.LNKTYPE
ti.linkname = "/etc/hosts"  # or "../etc/hosts" or ".."
ti.size = 0
with tarfile.open("/tmp/hardlink.tar", "w") as t:
	t.addfile(ti)

function                                             old     new   delta
skip_unsafe_prefix                                     -     127    +127
get_header_tar                                      1752    1754      +2
.rodata                                           106861  106856      -5
unzip_main                                          2715    2706      -9
strip_unsafe_prefix                                  102      18     -84
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 1/3 up/down: 129/-98)            Total: 31 bytes

Signed-off-by: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
</content>
</entry>
<entry>
<title>tar: try harder to detect old tar files</title>
<updated>2024-11-08T13:08:47+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2024-11-08T12:48:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=0e958a72e1780138e68c799792190085cf505ee7'/>
<id>urn:sha1:0e958a72e1780138e68c799792190085cf505ee7</id>
<content type='text'>
The code to autodetect compressed tar files failed to detect a
bunzip2-compressed archive.  When tar was invoked with the 'j'
option it worked fine.

The autodetection code looks for the magic string 'ustar' or a
series of five NULs to determine that an archive is uncompressed.
The failing archives had more than five NULs in the header and
were taken to be uncompressed.

Look for a longer run of NULs: 16 is certainly sufficient for the
archives in question.

Adds 8-16 bytes.

(GitHub issue #475)
</content>
</entry>
<entry>
<title>fix "defined but not used" warnings</title>
<updated>2022-01-17T22:59:46+00:00</updated>
<author>
<name>Denys Vlasenko</name>
<email>vda.linux@googlemail.com</email>
</author>
<published>2022-01-17T22:59:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=8ad2acf352d790d0bdd792b8e126d58a088451f3'/>
<id>urn:sha1:8ad2acf352d790d0bdd792b8e126d58a088451f3</id>
<content type='text'>
Signed-off-by: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
</content>
</entry>
<entry>
<title>tar: prevent malicious archives with enormous long name sizes OOMing the machine</title>
<updated>2021-10-11T17:28:39+00:00</updated>
<author>
<name>Denys Vlasenko</name>
<email>vda.linux@googlemail.com</email>
</author>
<published>2021-10-11T17:28:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=6ba1f2d0bcdddb96c43ff9fec34758a4e2b4a467'/>
<id>urn:sha1:6ba1f2d0bcdddb96c43ff9fec34758a4e2b4a467</id>
<content type='text'>
function                                             old     new   delta
get_header_tar                                      1707    1752     +45

Signed-off-by: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
</content>
</entry>
<entry>
<title>tar: improve comments, add FIXMEs. no code changes</title>
<updated>2021-10-08T17:34:20+00:00</updated>
<author>
<name>Denys Vlasenko</name>
<email>vda.linux@googlemail.com</email>
</author>
<published>2021-10-08T17:34:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=b198e9aa934386531b2bc1fd0291ed3cc6beaf96'/>
<id>urn:sha1:b198e9aa934386531b2bc1fd0291ed3cc6beaf96</id>
<content type='text'>
Signed-off-by: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
</content>
</entry>
<entry>
<title>tar: fix fallout of last_char_is(NULL) no longer being allowed</title>
<updated>2020-10-02T16:30:53+00:00</updated>
<author>
<name>Denys Vlasenko</name>
<email>vda.linux@googlemail.com</email>
</author>
<published>2020-10-02T16:30:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=16e82c61d4db91e2e888600cdee7cf656ba4774c'/>
<id>urn:sha1:16e82c61d4db91e2e888600cdee7cf656ba4774c</id>
<content type='text'>
Signed-off-by: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
</content>
</entry>
<entry>
<title>libbb: reduce the overhead of single parameter bb_error_msg() calls</title>
<updated>2019-07-02T09:35:03+00:00</updated>
<author>
<name>James Byrne</name>
<email>james.byrne@origamienergy.com</email>
</author>
<published>2019-07-02T09:35:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=6937487be73cd4563b876413277a295a5fe2f32c'/>
<id>urn:sha1:6937487be73cd4563b876413277a295a5fe2f32c</id>
<content type='text'>
Back in 2007, commit 0c97c9d43707 ("'simple' error message functions by
Loic Grenie") introduced bb_simple_perror_msg() to allow for a lower
overhead call to bb_perror_msg() when only a string was being printed
with no parameters. This saves space for some CPU architectures because
it avoids the overhead of a call to a variadic function. However there
has never been a simple version of bb_error_msg(), and since 2007 many
new calls to bb_perror_msg() have been added that only take a single
parameter and so could have been using bb_simple_perror_message().

This changeset introduces 'simple' versions of bb_info_msg(),
bb_error_msg(), bb_error_msg_and_die(), bb_herror_msg() and
bb_herror_msg_and_die(), and replaces all calls that only take a
single parameter, or use something like ("%s", arg), with calls to the
corresponding 'simple' version.

Since it is likely that single parameter calls to the variadic functions
may be accidentally reintroduced in the future a new debugging config
option WARN_SIMPLE_MSG has been introduced. This uses some macro magic
which will cause any such calls to generate a warning, but this is
turned off by default to avoid use of the unpleasant macros in normal
circumstances.

This is a large changeset due to the number of calls that have been
replaced. The only files that contain changes other than simple
substitution of function calls are libbb.h, libbb/herror_msg.c,
libbb/verror_msg.c and libbb/xfuncs_printf.c. In miscutils/devfsd.c,
networking/udhcp/common.h and util-linux/mdev.c additonal macros have
been added for logging so that single parameter and multiple parameter
logging variants exist.

The amount of space saved varies considerably by architecture, and was
found to be as follows (for 'defconfig' using GCC 7.4):

Arm:     -92 bytes
MIPS:    -52 bytes
PPC:   -1836 bytes
x86_64: -938 bytes

Note that for the MIPS architecture only an exception had to be made
disabling the 'simple' calls for 'udhcp' (in networking/udhcp/common.h)
because it made these files larger on MIPS.

Signed-off-by: James Byrne &lt;james.byrne@origamienergy.com&gt;
Signed-off-by: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
</content>
</entry>
</feed>
