8 days agotools: add afl-fuzz files master
Eric Biggers [Fri, 5 Aug 2022 05:23:23 +0000 (22:23 -0700)]
tools: add afl-fuzz files

8 days agowof.h: guard by __WIN32__
Eric Biggers [Fri, 5 Aug 2022 05:03:21 +0000 (22:03 -0700)]
wof.h: guard by __WIN32__

This is needed for the wlfuzz program to compile on non-Windows.

2 weeks agowimlib.h: remove duplicate 'the'
Eric Biggers [Sun, 31 Jul 2022 02:10:07 +0000 (19:10 -0700)]
wimlib.h: remove duplicate 'the'

2 weeks agoRemove some unnecessary configure options
Eric Biggers [Sun, 31 Jul 2022 02:03:42 +0000 (19:03 -0700)]
Remove some unnecessary configure options

Remove support for the following options which aren't really useful and
probably aren't being used by anyone:

* --disable-assertions
* --disable-error-messages
* --disable-multithreaded-compression

2 weeks agoDon't bother with malloc function attribute
Eric Biggers [Sun, 31 Jul 2022 02:03:42 +0000 (19:03 -0700)]
Don't bother with malloc function attribute

2 weeks agomatchfinder_common: sync with libdeflate
Eric Biggers [Sun, 31 Jul 2022 02:03:42 +0000 (19:03 -0700)]
matchfinder_common: sync with libdeflate

2 weeks agocompress_common: sync with libdeflate
Eric Biggers [Sun, 31 Jul 2022 02:03:42 +0000 (19:03 -0700)]
compress_common: sync with libdeflate

2 weeks agobt_matchfinder: sync with libdeflate
Eric Biggers [Sun, 31 Jul 2022 02:03:42 +0000 (19:03 -0700)]
bt_matchfinder: sync with libdeflate

2 weeks agohc_matchfinder: sync with libdeflate
Eric Biggers [Sun, 31 Jul 2022 02:03:42 +0000 (19:03 -0700)]
hc_matchfinder: sync with libdeflate

2 weeks agoUse MIT license instead of CC0
Eric Biggers [Sun, 31 Jul 2022 02:03:42 +0000 (19:03 -0700)]
Use MIT license instead of CC0

CC0 has continued to fall out of favor due to the patents clause
Years ago I released some source files in this project (not the whole
project) under CC0.  Use the MIT license for these files instead.

Note that this requires claiming copyright on the latest version of
these files.  Of course, previous versions of these files remain public
domain where legally recognized; this is *not* in any way an attempt to
"revoke" the public domain status of previous versions.

4 weeks agoReduce MAX_OPEN_FILES to 128 on macOS where the default limit is 256
Mathieu Schroeter [Mon, 11 Jul 2022 12:05:48 +0000 (14:05 +0200)]
Reduce MAX_OPEN_FILES to 128 on macOS where the default limit is 256

7 months agowimlib_iterate_dir_tree(): don't checksum unhashed blobs
Eric Biggers [Mon, 3 Jan 2022 20:33:20 +0000 (14:33 -0600)]
wimlib_iterate_dir_tree(): don't checksum unhashed blobs

wimlib_iterate_dir_tree() on a modified-but-not-committed image is very
slow because it checksums all unhashed blobs.  This was originally
implemented by commit 681faad85f73 ("wimlib_iterate_dir_tree(): checksum
unhashed blobs"), presumably to make the sha1_hash field always valid.
However, I can't remember a real use case for this.  The current
behavior is causing problems, so let's just revert it and update the
documentation accordingly.

Reported at https://wimlib.net/forums/viewtopic.php?f=1&t=572

7 months agowimsplit: don't print success message on failure
Eric Biggers [Mon, 3 Jan 2022 19:53:34 +0000 (13:53 -0600)]
wimsplit: don't print success message on failure

7 months agov1.13.5 v1.13.5
Eric Biggers [Sun, 19 Dec 2021 19:06:07 +0000 (13:06 -0600)]

7 months agoUpdate libxml to 2.9.12 for Windows binaries
Eric Biggers [Sun, 19 Dec 2021 18:55:47 +0000 (12:55 -0600)]
Update libxml to 2.9.12 for Windows binaries

8 months agoexport_image.c: allow duplicate image names in source WIM v1.13.5-BETA2
Eric Biggers [Tue, 23 Nov 2021 01:55:42 +0000 (17:55 -0800)]
export_image.c: allow duplicate image names in source WIM

Reported at https://wimlib.net/forums/viewtopic.php?f=1&t=568.  DISM can
create WIM files containing images with duplicate names, whereas wimlib
enforces unique image names in certain cases such as adding images,
exporting images, and changing image names.  This behavior generally
seems fine, but the "export" check is too strict: an export of "all"
images will fail if the source WIM contains duplicate names.

Fix this by making wimlib_export_image() allow duplicate image names in
the source WIM, provided that they don't collide with image names that
already exist in the destination WIM.

12 months agoconfigure.ac: fix trailing newline issue
Eric Biggers [Tue, 3 Aug 2021 04:53:42 +0000 (21:53 -0700)]
configure.ac: fix trailing newline issue

Reported at https://wimlib.net/forums/viewtopic.php?f=1&t=562.
m4_esyscmd() needs to be m4_esyscmd_s(), so that the version string
doesn't get a trailing newline.  It works for me either way, but that's
probably because in autoconf 2.70, AC_INIT started trimming extra
whitespace from its arguments (as per the release notes at
So presumably this fix is needed for older versions of autoconf.

13 months agoconfigure.ac: generate version number from git commit and tags
Eric Biggers [Sat, 10 Jul 2021 22:47:57 +0000 (17:47 -0500)]
configure.ac: generate version number from git commit and tags

This should hopefully make it less confusing when building from the git
repository.  Previously, when doing so the version number would always
be that of the last official release.

13 months agonasm.m4: use AS_MESSAGE_LOG_FD
Eric Biggers [Sat, 10 Jul 2021 22:51:26 +0000 (17:51 -0500)]
nasm.m4: use AS_MESSAGE_LOG_FD

Address the following warning when running autoreconf:

    configure.ac:191: warning: The macro `AC_FD_CC' is obsolete.
    configure.ac:191: You should run autoupdate.
    ./lib/autoconf/general.m4:399: AC_FD_CC is expanded from...
    m4/nasm.m4:4: AC_PROG_NASM is expanded from...
    configure.ac:191: the top level

13 months agov1.13.5-BETA1 v1.13.5-BETA1
Eric Biggers [Sat, 10 Jul 2021 01:26:16 +0000 (20:26 -0500)]

13 months agoREADME.WINDOWS: clarify how to build master branch
Eric Biggers [Sat, 10 Jul 2021 00:56:49 +0000 (17:56 -0700)]
README.WINDOWS: clarify how to build master branch

13 months agoWarn rather than abort if SHA-1 is same but size is different
Eric Biggers [Mon, 5 Jul 2021 06:03:50 +0000 (23:03 -0700)]
Warn rather than abort if SHA-1 is same but size is different

Assertions should only be used for bugs in wimlib, but this scenario can
also happen if there is a SHA-1 collision, or if the SHA-1 hash provided
by the filesystem for a WIM-backed file on Windows is wrong.

13 months agotools/make-windows-release: ensure the headers in tools/windeps/ are used
Eric Biggers [Tue, 29 Jun 2021 07:42:11 +0000 (00:42 -0700)]
tools/make-windows-release: ensure the headers in tools/windeps/ are used

Avoid a build error due to the libxml2 headers not being found.

Previously it worked by chance due to the system headers being used.
This stopped working in Cygwin builds for some reason, though.

13 months agotools/make-windows-release: check existence of config.log before grepping it
Eric Biggers [Tue, 29 Jun 2021 07:42:11 +0000 (00:42 -0700)]
tools/make-windows-release: check existence of config.log before grepping it

Avoid a misleading log message.

13 months agowin32: update WOF ioctl definitions
Eric Biggers [Tue, 29 Jun 2021 07:42:11 +0000 (00:42 -0700)]
win32: update WOF ioctl definitions

Use the "official" Microsoft struct and field names, and only define
things when they aren't already defined (since some of them were
recently added to MinGW's winioctl.h, causing build errors).

13 months agowin32: only define FSCTL_SET_PERSISTENT_VOLUME_STATE if not yet defined
Eric Biggers [Tue, 29 Jun 2021 07:42:11 +0000 (00:42 -0700)]
win32: only define FSCTL_SET_PERSISTENT_VOLUME_STATE if not yet defined

The MinGW headers define this (and the related struct and constant) now,
which is causing a build error.

Also use CTL_CODE() rather than a raw number.

13 months agoREADME.WINDOWS: fix category of p7zip
Eric Biggers [Tue, 29 Jun 2021 07:42:11 +0000 (00:42 -0700)]
README.WINDOWS: fix category of p7zip

15 months agov1.13.4 v1.13.4
Eric Biggers [Mon, 19 Apr 2021 04:16:34 +0000 (21:16 -0700)]

16 months agov1.13.4-BETA2
Eric Biggers [Wed, 7 Apr 2021 04:31:48 +0000 (21:31 -0700)]

16 months agoAdd support for a data recovery mode
Eric Biggers [Wed, 7 Apr 2021 04:31:48 +0000 (21:31 -0700)]
Add support for a data recovery mode

Add support for extracting file data even if it is corrupted (i.e. if
its hash doesn't match or some of its chunks can't be decompressed).

This isn't recommended for general use, but it could be useful for
recovering data from a corrupted WIM archive.

16 months agov1.13.4-BETA1
Eric Biggers [Fri, 2 Apr 2021 04:14:20 +0000 (21:14 -0700)]

16 months agoFix slow progress updating for wimsplit
Eric Biggers [Fri, 2 Apr 2021 04:07:53 +0000 (21:07 -0700)]
Fix slow progress updating for wimsplit

wimsplit only prints a progress message when starting each WIM part.
That could be very infrequently since each part could be gigabytes.

Fix it to update the progress regularly as data is written, like the
other wimlib-imagex commands do.

This required changing the library to report
WIMLIB_PROGRESS_MSG_WRITE_STREAMS messages from wimlib_split() and
include the completed compressed size in them.

Reported at https://www.reddit.com/r/pcmasterrace/comments/hagu4k/wimlibimagex_split_stuck_at_0

21 months agov1.13.3 v1.13.3
Eric Biggers [Tue, 27 Oct 2020 03:54:00 +0000 (20:54 -0700)]

21 months agowin32_replacements.c: fix handle closing in win32_wglob()
Eric Biggers [Tue, 27 Oct 2020 03:17:02 +0000 (20:17 -0700)]
win32_replacements.c: fix handle closing in win32_wglob()

The handle returned by FindFirstFileW() needs to be closed by
FindClose(), not by CloseHandle().

This is a very old bug, which presumably wasn't noticed before because
ordinarily it just leaked the handle.  However, this bug caused a SEH
exception when wimlib was run under a debugger.

23 months agoCOPYING: clarify the license
Eric Biggers [Sun, 23 Aug 2020 19:37:12 +0000 (12:37 -0700)]
COPYING: clarify the license

Some of the language in COPYING is potentially unclear.  For example,
there is some ambiguity in when each license option of GPL and LGPL is
allowed.  Clarify the language.

Note, this commit isn't intended to actually change the license at all.
It just clarifies what I intended.

2 years agoConsistently use forums as bug report location
Eric Biggers [Fri, 5 Jun 2020 01:36:14 +0000 (18:36 -0700)]
Consistently use forums as bug report location

2 years agowin32_apply: relax bootloader compression blacklist
Eric Biggers [Fri, 5 Jun 2020 01:21:57 +0000 (18:21 -0700)]
win32_apply: relax bootloader compression blacklist

At some point the Windows bootloader started supporting all system
compression formats, not just XPRESS4K.

Reported at https://wimlib.net/forums/viewtopic.php?f=1&t=444

2 years agoREADME.WINDOWS: fix the Cygwin package list
Eric Biggers [Fri, 5 Jun 2020 00:49:40 +0000 (17:49 -0700)]
README.WINDOWS: fix the Cygwin package list

The "mingw64-i686-pkg-config" and "mingw64-x86_64-pkg-config" packages
have been replaced by just "pkg-config".

Reported at https://wimlib.net/forums/viewtopic.php?f=1&t=533#p1225

2 years agov1.13.3-BETA1
Eric Biggers [Tue, 2 Jun 2020 04:30:08 +0000 (21:30 -0700)]

2 years agowin32_capture: avoid unnecessary fallback to recursive scan
Eric Biggers [Tue, 2 Jun 2020 04:26:04 +0000 (21:26 -0700)]
win32_capture: avoid unnecessary fallback to recursive scan

When doing the fast MFT scan (via FSCTL_QUERY_FILE_LAYOUT) and we find a
directory that needs to fall back to the standard scan, we actually only
need to fall back for the directory itself -- not also its children.
Optimize things accordingly.

Reported at https://wimlib.net/forums/viewtopic.php?f=1&t=533

2 years agov1.13.2 v1.13.2
Eric Biggers [Sun, 24 May 2020 18:22:36 +0000 (11:22 -0700)]

2 years agowimboot.c: avoid -Waddress-of-packed-member warning
Eric Biggers [Sun, 24 May 2020 18:22:36 +0000 (11:22 -0700)]
wimboot.c: avoid -Waddress-of-packed-member warning

2 years agoUpdate libxml to 2.9.10 for Windows binaries
Eric Biggers [Sun, 24 May 2020 18:22:36 +0000 (11:22 -0700)]
Update libxml to 2.9.10 for Windows binaries

2 years agoRemove obsolete Linux packaging files
Eric Biggers [Sun, 24 May 2020 18:22:36 +0000 (11:22 -0700)]
Remove obsolete Linux packaging files

There are now official Debian and Fedora packages for wimlib.  So the
in-tree packaging files are redundant.  Also I haven't tested them in a
long time, so there's a good chance they don't work properly anymore.

2 years agoUse memcpy() for unaligned accesses
Eric Biggers [Fri, 22 May 2020 05:35:29 +0000 (22:35 -0700)]
Use memcpy() for unaligned accesses

For unaligned memory accesses, with modern compilers memcpy() is
compiled just as efficiently as __attribute__((packed)).  This also
avoids using a nonstandard extension and potentially running into the
gcc 10 bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94994.

2 years agoFix some typos
Eric Biggers [Sun, 25 Aug 2019 00:38:43 +0000 (17:38 -0700)]
Fix some typos

3 years agoupdate_image.c: check malloc return value
Eric Biggers [Fri, 26 Jul 2019 05:11:33 +0000 (22:11 -0700)]
update_image.c: check malloc return value

3 years agoAvoid gcc warnings with -Waddress-of-packed-member
Eric Biggers [Fri, 26 Jul 2019 05:11:33 +0000 (22:11 -0700)]
Avoid gcc warnings with -Waddress-of-packed-member

- Remove unnecessary packed attributes.
- Access a packed structure directly rather than via a separate pointer.

3 years agomkwinpeimg: syslinux modules may be in /usr/share/syslinux
Jiri Slaby [Thu, 18 Jul 2019 06:22:33 +0000 (08:22 +0200)]
mkwinpeimg: syslinux modules may be in /usr/share/syslinux

On openSUSE...

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
3 years agov1.13.1 v1.13.1
Eric Biggers [Tue, 7 May 2019 02:29:00 +0000 (19:29 -0700)]

3 years agov1.13.1-BETA1
Eric Biggers [Sun, 14 Apr 2019 06:21:42 +0000 (23:21 -0700)]

3 years agolcpit_matchfinder: fix limiting nice_match_len
Eric Biggers [Sun, 14 Apr 2019 06:21:42 +0000 (23:21 -0700)]
lcpit_matchfinder: fix limiting nice_match_len

The "normal" mode of the lcp-interval tree matchfinder supports finding
matches up to LCP_MAX bytes.  The "huge" mode, which is needed on
buffers larger than 64 MiB, supports up to HUGE_LCP_MAX bytes.
nice_match_len must be limited to the appropriate one of these values.

But nice_match_len is limited by lcpit_matchfinder_init().  That's
wrong, because it only knows whether huge mode *might* be used later,
based on max_bufsize.  Which mode to use is actually decided on a
buffer-by-buffer basis by lcpit_matchfinder_load_buffer().

Thus, limit nice_match_len in lcpit_matchfinder_load_buffer() instead.

This fixes a crash or incorrect output during LZMS compression with a
compression level > 50 and a chunk size > 64 MiB.

3 years agowlfuzz: improve compression parameter generation
Eric Biggers [Sun, 14 Apr 2019 06:21:42 +0000 (23:21 -0700)]
wlfuzz: improve compression parameter generation

- Sometimes choose LZMS chunk sizes > 64 MiB
- Choose LZMS more often
- Other cleanups

3 years agov1.13.0 v1.13.0
Eric Biggers [Fri, 23 Nov 2018 23:35:07 +0000 (15:35 -0800)]

3 years agoUpdate libxml to 2.9.8 for Windows binaries
Eric Biggers [Fri, 23 Nov 2018 23:35:07 +0000 (15:35 -0800)]
Update libxml to 2.9.8 for Windows binaries

3 years agowlfuzz: compare xattrs on Windows
Eric Biggers [Fri, 23 Nov 2018 23:35:07 +0000 (15:35 -0800)]
wlfuzz: compare xattrs on Windows

3 years agoimagex: warn that --update-of is unreliable on Windows
Eric Biggers [Tue, 11 Sep 2018 03:11:31 +0000 (20:11 -0700)]
imagex: warn that --update-of is unreliable on Windows

3 years agowimappend: with --create, ignore --update-of nonexistent target file
Eric Biggers [Tue, 11 Sep 2018 02:58:10 +0000 (19:58 -0700)]
wimappend: with --create, ignore --update-of nonexistent target file

4 years agoRemove Arch Linux PKGBUILD
Eric Biggers [Sat, 21 Jul 2018 20:10:41 +0000 (13:10 -0700)]
Remove Arch Linux PKGBUILD

There's now an official Arch Linux package for wimlib.
So the PKGBUILD file in-tree is redundant.

4 years agowimappend: add --create option to create WIM file if needed
Eric Biggers [Sat, 21 Jul 2018 19:34:19 +0000 (12:34 -0700)]
wimappend: add --create option to create WIM file if needed

4 years agowimextract: allow specifying listfile on stdin
Eric Biggers [Sat, 21 Jul 2018 18:38:08 +0000 (11:38 -0700)]
wimextract: allow specifying listfile on stdin

4 years agoMake absolute ExclusionException patterns include ancestor directories
Eric Biggers [Sat, 21 Jul 2018 16:27:22 +0000 (09:27 -0700)]
Make absolute ExclusionException patterns include ancestor directories

4 years agoimagex: make sure we still use wgetopt_long_only() on Windows
Eric Biggers [Sat, 21 Jul 2018 16:27:22 +0000 (09:27 -0700)]
imagex: make sure we still use wgetopt_long_only() on Windows

4 years agoFix building on NetBSD
Eric Biggers [Fri, 20 Jul 2018 07:38:56 +0000 (00:38 -0700)]
Fix building on NetBSD

4 years agosplit.c: fix finding extension of first split WIM part
Eric Biggers [Wed, 28 Feb 2018 03:31:58 +0000 (19:31 -0800)]
split.c: fix finding extension of first split WIM part

Silly old bug: wimlib_split() considered the first dot in the SWM path
to begin the filename extension.  But of course, there can be other dots
in the path; we need to look for the last dot in the last component.

4 years agoUpdate NEWS
Eric Biggers [Sun, 21 Jan 2018 21:47:10 +0000 (13:47 -0800)]
Update NEWS

4 years agowin32_capture: recognize STATUS_NOT_SUPPORTED (fixes for WinXP)
Eric Biggers [Sun, 21 Jan 2018 21:47:10 +0000 (13:47 -0800)]
win32_capture: recognize STATUS_NOT_SUPPORTED (fixes for WinXP)

4 years agoUpdate winpthreads to 5.0.3 for Windows binaries
Eric Biggers [Sun, 21 Jan 2018 21:47:10 +0000 (13:47 -0800)]
Update winpthreads to 5.0.3 for Windows binaries

4 years agoUpdate libxml to 2.9.7 for Windows binaries
Eric Biggers [Sun, 21 Jan 2018 21:47:10 +0000 (13:47 -0800)]
Update libxml to 2.9.7 for Windows binaries

4 years agowimlib-imagex: add --include-integrity option
Eric Biggers [Sun, 21 Jan 2018 21:47:10 +0000 (13:47 -0800)]
wimlib-imagex: add --include-integrity option

The --check option currently does two things: verify the integrity table
of the input WIM(s), and include an integrity table in the output
WIM(s).  Some users would like to do the latter only, especially if
there are large input WIM(s).

Add an option --include-integrity which does this.

4 years agowimlib-imagex: try harder to optimize out opening template WIM
Eric Biggers [Sun, 21 Jan 2018 21:47:10 +0000 (13:47 -0800)]
wimlib-imagex: try harder to optimize out opening template WIM

As an optimization, 'wimcapture' and 'wimappend' don't separately open
the template WIM for --update-of if no filename is specified in that
option, which makes it default to either the single base WIM
(--delta-from), or the WIM being appended to.

Extend that optimization to cases where the filename is specified in
--update-of and it exactly matches the filename of the WIM being
appended to or any of the base WIMs.

4 years agoImprove explanation for pipable WIM pre-write checksumming
Eric Biggers [Sun, 21 Jan 2018 21:47:10 +0000 (13:47 -0800)]
Improve explanation for pipable WIM pre-write checksumming

4 years agoMake stream_hash() return NULL for unhashed streams
Eric Biggers [Sun, 21 Jan 2018 21:47:10 +0000 (13:47 -0800)]
Make stream_hash() return NULL for unhashed streams

Otherwise it will return a bogus value from the union with ->back_inode
and ->back_stream_id.  Most callers ensured this cannot happen, but a
couple did not.  It should be explicitly prevented or handled.

4 years agoCapture and apply extended attributes on Windows
Eric Biggers [Sun, 21 Jan 2018 21:47:09 +0000 (13:47 -0800)]
Capture and apply extended attributes on Windows

DISM recently started supporting capturing and applying xattrs on
Windows (though, it is broken when applying multiple xattrs per file).
Make wimlib support the same, using the same on-disk format.  Unlike
DISM it is on by default, not controlled by an option, since there
doesn't seem to be a good reason to make it an option.

Also deprecate the tagged item wimlib was using to store xattrs on Linux
and switch over to the format used by WIMGAPI to store xattrs on
Windows, so that new WIM images use the same xattr format on both
platforms.  One caveat is that on Linux XATTR_SIZE_MAX is 65536 whereas
in the new WIM tagged item format we can only store up to 65535 bytes.
That is unlikely to matter though.

As future work, the NTFS-3G capture and apply backends should be updated
to support xattrs too.

4 years agoAllow retrieving PACKAGE_VERSION from the library
Eric Biggers [Sun, 21 Jan 2018 21:47:09 +0000 (13:47 -0800)]
Allow retrieving PACKAGE_VERSION from the library

Otherwise the output of 'wimlib-imagex --version' for beta versions
would be confusing.

4 years agowimlib-imagex: print version of library being used
Eric Biggers [Wed, 20 Sep 2017 02:53:19 +0000 (19:53 -0700)]
wimlib-imagex: print version of library being used

5 years agov1.12.0 v1.12.0
Eric Biggers [Sat, 29 Jul 2017 20:46:20 +0000 (13:46 -0700)]

5 years agowin32_apply: bail if paths are too long for a UNICODE_STRING
Eric Biggers [Sat, 29 Jul 2017 20:39:28 +0000 (13:39 -0700)]
win32_apply: bail if paths are too long for a UNICODE_STRING

5 years agowin32_common: fix windows_msg() with long messages
Eric Biggers [Sat, 29 Jul 2017 20:20:16 +0000 (13:20 -0700)]
win32_common: fix windows_msg() with long messages

5 years ago1.12.0-BETA2
Eric Biggers [Sun, 16 Jul 2017 07:16:59 +0000 (00:16 -0700)]

5 years agowimlib-imagex: add --quiet option
Eric Biggers [Sun, 16 Jul 2017 06:57:10 +0000 (23:57 -0700)]
wimlib-imagex: add --quiet option

5 years agolzx_decompress: redeclare input_bitstream above main loop
Eric Biggers [Sun, 16 Jul 2017 06:26:33 +0000 (23:26 -0700)]
lzx_decompress: redeclare input_bitstream above main loop

5 years agounaligned: use may_alias attribute
Eric Biggers [Sun, 16 Jul 2017 06:26:33 +0000 (23:26 -0700)]
unaligned: use may_alias attribute

gcc7 miscompiles the "undo" mode of translate_if_needed() in
lzms_common.c because the get_unaligned_le16() was incorrectly being
moved before the put_unaligned_le32().  Fix it by marking the special
"unaligned" structs with the may_alias attribute.

5 years agoUse dynamically-sized path buffer when scanning files
Eric Biggers [Sun, 16 Jul 2017 06:26:33 +0000 (23:26 -0700)]
Use dynamically-sized path buffer when scanning files

This is needed to guarantee that no buffer overflow can occur when
scanning a deep directory structure.  The new way also avoids using
PATH_MAX, which fixes a build error on systems that don't define it.

5 years agomkwinpeimg: syslinux modules may be in /usr/lib/syslinux/modules/bios
Eric Biggers [Mon, 3 Jul 2017 21:07:09 +0000 (14:07 -0700)]
mkwinpeimg: syslinux modules may be in /usr/lib/syslinux/modules/bios

5 years agoupdate_image.c: Ignore Windows 10 Recycle Bin directories.
Mike Swanson [Sun, 4 Jun 2017 22:35:34 +0000 (15:35 -0700)]
update_image.c: Ignore Windows 10 Recycle Bin directories.

On Windows 10 (possibly earlier versions?), the \$RECYCLE.BIN or
\$Recycle.Bin directories are created in the root of a volume.
Both case variants here so capture of an NTFS volume from Linux
should work, but wouldn't make a difference when capturing on

5 years ago1.12.0-BETA1
Eric Biggers [Wed, 19 Apr 2017 06:58:03 +0000 (23:58 -0700)]

5 years agotests: test capturing+applying file with negative UNIX timestamp
Eric Biggers [Wed, 19 Apr 2017 06:58:03 +0000 (23:58 -0700)]
tests: test capturing+applying file with negative UNIX timestamp

... and start comparing mtime in tree-cmp, and fix cases where return
codes in scripts were being ignored by use of '&&'.

5 years agowlfuzz: compare timestamps
Eric Biggers [Wed, 19 Apr 2017 06:58:03 +0000 (23:58 -0700)]
wlfuzz: compare timestamps

5 years agoImproved year 2038 safety
Eric Biggers [Wed, 19 Apr 2017 06:58:03 +0000 (23:58 -0700)]
Improved year 2038 safety

Make wimlib on 32-bit Windows year 2038 safe by doing the following:

- Build both the library and program with 64-bit time_t, being careful
  to avoid changing the timespec struct exposed in the API.
- Update wimlib's API to include an extended seconds field in
  wimlib_dir_entry for each timestamp, and set it when tv_sec is 32-bit.
- When needing the current time, call GetSystemTimeAsFileTime() instead
  of MinGW's gettimeofday().

This also has the advantage that due to switching to the 64-bit time_t
functions, 32-bit wimlib-imagex.exe now prints timestamps prior to year
1970 correctly.

Unfortunately, despite the API improvement, we cannot at this time make
wimlib fully Y2038-safe on 32-bit UNIX, due to lack of OS support.

5 years agotimestamp.c: correctly convert negative UNIX timestamps
Eric Biggers [Wed, 19 Apr 2017 06:58:03 +0000 (23:58 -0700)]
timestamp.c: correctly convert negative UNIX timestamps

5 years agontfs-3g_apply.c: note bugs fixed in NTFS-3G version 2017.3.23
Eric Biggers [Sat, 8 Apr 2017 17:48:04 +0000 (10:48 -0700)]
ntfs-3g_apply.c: note bugs fixed in NTFS-3G version 2017.3.23

5 years agoavl_tree.h: avoid bad function pointer cast
Eric Biggers [Sun, 29 Jan 2017 05:18:21 +0000 (21:18 -0800)]
avl_tree.h: avoid bad function pointer cast

Casting the type of the 'cmp' function, while under normal circumstances
compiled correctly, was not technically correct and was not compatible
with some control flow integrity (CFI) implementations.

5 years agoAdd tools/clang-build-with-cfi
Eric Biggers [Sat, 28 Jan 2017 23:14:23 +0000 (15:14 -0800)]
Add tools/clang-build-with-cfi

5 years agov1.11.0 v1.11.0
Eric Biggers [Wed, 18 Jan 2017 05:24:53 +0000 (21:24 -0800)]

5 years agoexamples/compressfile.c: add back colon that got deleted
Eric Biggers [Wed, 18 Jan 2017 04:32:54 +0000 (20:32 -0800)]
examples/compressfile.c: add back colon that got deleted

5 years agotagged_items.c: statically verify size of tagged item header
Eric Biggers [Wed, 18 Jan 2017 04:32:54 +0000 (20:32 -0800)]
tagged_items.c: statically verify size of tagged item header

5 years agoxattr.h: statically verify size of xattr header
Eric Biggers [Wed, 18 Jan 2017 04:32:54 +0000 (20:32 -0800)]
xattr.h: statically verify size of xattr header

5 years agolzx_compress: optimize storing information in lzx_sequence
Eric Biggers [Sun, 15 Jan 2017 21:34:36 +0000 (13:34 -0800)]
lzx_compress: optimize storing information in lzx_sequence

Pack the literal run length and match length ourselves instead of using
bitfields, and store the actual match length instead of the adjusted
match length.  Also make matchlen=0 represent end-of-block, and store
the full main symbol, not just the match header.

5 years agoDon't generate GUID in wimlib_create_new_wim()
Eric Biggers [Sun, 15 Jan 2017 01:00:13 +0000 (17:00 -0800)]
Don't generate GUID in wimlib_create_new_wim()

It's not necessary to generate a GUID in wimlib_create_new_wim() because
one is generated later by wimlib_write(), and nothing seems to assume
that a WIMStruct not yet backed by a file has a valid GUID.  This saves
a call to get_random_bytes().  Also remove some unnecessary
initializations to 0.