From df8373ed219747cdc1282ead68dc28104944882e Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Sat, 22 Jul 2023 15:01:50 -0700 Subject: [PATCH 01/16] win32-test-imagex-capture_and_apply: re-enable more compatibility tests After the previous commit, these tests now pass. --- tests/win32-test-imagex-capture_and_apply.bat | 21 +++++++------------ 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/tests/win32-test-imagex-capture_and_apply.bat b/tests/win32-test-imagex-capture_and_apply.bat index 5bf170b1..40eba4de 100644 --- a/tests/win32-test-imagex-capture_and_apply.bat +++ b/tests/win32-test-imagex-capture_and_apply.bat @@ -289,26 +289,22 @@ call :do_test call :msg "directory with empty alternate data stream" md subdir type nul > subdir:ads -REM Use skip_dism_apply=1 due to DISM bug -call :do_test_with_params 1 0 +call :do_test call :msg "root directory with alternate data stream" echo 1 > ..\in.dir:ads -REM Use skip_dism_apply=1 due to DISM bug -call :do_test_with_params 1 0 +call :do_test call :msg "root directory with empty alternate data stream" type nul > ..\in.dir:ads -REM Use skip_dism_apply=1 due to DISM bug -call :do_test_with_params 1 0 +call :do_test call :msg "subdirectory with alternate data streams" md subdir echo 1 > subdir:1 echo 2 > subdir:2 echo 2 > subdir:2again -REM Use skip_dism_apply=1 due to DISM bug -call :do_test_with_params 1 0 +call :do_test call :msg "subdirectories and files with alternate data streams" md subdir @@ -321,16 +317,14 @@ echo 1 > helloagain:1 echo 8 > helloagain:8 echo 1 > 1 type nul > helloagain:dummy -REM Use skip_dism_apply=1 due to DISM bug -call :do_test_with_params 1 0 +call :do_test call :msg "symbolic link and hard link, to file with alternate data streams" echo 1 > 1 echo test > .\1:test mklink symlink 1 > nul mklink /h hardlink 1 > nul -REM Use skip_dism_apply=1 due to DISM bug -call :do_test_with_params 1 0 +call :do_test call :msg "compressed file with alternate data streams" echo 1 > 1 @@ -373,8 +367,7 @@ call :msg "readonly directory with named data stream" md subdir echo foo > subdir:ads attrib +r subdir -REM Use skip_dism_apply=1 due to DISM bug -call :do_test_with_params 1 0 +call :do_test call :msg "encrypted file" echo "hello" > encrypted -- 2.43.0 From ae44786dcd57c6668233c51fa1c6e3a60fd459cd Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Sat, 22 Jul 2023 15:01:50 -0700 Subject: [PATCH 02/16] v1.14.2-BETA2 --- NEWS.md | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/NEWS.md b/NEWS.md index 45a09aec..e4964661 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,6 +1,6 @@ # wimlib release notes -## Version 1.14.2-BETA1 +## Version 1.14.2-BETA2 - Fixed a bug introduced in v1.14.0 where a crash would sometimes occur if a Delphi application or Visual Studio compiled application called into the diff --git a/README.md b/README.md index 825ef6bf..41848014 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Introduction -This is wimlib version 1.14.2-BETA1 (July 2023). wimlib is a C library for +This is wimlib version 1.14.2-BETA2 (July 2023). wimlib is a C library for creating, modifying, extracting, and mounting files in the Windows Imaging Format (WIM files). wimlib and its command-line frontend `wimlib-imagex` provide a free and cross-platform alternative to Microsoft's WIMGAPI, ImageX, -- 2.43.0 From e64e8de72590d1e5cad985a47d9544b036905f2c Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Sat, 22 Jul 2023 16:33:08 -0700 Subject: [PATCH 03/16] Add a clang-format file This approximates the de facto coding style of this project, which is quite similar to the Linux kernel coding style. This is just in case people to use it with 'git clang-format', as requested at https://wimlib.net/forums/viewtopic.php?t=666. I'm not planning to reformat all the existing code to make it match exactly. --- .clang-format | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .clang-format diff --git a/.clang-format b/.clang-format new file mode 100644 index 00000000..069b7eb3 --- /dev/null +++ b/.clang-format @@ -0,0 +1,34 @@ +BasedOnStyle: LLVM +AllowShortFunctionsOnASingleLine: false +AllowShortIfStatementsOnASingleLine: false +AlignConsecutiveMacros: Consecutive +AlwaysBreakAfterReturnType: All +BreakBeforeBraces: Linux +Cpp11BracedListStyle: false +ForEachMacros: + - 'avl_tree_for_each_in_order' + - 'avl_tree_for_each_in_postorder' + - 'avl_tree_for_each_in_reverse_order' + - 'dentry_for_each_ci_match' + - 'for_dentry_child' + - 'for_dentry_child_postorder' + - 'for_inode_child' + - 'for_inode_child_postorder' + - 'hlist_for_each_entry' + - 'hlist_for_each_entry_safe' + - 'image_for_each_inode' + - 'image_for_each_inode_safe' + - 'image_for_each_unhashed_blob' + - 'image_for_each_unhashed_blob_safe' + - 'inode_for_each_dentry' + - 'inode_for_each_extraction_alias' + - 'list_for_each' + - 'list_for_each_entry' + - 'list_for_each_entry_reverse' + - 'list_for_each_entry_safe' + - 'xml_node_for_each_child' +IncludeBlocks: Preserve +IndentCaseLabels: false +IndentWidth: 8 +SpaceBeforeParens: ControlStatementsExceptControlMacros +UseTab: Always -- 2.43.0 From 7df9ab5f062f9131887b41915cce4f62fca96baa Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Sun, 6 Aug 2023 10:30:39 -0700 Subject: [PATCH 04/16] v1.14.2 --- Makefile.am | 2 +- NEWS.md | 2 +- README.WINDOWS.md | 8 ++++---- README.md | 2 +- doc/man1/mkwinpeimg.1 | 2 +- doc/man1/wimapply.1 | 2 +- doc/man1/wimcapture.1 | 2 +- doc/man1/wimdelete.1 | 2 +- doc/man1/wimdir.1 | 2 +- doc/man1/wimexport.1 | 2 +- doc/man1/wimextract.1 | 2 +- doc/man1/wiminfo.1 | 2 +- doc/man1/wimjoin.1 | 2 +- doc/man1/wimlib-imagex.1 | 2 +- doc/man1/wimmount.1 | 2 +- doc/man1/wimoptimize.1 | 2 +- doc/man1/wimsplit.1 | 2 +- doc/man1/wimupdate.1 | 2 +- doc/man1/wimverify.1 | 2 +- include/wimlib.h | 4 ++-- tools/get-version-number.sh | 2 +- 21 files changed, 25 insertions(+), 25 deletions(-) diff --git a/Makefile.am b/Makefile.am index cb012fca..92fccb95 100644 --- a/Makefile.am +++ b/Makefile.am @@ -201,7 +201,7 @@ libwim_la_CFLAGS = \ $(LIBNTFS_3G_CFLAGS) \ $(LIBFUSE_CFLAGS) -libwim_la_LDFLAGS = $(AM_LDFLAGS) -version-info 38:0:23 +libwim_la_LDFLAGS = $(AM_LDFLAGS) -version-info 39:0:24 libwim_la_LIBADD = \ $(PTHREAD_LIBS) \ diff --git a/NEWS.md b/NEWS.md index e4964661..d3637c02 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,6 +1,6 @@ # wimlib release notes -## Version 1.14.2-BETA2 +## Version 1.14.2 - Fixed a bug introduced in v1.14.0 where a crash would sometimes occur if a Delphi application or Visual Studio compiled application called into the diff --git a/README.WINDOWS.md b/README.WINDOWS.md index 9e3e0f96..3f0ea270 100644 --- a/README.WINDOWS.md +++ b/README.WINDOWS.md @@ -107,9 +107,9 @@ After that, open any MSYS2 shell again and run the following commands: Note: By default the git repository will be on the `master` branch, which is the latest development snapshot. Optionally, you can check out a specific version, -e.g. `cd wimlib && git checkout v1.14.1`. For old versions, please refer to the +e.g. `cd wimlib && git checkout v1.14.2`. For old versions, please refer to the documentation for that version, as things may have changed. It is also possible -to use a release tarball (e.g. `wimlib-1.14.1.tar.gz`) instead of the git repo. +to use a release tarball (e.g. `wimlib-1.14.2.tar.gz`) instead of the git repo. Finally, to actually do a build, close the MSYS2 shell you have open, then open one of the following from the Start menu: @@ -127,7 +127,7 @@ one of the following from the Start menu: The script will automatically download and install the packages needed to build wimlib in the chosen MSYS2 environment, then build wimlib. The output will be -in a folder named similarly to `wimlib-1.14.1-windows-x86_64-bin`. Note that +in a folder named similarly to `wimlib-1.14.2-windows-x86_64-bin`. Note that your "home" folder within MSYS2 is `C:\msys64\home\%USERNAME%` by default. Therefore, the full path to the output folder will be similar to -`C:\msys64\home\%USERNAME%\wimlib\wimlib-1.14.1-windows-x86_64-bin`. +`C:\msys64\home\%USERNAME%\wimlib\wimlib-1.14.2-windows-x86_64-bin`. diff --git a/README.md b/README.md index 41848014..7240a542 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Introduction -This is wimlib version 1.14.2-BETA2 (July 2023). wimlib is a C library for +This is wimlib version 1.14.2 (August 2023). wimlib is a C library for creating, modifying, extracting, and mounting files in the Windows Imaging Format (WIM files). wimlib and its command-line frontend `wimlib-imagex` provide a free and cross-platform alternative to Microsoft's WIMGAPI, ImageX, diff --git a/doc/man1/mkwinpeimg.1 b/doc/man1/mkwinpeimg.1 index 1a333ebd..6f19efac 100644 --- a/doc/man1/mkwinpeimg.1 +++ b/doc/man1/mkwinpeimg.1 @@ -1,4 +1,4 @@ -.TH MKWINPEIMG "1" "April 2023" "wimlib 1.14.1" "User Commands" +.TH MKWINPEIMG "1" "August 2023" "wimlib 1.14.2" "User Commands" .SH NAME mkwinpeimg \- Make a customized bootable image of Windows PE .SH SYNOPSIS diff --git a/doc/man1/wimapply.1 b/doc/man1/wimapply.1 index 1489f5ca..3a90c6c6 100644 --- a/doc/man1/wimapply.1 +++ b/doc/man1/wimapply.1 @@ -1,4 +1,4 @@ -.TH WIMAPPLY "1" "April 2023" "wimlib 1.14.1" "User Commands" +.TH WIMAPPLY "1" "August 2023" "wimlib 1.14.2" "User Commands" .SH NAME wimapply \- Apply a WIM image .SH SYNOPSIS diff --git a/doc/man1/wimcapture.1 b/doc/man1/wimcapture.1 index 4dc19da7..cc298665 100644 --- a/doc/man1/wimcapture.1 +++ b/doc/man1/wimcapture.1 @@ -1,4 +1,4 @@ -.TH WIMCAPTURE "1" "April 2023" "wimlib 1.14.1" "User Commands" +.TH WIMCAPTURE "1" "August 2023" "wimlib 1.14.2" "User Commands" .SH NAME wimcapture, wimappend \- Capture or append a WIM image .SH SYNOPSIS diff --git a/doc/man1/wimdelete.1 b/doc/man1/wimdelete.1 index 95fd2d4b..3870e95a 100644 --- a/doc/man1/wimdelete.1 +++ b/doc/man1/wimdelete.1 @@ -1,4 +1,4 @@ -.TH WIMDELETE "1" "April 2023" "wimlib 1.14.1" "User Commands" +.TH WIMDELETE "1" "August 2023" "wimlib 1.14.2" "User Commands" .SH NAME wimdelete \- Delete an image from a WIM archive .SH SYNOPSIS diff --git a/doc/man1/wimdir.1 b/doc/man1/wimdir.1 index 9c25d236..e8502d13 100644 --- a/doc/man1/wimdir.1 +++ b/doc/man1/wimdir.1 @@ -1,4 +1,4 @@ -.TH WIMDIR "1" "April 2023" "wimlib 1.14.1" "User Commands" +.TH WIMDIR "1" "August 2023" "wimlib 1.14.2" "User Commands" .SH NAME wimdir \- List the files contained in a WIM image .SH SYNOPSIS diff --git a/doc/man1/wimexport.1 b/doc/man1/wimexport.1 index 87fd9e2a..d8accf94 100644 --- a/doc/man1/wimexport.1 +++ b/doc/man1/wimexport.1 @@ -1,4 +1,4 @@ -.TH WIMEXPORT "1" "April 2023" "wimlib 1.14.1" "User Commands" +.TH WIMEXPORT "1" "August 2023" "wimlib 1.14.2" "User Commands" .SH NAME wimexport \- Export image(s) from a WIM archive .SH SYNOPSIS diff --git a/doc/man1/wimextract.1 b/doc/man1/wimextract.1 index d2c361b7..b40c4a17 100644 --- a/doc/man1/wimextract.1 +++ b/doc/man1/wimextract.1 @@ -1,4 +1,4 @@ -.TH WIMEXTRACT "1" "April 2023" "wimlib 1.14.1" "User Commands" +.TH WIMEXTRACT "1" "August 2023" "wimlib 1.14.2" "User Commands" .SH NAME wimextract \- Extract files from a WIM image .SH SYNOPSIS diff --git a/doc/man1/wiminfo.1 b/doc/man1/wiminfo.1 index a20ed5db..1f83b0ec 100644 --- a/doc/man1/wiminfo.1 +++ b/doc/man1/wiminfo.1 @@ -1,4 +1,4 @@ -.TH WIMINFO "1" "April 2023" "wimlib 1.14.1" "User Commands" +.TH WIMINFO "1" "August 2023" "wimlib 1.14.2" "User Commands" .SH NAME wiminfo \- Display or change information about a WIM file or image .SH SYNOPSIS diff --git a/doc/man1/wimjoin.1 b/doc/man1/wimjoin.1 index 2de21418..80fcbece 100644 --- a/doc/man1/wimjoin.1 +++ b/doc/man1/wimjoin.1 @@ -1,4 +1,4 @@ -.TH WIMJOIN "1" "April 2023" "wimlib 1.14.1" "User Commands" +.TH WIMJOIN "1" "August 2023" "wimlib 1.14.2" "User Commands" .SH NAME wimjoin\- Join a split WIM into a standalone WIM .SH SYNOPSIS diff --git a/doc/man1/wimlib-imagex.1 b/doc/man1/wimlib-imagex.1 index 0a08d916..c680441b 100644 --- a/doc/man1/wimlib-imagex.1 +++ b/doc/man1/wimlib-imagex.1 @@ -1,4 +1,4 @@ -.TH WIMLIB-IMAGEX 1 "April 2023" "wimlib 1.14.1" "User Commands" +.TH WIMLIB-IMAGEX 1 "August 2023" "wimlib 1.14.2" "User Commands" .SH NAME wimlib-imagex \- Extract, create, modify, or mount a WIM archive .SH SYNOPSIS diff --git a/doc/man1/wimmount.1 b/doc/man1/wimmount.1 index 51a89bf8..c5ac2d3c 100644 --- a/doc/man1/wimmount.1 +++ b/doc/man1/wimmount.1 @@ -1,4 +1,4 @@ -.TH WIMMOUNT "1" "April 2023" "wimlib 1.14.1" "User Commands" +.TH WIMMOUNT "1" "August 2023" "wimlib 1.14.2" "User Commands" .SH NAME wimmount, wimmountrw, wimunmount \- Mount or unmount a WIM image .SH SYNOPSIS diff --git a/doc/man1/wimoptimize.1 b/doc/man1/wimoptimize.1 index d439d76d..b1aec75b 100644 --- a/doc/man1/wimoptimize.1 +++ b/doc/man1/wimoptimize.1 @@ -1,4 +1,4 @@ -.TH WIMOPTIMIZE "1" "April 2023" "wimlib 1.14.1" "User Commands" +.TH WIMOPTIMIZE "1" "August 2023" "wimlib 1.14.2" "User Commands" .SH NAME wimoptimize \- Optimize a WIM archive .SH SYNOPSIS diff --git a/doc/man1/wimsplit.1 b/doc/man1/wimsplit.1 index 05e161c8..b63ec1c1 100644 --- a/doc/man1/wimsplit.1 +++ b/doc/man1/wimsplit.1 @@ -1,4 +1,4 @@ -.TH WIMSPLIT "1" "April 2023" "wimlib 1.14.1" "User Commands" +.TH WIMSPLIT "1" "August 2023" "wimlib 1.14.2" "User Commands" .SH NAME wimsplit \- Split a WIM archive into multiple parts .SH SYNOPSIS diff --git a/doc/man1/wimupdate.1 b/doc/man1/wimupdate.1 index f5e7c77d..80436bff 100644 --- a/doc/man1/wimupdate.1 +++ b/doc/man1/wimupdate.1 @@ -1,4 +1,4 @@ -.TH WIMUPDATE "1" "April 2023" "wimlib 1.14.1" "User Commands" +.TH WIMUPDATE "1" "August 2023" "wimlib 1.14.2" "User Commands" .SH NAME wimupdate \- Update a WIM image .SH SYNOPSIS diff --git a/doc/man1/wimverify.1 b/doc/man1/wimverify.1 index c5ac3ae7..fcf462fc 100644 --- a/doc/man1/wimverify.1 +++ b/doc/man1/wimverify.1 @@ -1,4 +1,4 @@ -.TH WIMVERIFY "1" "April 2023" "wimlib 1.14.1" "User Commands" +.TH WIMVERIFY "1" "August 2023" "wimlib 1.14.2" "User Commands" .SH NAME wimverify \- Verify a WIM archive .SH SYNOPSIS diff --git a/include/wimlib.h b/include/wimlib.h index 54d6cb58..68693148 100644 --- a/include/wimlib.h +++ b/include/wimlib.h @@ -11,7 +11,7 @@ /** * @mainpage * - * This is the documentation for the library interface of wimlib 1.14.1, a C + * This is the documentation for the library interface of wimlib 1.14.2, a C * library for creating, modifying, extracting, and mounting files in the * Windows Imaging (WIM) format. This documentation is intended for developers * only. If you have installed wimlib and want to know how to use the @b @@ -433,7 +433,7 @@ #define WIMLIB_MINOR_VERSION 14 /** Patch version of the library (for example, the 5 in 1.2.5). */ -#define WIMLIB_PATCH_VERSION 1 +#define WIMLIB_PATCH_VERSION 2 #ifdef __cplusplus extern "C" { diff --git a/tools/get-version-number.sh b/tools/get-version-number.sh index c0328c0a..4105d389 100755 --- a/tools/get-version-number.sh +++ b/tools/get-version-number.sh @@ -7,6 +7,6 @@ vers=$(git describe --abbrev=8 --dirty --always 2>/dev/null | \ sed 's/^v//') if [ -z "$vers" ]; then # Fallback for people who use autoreconf on tarball releases - vers="1.14.1" + vers="1.14.2" fi echo "$vers" -- 2.43.0 From 035b2ae42b32ff892dcc794a0f4513fe8d0be76e Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Mon, 28 Aug 2023 21:00:04 -0700 Subject: [PATCH 05/16] Fix xml_legal_value() with signed char Fixes: cd9959b4f62a ("Eliminate the dependency on libxml2") Resolves https://wimlib.net/forums/viewtopic.php?p=1608 --- NEWS.md | 6 ++++++ src/xmlproc.c | 3 ++- tests/test-imagex | 28 +++++++++++++++++++--------- 3 files changed, 27 insertions(+), 10 deletions(-) diff --git a/NEWS.md b/NEWS.md index d3637c02..8287edb1 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,11 @@ # wimlib release notes +## Version 1.14.3-BETA1 + +- Fixed a bug introduced in v1.14.0 where non-ASCII characters stopped being + accepted in image names and descriptions. This bug only affected UNIX-like + systems that use `signed char`, e.g. x86 Linux systems. + ## Version 1.14.2 - Fixed a bug introduced in v1.14.0 where a crash would sometimes occur if a diff --git a/src/xmlproc.c b/src/xmlproc.c index d5de8945..6e1d2c16 100644 --- a/src/xmlproc.c +++ b/src/xmlproc.c @@ -341,7 +341,8 @@ bool xml_legal_value(const tchar *p) { for (; *p; p++) { - if (*p < 0x20 && !is_whitespace(*p)) + /* Careful: tchar can be signed. */ + if (*p > 0 && *p < 0x20 && !is_whitespace(*p)) return false; } return true; diff --git a/tests/test-imagex b/tests/test-imagex index 1d9fe820..c5e273f2 100755 --- a/tests/test-imagex +++ b/tests/test-imagex @@ -131,16 +131,26 @@ if ! test "`wiminfo dir.wim | grep '^Boot Index' | awk '{print $3}'`" = "0"; the fi rm -rf dir.wim tmp +name_desc_test() { + local name=$1 + local desc=$2 + if ! wimcapture dir dir.wim "$name" "$desc"; then + error "Failed to capture WIM with specified name and description" + fi + if ! test "`wiminfo dir.wim | grep Name | awk '{print $2}'`" = "$name"; then + error "WIM name not set correctly" + fi + if ! test "`wiminfo dir.wim | grep Description | awk '{print $2}'`" = "$desc"; then + error "WIM description not set correctly" + fi +} + echo "Testing capture of WIM with name and description" -if ! wimcapture dir dir.wim "myname" "mydesc"; then - error "Failed to capture WIM with specified name and description" -fi -if ! test "`wiminfo dir.wim | grep Name | awk '{print $2}'`" = "myname"; then - error "WIM name not set correctly" -fi -if ! test "`wiminfo dir.wim | grep Description | awk '{print $2}'`" = "mydesc"; then - error "WIM name not set correctly" -fi +name_desc_test "myname" "mydesc" + +echo "Testing capture of WIM with non-ASCII name and description" +name_desc_test "áéíóú" "¿?" + echo "Testing printing WIM lookup table" if ! wiminfo --lookup-table dir.wim > /dev/null; then error "Failed to print WIM lookup table" -- 2.43.0 From 4baa0ab7b8ad5c7f0a109e22e9a6c8621a7edd42 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Mon, 4 Sep 2023 11:41:23 -0700 Subject: [PATCH 06/16] v1.14.3 --- Makefile.am | 2 +- NEWS.md | 2 +- README.WINDOWS.md | 8 ++++---- README.md | 2 +- doc/man1/mkwinpeimg.1 | 2 +- doc/man1/wimapply.1 | 2 +- doc/man1/wimcapture.1 | 2 +- doc/man1/wimdelete.1 | 2 +- doc/man1/wimdir.1 | 2 +- doc/man1/wimexport.1 | 2 +- doc/man1/wimextract.1 | 2 +- doc/man1/wiminfo.1 | 2 +- doc/man1/wimjoin.1 | 2 +- doc/man1/wimlib-imagex.1 | 2 +- doc/man1/wimmount.1 | 2 +- doc/man1/wimoptimize.1 | 2 +- doc/man1/wimsplit.1 | 2 +- doc/man1/wimupdate.1 | 2 +- doc/man1/wimverify.1 | 2 +- include/wimlib.h | 4 ++-- tools/get-version-number.sh | 2 +- 21 files changed, 25 insertions(+), 25 deletions(-) diff --git a/Makefile.am b/Makefile.am index 92fccb95..4a5e4eb0 100644 --- a/Makefile.am +++ b/Makefile.am @@ -201,7 +201,7 @@ libwim_la_CFLAGS = \ $(LIBNTFS_3G_CFLAGS) \ $(LIBFUSE_CFLAGS) -libwim_la_LDFLAGS = $(AM_LDFLAGS) -version-info 39:0:24 +libwim_la_LDFLAGS = $(AM_LDFLAGS) -version-info 40:0:25 libwim_la_LIBADD = \ $(PTHREAD_LIBS) \ diff --git a/NEWS.md b/NEWS.md index 8287edb1..5fc8677e 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,6 +1,6 @@ # wimlib release notes -## Version 1.14.3-BETA1 +## Version 1.14.3 - Fixed a bug introduced in v1.14.0 where non-ASCII characters stopped being accepted in image names and descriptions. This bug only affected UNIX-like diff --git a/README.WINDOWS.md b/README.WINDOWS.md index 3f0ea270..238591ff 100644 --- a/README.WINDOWS.md +++ b/README.WINDOWS.md @@ -107,9 +107,9 @@ After that, open any MSYS2 shell again and run the following commands: Note: By default the git repository will be on the `master` branch, which is the latest development snapshot. Optionally, you can check out a specific version, -e.g. `cd wimlib && git checkout v1.14.2`. For old versions, please refer to the +e.g. `cd wimlib && git checkout v1.14.3`. For old versions, please refer to the documentation for that version, as things may have changed. It is also possible -to use a release tarball (e.g. `wimlib-1.14.2.tar.gz`) instead of the git repo. +to use a release tarball (e.g. `wimlib-1.14.3.tar.gz`) instead of the git repo. Finally, to actually do a build, close the MSYS2 shell you have open, then open one of the following from the Start menu: @@ -127,7 +127,7 @@ one of the following from the Start menu: The script will automatically download and install the packages needed to build wimlib in the chosen MSYS2 environment, then build wimlib. The output will be -in a folder named similarly to `wimlib-1.14.2-windows-x86_64-bin`. Note that +in a folder named similarly to `wimlib-1.14.3-windows-x86_64-bin`. Note that your "home" folder within MSYS2 is `C:\msys64\home\%USERNAME%` by default. Therefore, the full path to the output folder will be similar to -`C:\msys64\home\%USERNAME%\wimlib\wimlib-1.14.2-windows-x86_64-bin`. +`C:\msys64\home\%USERNAME%\wimlib\wimlib-1.14.3-windows-x86_64-bin`. diff --git a/README.md b/README.md index 7240a542..7ab3049d 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Introduction -This is wimlib version 1.14.2 (August 2023). wimlib is a C library for +This is wimlib version 1.14.3 (September 2023). wimlib is a C library for creating, modifying, extracting, and mounting files in the Windows Imaging Format (WIM files). wimlib and its command-line frontend `wimlib-imagex` provide a free and cross-platform alternative to Microsoft's WIMGAPI, ImageX, diff --git a/doc/man1/mkwinpeimg.1 b/doc/man1/mkwinpeimg.1 index 6f19efac..e692e3ba 100644 --- a/doc/man1/mkwinpeimg.1 +++ b/doc/man1/mkwinpeimg.1 @@ -1,4 +1,4 @@ -.TH MKWINPEIMG "1" "August 2023" "wimlib 1.14.2" "User Commands" +.TH MKWINPEIMG "1" "September 2023" "wimlib 1.14.3" "User Commands" .SH NAME mkwinpeimg \- Make a customized bootable image of Windows PE .SH SYNOPSIS diff --git a/doc/man1/wimapply.1 b/doc/man1/wimapply.1 index 3a90c6c6..d515d669 100644 --- a/doc/man1/wimapply.1 +++ b/doc/man1/wimapply.1 @@ -1,4 +1,4 @@ -.TH WIMAPPLY "1" "August 2023" "wimlib 1.14.2" "User Commands" +.TH WIMAPPLY "1" "September 2023" "wimlib 1.14.3" "User Commands" .SH NAME wimapply \- Apply a WIM image .SH SYNOPSIS diff --git a/doc/man1/wimcapture.1 b/doc/man1/wimcapture.1 index cc298665..b1cfa695 100644 --- a/doc/man1/wimcapture.1 +++ b/doc/man1/wimcapture.1 @@ -1,4 +1,4 @@ -.TH WIMCAPTURE "1" "August 2023" "wimlib 1.14.2" "User Commands" +.TH WIMCAPTURE "1" "September 2023" "wimlib 1.14.3" "User Commands" .SH NAME wimcapture, wimappend \- Capture or append a WIM image .SH SYNOPSIS diff --git a/doc/man1/wimdelete.1 b/doc/man1/wimdelete.1 index 3870e95a..49c136ef 100644 --- a/doc/man1/wimdelete.1 +++ b/doc/man1/wimdelete.1 @@ -1,4 +1,4 @@ -.TH WIMDELETE "1" "August 2023" "wimlib 1.14.2" "User Commands" +.TH WIMDELETE "1" "September 2023" "wimlib 1.14.3" "User Commands" .SH NAME wimdelete \- Delete an image from a WIM archive .SH SYNOPSIS diff --git a/doc/man1/wimdir.1 b/doc/man1/wimdir.1 index e8502d13..0a09cc64 100644 --- a/doc/man1/wimdir.1 +++ b/doc/man1/wimdir.1 @@ -1,4 +1,4 @@ -.TH WIMDIR "1" "August 2023" "wimlib 1.14.2" "User Commands" +.TH WIMDIR "1" "September 2023" "wimlib 1.14.3" "User Commands" .SH NAME wimdir \- List the files contained in a WIM image .SH SYNOPSIS diff --git a/doc/man1/wimexport.1 b/doc/man1/wimexport.1 index d8accf94..e131413d 100644 --- a/doc/man1/wimexport.1 +++ b/doc/man1/wimexport.1 @@ -1,4 +1,4 @@ -.TH WIMEXPORT "1" "August 2023" "wimlib 1.14.2" "User Commands" +.TH WIMEXPORT "1" "September 2023" "wimlib 1.14.3" "User Commands" .SH NAME wimexport \- Export image(s) from a WIM archive .SH SYNOPSIS diff --git a/doc/man1/wimextract.1 b/doc/man1/wimextract.1 index b40c4a17..36e37cba 100644 --- a/doc/man1/wimextract.1 +++ b/doc/man1/wimextract.1 @@ -1,4 +1,4 @@ -.TH WIMEXTRACT "1" "August 2023" "wimlib 1.14.2" "User Commands" +.TH WIMEXTRACT "1" "September 2023" "wimlib 1.14.3" "User Commands" .SH NAME wimextract \- Extract files from a WIM image .SH SYNOPSIS diff --git a/doc/man1/wiminfo.1 b/doc/man1/wiminfo.1 index 1f83b0ec..e46d46cd 100644 --- a/doc/man1/wiminfo.1 +++ b/doc/man1/wiminfo.1 @@ -1,4 +1,4 @@ -.TH WIMINFO "1" "August 2023" "wimlib 1.14.2" "User Commands" +.TH WIMINFO "1" "September 2023" "wimlib 1.14.3" "User Commands" .SH NAME wiminfo \- Display or change information about a WIM file or image .SH SYNOPSIS diff --git a/doc/man1/wimjoin.1 b/doc/man1/wimjoin.1 index 80fcbece..ba1f4be8 100644 --- a/doc/man1/wimjoin.1 +++ b/doc/man1/wimjoin.1 @@ -1,4 +1,4 @@ -.TH WIMJOIN "1" "August 2023" "wimlib 1.14.2" "User Commands" +.TH WIMJOIN "1" "September 2023" "wimlib 1.14.3" "User Commands" .SH NAME wimjoin\- Join a split WIM into a standalone WIM .SH SYNOPSIS diff --git a/doc/man1/wimlib-imagex.1 b/doc/man1/wimlib-imagex.1 index c680441b..e92b5df0 100644 --- a/doc/man1/wimlib-imagex.1 +++ b/doc/man1/wimlib-imagex.1 @@ -1,4 +1,4 @@ -.TH WIMLIB-IMAGEX 1 "August 2023" "wimlib 1.14.2" "User Commands" +.TH WIMLIB-IMAGEX 1 "September 2023" "wimlib 1.14.3" "User Commands" .SH NAME wimlib-imagex \- Extract, create, modify, or mount a WIM archive .SH SYNOPSIS diff --git a/doc/man1/wimmount.1 b/doc/man1/wimmount.1 index c5ac2d3c..6638652f 100644 --- a/doc/man1/wimmount.1 +++ b/doc/man1/wimmount.1 @@ -1,4 +1,4 @@ -.TH WIMMOUNT "1" "August 2023" "wimlib 1.14.2" "User Commands" +.TH WIMMOUNT "1" "September 2023" "wimlib 1.14.3" "User Commands" .SH NAME wimmount, wimmountrw, wimunmount \- Mount or unmount a WIM image .SH SYNOPSIS diff --git a/doc/man1/wimoptimize.1 b/doc/man1/wimoptimize.1 index b1aec75b..c8839c85 100644 --- a/doc/man1/wimoptimize.1 +++ b/doc/man1/wimoptimize.1 @@ -1,4 +1,4 @@ -.TH WIMOPTIMIZE "1" "August 2023" "wimlib 1.14.2" "User Commands" +.TH WIMOPTIMIZE "1" "September 2023" "wimlib 1.14.3" "User Commands" .SH NAME wimoptimize \- Optimize a WIM archive .SH SYNOPSIS diff --git a/doc/man1/wimsplit.1 b/doc/man1/wimsplit.1 index b63ec1c1..9e65eb80 100644 --- a/doc/man1/wimsplit.1 +++ b/doc/man1/wimsplit.1 @@ -1,4 +1,4 @@ -.TH WIMSPLIT "1" "August 2023" "wimlib 1.14.2" "User Commands" +.TH WIMSPLIT "1" "September 2023" "wimlib 1.14.3" "User Commands" .SH NAME wimsplit \- Split a WIM archive into multiple parts .SH SYNOPSIS diff --git a/doc/man1/wimupdate.1 b/doc/man1/wimupdate.1 index 80436bff..c5c2e653 100644 --- a/doc/man1/wimupdate.1 +++ b/doc/man1/wimupdate.1 @@ -1,4 +1,4 @@ -.TH WIMUPDATE "1" "August 2023" "wimlib 1.14.2" "User Commands" +.TH WIMUPDATE "1" "September 2023" "wimlib 1.14.3" "User Commands" .SH NAME wimupdate \- Update a WIM image .SH SYNOPSIS diff --git a/doc/man1/wimverify.1 b/doc/man1/wimverify.1 index fcf462fc..02b65a56 100644 --- a/doc/man1/wimverify.1 +++ b/doc/man1/wimverify.1 @@ -1,4 +1,4 @@ -.TH WIMVERIFY "1" "August 2023" "wimlib 1.14.2" "User Commands" +.TH WIMVERIFY "1" "September 2023" "wimlib 1.14.3" "User Commands" .SH NAME wimverify \- Verify a WIM archive .SH SYNOPSIS diff --git a/include/wimlib.h b/include/wimlib.h index 68693148..55ed0f45 100644 --- a/include/wimlib.h +++ b/include/wimlib.h @@ -11,7 +11,7 @@ /** * @mainpage * - * This is the documentation for the library interface of wimlib 1.14.2, a C + * This is the documentation for the library interface of wimlib 1.14.3, a C * library for creating, modifying, extracting, and mounting files in the * Windows Imaging (WIM) format. This documentation is intended for developers * only. If you have installed wimlib and want to know how to use the @b @@ -433,7 +433,7 @@ #define WIMLIB_MINOR_VERSION 14 /** Patch version of the library (for example, the 5 in 1.2.5). */ -#define WIMLIB_PATCH_VERSION 2 +#define WIMLIB_PATCH_VERSION 3 #ifdef __cplusplus extern "C" { diff --git a/tools/get-version-number.sh b/tools/get-version-number.sh index 4105d389..ef4f54ec 100755 --- a/tools/get-version-number.sh +++ b/tools/get-version-number.sh @@ -7,6 +7,6 @@ vers=$(git describe --abbrev=8 --dirty --always 2>/dev/null | \ sed 's/^v//') if [ -z "$vers" ]; then # Fallback for people who use autoreconf on tarball releases - vers="1.14.2" + vers="1.14.3" fi echo "$vers" -- 2.43.0 From 2da8c3dac2d66ededac860a1147e8794bf557a46 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Sat, 16 Sep 2023 16:21:11 -0700 Subject: [PATCH 07/16] README.WINDOWS.md: use https URL instead of git --- README.WINDOWS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.WINDOWS.md b/README.WINDOWS.md index 238591ff..9dd6c000 100644 --- a/README.WINDOWS.md +++ b/README.WINDOWS.md @@ -103,7 +103,7 @@ Then, open any MSYS2 shell and run the following command: After that, open any MSYS2 shell again and run the following commands: pacman -Syu --noconfirm git - git clone git://wimlib.net/wimlib + git clone https://wimlib.net/git/wimlib Note: By default the git repository will be on the `master` branch, which is the latest development snapshot. Optionally, you can check out a specific version, -- 2.43.0 From d5b1a4f0958c860e825bfd5827cb985a4b86147d Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Fri, 27 Oct 2023 21:04:32 -0700 Subject: [PATCH 08/16] fuzz.sh: add --max-len option --- tools/libFuzzer/fuzz.sh | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/tools/libFuzzer/fuzz.sh b/tools/libFuzzer/fuzz.sh index 94bd5a95..ad7e5e9b 100755 --- a/tools/libFuzzer/fuzz.sh +++ b/tools/libFuzzer/fuzz.sh @@ -18,6 +18,7 @@ Fuzz wimlib with LLVM's libFuzzer. Options: --asan Enable AddressSanitizer --input=INPUT Test a single input file only + --max-len=LEN Maximum length of generated inputs (default: $MAX_LEN) --msan Enable MemorySanitizer --time=SECONDS Stop after the given time has passed --ubsan Enable UndefinedBehaviorSanitizer @@ -39,13 +40,15 @@ run_cmd() } EXTRA_SANITIZERS= -EXTRA_FUZZER_ARGS=('-max_len=32768') +EXTRA_FUZZER_ARGS=() INPUT= +MAX_LEN=32768 longopts_array=( asan help input: +max-len: msan time: ubsan @@ -70,13 +73,17 @@ while true; do INPUT=$2 shift ;; - --time) - EXTRA_FUZZER_ARGS+=("-max_total_time=$2") + --max-len) + MAX_LEN=$2 shift ;; --msan) EXTRA_SANITIZERS+=",memory" ;; + --time) + EXTRA_FUZZER_ARGS+=("-max_total_time=$2") + shift + ;; --ubsan) EXTRA_SANITIZERS+=",undefined" ;; @@ -91,6 +98,7 @@ while true; do esac shift done +EXTRA_FUZZER_ARGS+=("-max_len=$MAX_LEN") if (( $# != 1 )); then echo 1>&2 "No fuzz target specified!" -- 2.43.0 From 391565147e7501b84289d3ec84bf499df63134fd Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Tue, 6 Feb 2024 22:26:50 -0800 Subject: [PATCH 09/16] xmlproc: fix buffer enlargement logic This fixes a heap buffer overflow caught by the xmlproc fuzzer. --- include/wimlib/compiler.h | 4 ++++ src/xmlproc.c | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/include/wimlib/compiler.h b/include/wimlib/compiler.h index 2f712545..77cd27f8 100644 --- a/include/wimlib/compiler.h +++ b/include/wimlib/compiler.h @@ -122,6 +122,10 @@ #undef MAX #define MAX(a, b) max((a), (b)) +/* Get the maximum of three variables, without multiple evaluation. */ +#undef max3 +#define max3(a, b, c) max(max((a), (b)), (c)) + /* Swap the values of two variables, without multiple evaluation. */ #ifndef swap # define swap(a, b) ({ typeof(a) _a = (a); (a) = (b); (b) = _a; }) diff --git a/src/xmlproc.c b/src/xmlproc.c index 6e1d2c16..8ce193e9 100644 --- a/src/xmlproc.c +++ b/src/xmlproc.c @@ -665,7 +665,8 @@ static void xml_write(struct xml_out_buf *buf, const tchar *str, size_t len) { if (buf->count + len + 1 > buf->capacity) { - size_t new_capacity = max(buf->capacity * 2, 4096); + size_t new_capacity = max3(buf->count + len + 1, + buf->capacity * 2, 4096); tchar *new_buf = REALLOC(buf->buf, new_capacity * sizeof(str[0])); if (!new_buf) { -- 2.43.0 From 93c693e30df444e81ccd53e7b2d8cc87ee920192 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Tue, 6 Feb 2024 22:26:50 -0800 Subject: [PATCH 10/16] win32-test-imagex-capture_and_apply.bat: exclude a test due to DISM bug --- tests/win32-test-imagex-capture_and_apply.bat | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/win32-test-imagex-capture_and_apply.bat b/tests/win32-test-imagex-capture_and_apply.bat index 40eba4de..049a64b1 100644 --- a/tests/win32-test-imagex-capture_and_apply.bat +++ b/tests/win32-test-imagex-capture_and_apply.bat @@ -379,7 +379,10 @@ echo "hello" > encrypted1 echo "hello" > encrypted2 cipher /e encrypted1 > nul cipher /e encrypted2 > nul -call :do_test +REM Use skip_dism_cmp=1 due to DISM bug where it fails to preserve short names: +REM DIFFERENCE: in.dir\encrypted1 and out.dir\encrypted1 do not have the same short name (ENCRYP~1 vs. ENCRYP~2) +REM DIFFERENCE: in.dir\encrypted2 and out.dir\encrypted2 do not have the same short name (ENCRYP~2 vs. ENCRYP~1) +call :do_test_with_params 0 1 call :msg "encrypted directory" md subdir -- 2.43.0 From 22a1e24e1128d4aff52ec778dfbf189475ecf074 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Tue, 6 Feb 2024 22:26:50 -0800 Subject: [PATCH 11/16] ci.yml: use actions/checkout@v4 and actions/upload-artifact@v4 This addresses the following warnings from GitHub Actions: Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions/checkout@v3. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/. Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions/upload-artifact@v3. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/. A near-identical warning forced everyone to upgrade to v3 last year, so this is some pointless churn, but let's just get it over with again... --- .github/workflows/ci.yml | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d1d33b1f..ee220137 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,7 +9,7 @@ jobs: name: Build and test with gcc runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install dependencies run: | sudo apt-get update @@ -19,7 +19,7 @@ jobs: - run: make -j8 check V=1 - run: make -j8 install V=1 DESTDIR=$PWD/installdir - run: make -j8 uninstall V=1 DESTDIR=$PWD/installdir - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 if: failure() with: name: gcc-test-logs @@ -29,7 +29,7 @@ jobs: name: Build and test with clang runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install dependencies run: | sudo apt-get update @@ -39,7 +39,7 @@ jobs: - run: make -j8 check V=1 - run: make -j8 install V=1 DESTDIR=$PWD/installdir - run: make -j8 uninstall V=1 DESTDIR=$PWD/installdir - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 if: failure() with: name: clang-test-logs @@ -49,7 +49,7 @@ jobs: name: Build and test with gcc -m32 runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install dependencies run: | sudo dpkg --add-architecture i386 @@ -60,7 +60,7 @@ jobs: - run: make -j8 check V=1 - run: make -j8 install V=1 DESTDIR=$PWD/installdir - run: make -j8 uninstall V=1 DESTDIR=$PWD/installdir - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 if: failure() with: name: i386-test-logs @@ -70,7 +70,7 @@ jobs: name: Build and test with ASAN enabled runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install dependencies run: | sudo apt-get update @@ -78,7 +78,7 @@ jobs: - run: ./bootstrap - run: ./configure CC=clang CFLAGS="$DEF_CFLAGS -fsanitize=address -fno-sanitize-recover=address" - run: make -j8 check V=1 - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 if: failure() with: name: asan-test-logs @@ -88,7 +88,7 @@ jobs: name: Build and test with UBSAN enabled runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install dependencies run: | sudo apt-get update @@ -96,7 +96,7 @@ jobs: - run: ./bootstrap - run: ./configure CC=clang CFLAGS="$DEF_CFLAGS -fsanitize=undefined -fno-sanitize-recover=undefined" - run: make -j8 check V=1 - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 if: failure() with: name: ubsan-test-logs @@ -106,7 +106,7 @@ jobs: name: Run shellcheck runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install dependencies run: | sudo apt-get update @@ -118,7 +118,7 @@ jobs: name: Build and test on macOS runs-on: macos-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install dependencies run: | brew install autoconf automake libtool pkg-config @@ -127,7 +127,7 @@ jobs: - run: make -j8 check V=1 - run: make -j8 install DESTDIR=$PWD/installdir - run: make -j8 uninstall DESTDIR=$PWD/installdir - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 if: failure() with: name: macos-test-logs @@ -148,7 +148,7 @@ jobs: run: shell: msys2 {0} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 # Need tags for tools/get-version-number.sh - uses: msys2/setup-msys2@v2 @@ -164,7 +164,7 @@ jobs: ${{matrix.cc_pkg}} pkgconf - run: CFLAGS="$DEF_CFLAGS" ./tools/windows-build.sh ${{matrix.options}} - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: windows-${{matrix.msystem}}-bin path: wimlib-*-bin @@ -176,7 +176,7 @@ jobs: run: shell: msys2 {0} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 # Need tags for tools/get-version-number.sh - uses: msys2/setup-msys2@v2 @@ -220,7 +220,7 @@ jobs: sanitizer: --asan --ubsan runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install dependencies run: | sudo apt-get update @@ -244,7 +244,7 @@ jobs: cflags: -fsanitize=undefined -fno-sanitize-recover=undefined runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install dependencies run: | sudo apt-get update @@ -261,7 +261,7 @@ jobs: run: shell: msys2 {0} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 # Need tags for tools/get-version-number.sh - uses: msys2/setup-msys2@v2 -- 2.43.0 From c63bf5f80447598c4a83244f2a92dd65209feeb4 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Tue, 6 Feb 2024 22:26:50 -0800 Subject: [PATCH 12/16] windows-build.sh: ensure that -static-libgcc is used with MSYS2 gcc In MSYS2 MINGW32, the gcc version is "i686-w64-mingw32-cc.exe (Rev4, Built by MSYS2 project) 13.2.0" which does not contain the string "(GCC)" as expected. Similarly for MSYS2 MINGW64. This means that -static-libgcc does not get used as intended. As a quick fix, just invert the check, so gcc is now detected by checking for not clang.. --- tools/windows-build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/windows-build.sh b/tools/windows-build.sh index e6ce4a08..63bd58b4 100755 --- a/tools/windows-build.sh +++ b/tools/windows-build.sh @@ -217,7 +217,7 @@ configure_wimlib() fi exit 1 fi - if "$cc" --version | grep -q '(GCC)'; then + if ! "$cc" --version | grep -q -i 'clang'; then configure_args+=("CC=$cc -static-libgcc") fi configure_args+=("${EXTRA_CONFIGURE_ARGS[@]}") -- 2.43.0 From 20ca0de607828d79e19bebb0f9e2455a4dca47d5 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Fri, 9 Feb 2024 15:36:21 -0800 Subject: [PATCH 13/16] configure.ac: mention development file packages --- configure.ac | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 105b223c..21fec5bf 100644 --- a/configure.ac +++ b/configure.ac @@ -128,7 +128,9 @@ if test "$WITH_NTFS_3G" = "yes"; then NTFS volume while preserving NTFS-specific data such as security descriptors and named data streams. Either install libntfs-3g, or configure --without-ntfs-3g to disable this - feature.])]) + feature. If your operating system packages development files + separately, the package you need to install may be called + ntfs-3g-dev, ntfs-3g-devel, or similar.])]) PKGCONFIG_PRIVATE_REQUIRES="$PKGCONFIG_PRIVATE_REQUIRES libntfs-3g" AC_DEFINE([WITH_NTFS_3G], [1], [Define to 1 if using NTFS-3G support]) fi @@ -151,7 +153,9 @@ if test "$WITH_FUSE" = "yes"; then [AC_MSG_ERROR([Cannot find libfuse3! Without libfuse3, wimlib cannot include support for mounting WIM images. Either install libfuse3, or configure --without-fuse to - disable this feature.])]) + disable this feature. If your operating system packages + development files separately, the package you need to install + may be called libfuse3-dev, fuse-devel, or similar.])]) PKGCONFIG_PRIVATE_REQUIRES="$PKGCONFIG_PRIVATE_REQUIRES fuse" AC_DEFINE([WITH_FUSE], [1], [Define to 1 if using FUSE support]) -- 2.43.0 From d9891a112a414cc455b479cb4b9e03a52527b136 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Fri, 9 Feb 2024 15:36:21 -0800 Subject: [PATCH 14/16] README.md: improve the installation directions --- README.md | 140 +++++++++++++++++++++++++++--------------------------- 1 file changed, 70 insertions(+), 70 deletions(-) diff --git a/README.md b/README.md index 7ab3049d..40d0d357 100644 --- a/README.md +++ b/README.md @@ -11,13 +11,15 @@ For the release notes, see the [NEWS file](NEWS.md). # Table of Contents - [Installation](#installation) + - [Windows](#windows) + - [UNIX-like systems](#unix-like-systems) + - [Installing distro package](#installing-distro-package) + - [Building from source](#building-from-source) - [WIM files](#wim-files) - [ImageX implementation](#imagex-implementation) - [Compression](#compression) - [NTFS support](#ntfs-support) - [Windows PE](#windows-pe) -- [Dependencies](#dependencies) -- [Configuration](#configuration) - [Portability](#portability) - [References](#references) - [History](#history) @@ -25,16 +27,75 @@ For the release notes, see the [NEWS file](NEWS.md). # Installation -To install wimlib and `wimlib-imagex` on UNIX-like systems, you can compile from -source (e.g. `./configure && make && sudo make install`). Alternatively, check -if a package has already been prepared for your operating system. +## Windows To install wimlib and `wimlib-imagex` on Windows, just download and extract the -ZIP file containing the latest binaries. For more details, see -[README.WINDOWS.md](README.WINDOWS.md). +ZIP file containing the latest binaries. All official releases are available +from [wimlib.net](https://wimlib.net). -All official wimlib releases are available from -[wimlib.net](https://wimlib.net). +For more details, including directions for how to build from source on Windows +if desired, see [README.WINDOWS.md](README.WINDOWS.md). + +## UNIX-like systems + +### Installing distro package + +To install wimlib and `wimlib-imagex` on UNIX-like systems, first consider just +installing the package provided by your operating system, if there is one. + +For example, on Ubuntu and other Debian based systems, run: + + sudo apt install wimtools + +On Fedora and other Red Hat based systems, run: + + sudo dnf install wimlib-utils + +On Arch Linux, run: + + sudo pacman -S wimlib + +### Building from source + +To build from source instead, first install the development files for libfuse3 +and libntfs-3g, if they're available for your operating system. For example, on +Ubuntu, run: + + sudo apt install libfuse3-dev ntfs-3g-dev + +Then, if you're building from the git repository instead of from a release +tarball, install additional build dependencies and run the bootstrap script: + + sudo apt install autoconf automake libtool pkgconf + ./bootstrap + +Finally, configure, build, and install the software: + + ./configure + make + sudo make install + +In addition to the standard options, the configure script accepts the following +options: + +- `--without-fuse`: Disables support for mounting WIM images. The `wimmount`, + `wimmountrw`, and `wimunmount` commands won't work. This removes the + dependency on libfuse3. + +- `--without-ntfs-3g`: Disables support for capturing or applying WIM images + directly from/to NTFS volumes. This removes the dependency on libntfs-3g. + +The `mkwinpeimg` shell script also has some optional dependencies that you can +choose to install: + +- `cdrkit` (for making ISO filesystems) +- `mtools` (for making disk images) +- `syslinux` (for making disk images) +- `cabextract` (for extracting files from the Windows Automated Installation Kit) + +Mounting WIM images also requires the FUSE kernel module. When you try to mount +a WIM image, the FUSE kernel module should be automatically loaded. Mounting +WIM images is only supported on Linux. # WIM files @@ -135,67 +196,6 @@ A shell script `mkwinpeimg` is provided with wimlib on UNIX-like systems to simplify the process of creating and customizing a bootable Windows PE image, sourcing the needed files from the Windows installation media or from the WAIK. -# Dependencies - -This section documents the dependencies of wimlib and the programs distributed -with it, when building for a UNIX-like system from source. If you have -downloaded the Windows binary distribution of wimlib and `wimlib-imagex` then -all dependencies were already included and this section is irrelevant. - -- `libfuse3` (optional but recommended) - - Unless configured `--without-fuse`, wimlib requires `libfuse3`, for mounting - WIM images using [FUSE](https://github.com/libfuse/libfuse). Most Linux - distributions already include this, but make sure you have the `fuse3` package - installed, and also `libfuse3-dev` if your distribution distributes - development files separately. FUSE also requires a kernel module. If the - kernel module is available it should automatically be loaded if you try to - mount a WIM image. - -- `libntfs-3g` (optional but recommended) - - Unless configured `--without-ntfs-3g`, wimlib requires the library and headers - for libntfs-3g to be installed. The minimum required version is 2011-4-12, - but newer versions contain important bug fixes. - -- `cdrkit` (optional) -- `mtools` (optional) -- `syslinux` (optional) -- `cabextract` (optional) - - The `mkwinpeimg` shell script will look for several other programs depending - on what options are given to it. Depending on your Linux distribution, you - may already have these programs installed, or they may be in the software - repository. Making an ISO filesystem requires `mkisofs` from - [`cdrkit`](https://www.cdrkit.org). Making a disk image requires - [`mtools`](https://www.gnu.org/software/mtools) and - [`syslinux`](https://www.syslinux.org). Retrieving files from the Windows - Automated Installation Kit requires - [`cabextract`](https://www.cabextract.org.uk). - -# Configuration - -This section documents the most important options that may be passed to the -"configure" script when building from source: - -- `--without-ntfs-3g` - - If libntfs-3g is not available or is not version 2011-4-12 or later, wimlib - can be built without it, in which case it will not be possible to capture or - apply WIM images directly from/to NTFS volumes. - - The default is `--with-ntfs-3g` when building for any UNIX-like system, and - `--without-ntfs-3g` when building for Windows. - -- `--without-fuse` - - The `--without-fuse` option disables support for mounting WIM images. This - removes dependencies on libfuse and librt. The `wimmount`, `wimmountrw`, and - `wimunmount` commands will not work. - - The default is `--with-fuse` when building for Linux, and `--without-fuse` - otherwise. - # Portability wimlib works on both UNIX-like systems (Linux, Mac OS X, FreeBSD, etc.) and -- 2.43.0 From cd2a5e5d2e95c36e81d09077d06ad136f7d24950 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Sat, 24 Feb 2024 10:40:45 -0800 Subject: [PATCH 15/16] v1.14.4 --- Makefile.am | 2 +- NEWS.md | 9 +++++++++ README.WINDOWS.md | 8 ++++---- README.md | 2 +- doc/man1/mkwinpeimg.1 | 2 +- doc/man1/wimapply.1 | 2 +- doc/man1/wimcapture.1 | 2 +- doc/man1/wimdelete.1 | 2 +- doc/man1/wimdir.1 | 2 +- doc/man1/wimexport.1 | 2 +- doc/man1/wimextract.1 | 2 +- doc/man1/wiminfo.1 | 2 +- doc/man1/wimjoin.1 | 2 +- doc/man1/wimlib-imagex.1 | 2 +- doc/man1/wimmount.1 | 2 +- doc/man1/wimoptimize.1 | 2 +- doc/man1/wimsplit.1 | 2 +- doc/man1/wimupdate.1 | 2 +- doc/man1/wimverify.1 | 2 +- include/wimlib.h | 4 ++-- tools/get-version-number.sh | 2 +- 21 files changed, 33 insertions(+), 24 deletions(-) diff --git a/Makefile.am b/Makefile.am index 4a5e4eb0..4d6576a1 100644 --- a/Makefile.am +++ b/Makefile.am @@ -201,7 +201,7 @@ libwim_la_CFLAGS = \ $(LIBNTFS_3G_CFLAGS) \ $(LIBFUSE_CFLAGS) -libwim_la_LDFLAGS = $(AM_LDFLAGS) -version-info 40:0:25 +libwim_la_LDFLAGS = $(AM_LDFLAGS) -version-info 41:0:26 libwim_la_LIBADD = \ $(PTHREAD_LIBS) \ diff --git a/NEWS.md b/NEWS.md index 5fc8677e..13d310de 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,14 @@ # wimlib release notes +## Version 1.14.4 + +- Fixed potential crash when writing WIM XML data, introduced in v1.14.0. + +- Improved some documentation. + +- Fixed the Windows build script to avoid an unnecessary DLL dependency when + building with MSYS2 MINGW32 or MSYS2 MINGW64. + ## Version 1.14.3 - Fixed a bug introduced in v1.14.0 where non-ASCII characters stopped being diff --git a/README.WINDOWS.md b/README.WINDOWS.md index 9dd6c000..aa3cf32a 100644 --- a/README.WINDOWS.md +++ b/README.WINDOWS.md @@ -107,9 +107,9 @@ After that, open any MSYS2 shell again and run the following commands: Note: By default the git repository will be on the `master` branch, which is the latest development snapshot. Optionally, you can check out a specific version, -e.g. `cd wimlib && git checkout v1.14.3`. For old versions, please refer to the +e.g. `cd wimlib && git checkout v1.14.4`. For old versions, please refer to the documentation for that version, as things may have changed. It is also possible -to use a release tarball (e.g. `wimlib-1.14.3.tar.gz`) instead of the git repo. +to use a release tarball (e.g. `wimlib-1.14.4.tar.gz`) instead of the git repo. Finally, to actually do a build, close the MSYS2 shell you have open, then open one of the following from the Start menu: @@ -127,7 +127,7 @@ one of the following from the Start menu: The script will automatically download and install the packages needed to build wimlib in the chosen MSYS2 environment, then build wimlib. The output will be -in a folder named similarly to `wimlib-1.14.3-windows-x86_64-bin`. Note that +in a folder named similarly to `wimlib-1.14.4-windows-x86_64-bin`. Note that your "home" folder within MSYS2 is `C:\msys64\home\%USERNAME%` by default. Therefore, the full path to the output folder will be similar to -`C:\msys64\home\%USERNAME%\wimlib\wimlib-1.14.3-windows-x86_64-bin`. +`C:\msys64\home\%USERNAME%\wimlib\wimlib-1.14.4-windows-x86_64-bin`. diff --git a/README.md b/README.md index 40d0d357..49b6f62b 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Introduction -This is wimlib version 1.14.3 (September 2023). wimlib is a C library for +This is wimlib version 1.14.4 (February 2024). wimlib is a C library for creating, modifying, extracting, and mounting files in the Windows Imaging Format (WIM files). wimlib and its command-line frontend `wimlib-imagex` provide a free and cross-platform alternative to Microsoft's WIMGAPI, ImageX, diff --git a/doc/man1/mkwinpeimg.1 b/doc/man1/mkwinpeimg.1 index e692e3ba..96fe747b 100644 --- a/doc/man1/mkwinpeimg.1 +++ b/doc/man1/mkwinpeimg.1 @@ -1,4 +1,4 @@ -.TH MKWINPEIMG "1" "September 2023" "wimlib 1.14.3" "User Commands" +.TH MKWINPEIMG "1" "February 2024" "wimlib 1.14.4" "User Commands" .SH NAME mkwinpeimg \- Make a customized bootable image of Windows PE .SH SYNOPSIS diff --git a/doc/man1/wimapply.1 b/doc/man1/wimapply.1 index d515d669..448fafda 100644 --- a/doc/man1/wimapply.1 +++ b/doc/man1/wimapply.1 @@ -1,4 +1,4 @@ -.TH WIMAPPLY "1" "September 2023" "wimlib 1.14.3" "User Commands" +.TH WIMAPPLY "1" "February 2024" "wimlib 1.14.4" "User Commands" .SH NAME wimapply \- Apply a WIM image .SH SYNOPSIS diff --git a/doc/man1/wimcapture.1 b/doc/man1/wimcapture.1 index b1cfa695..fe237b06 100644 --- a/doc/man1/wimcapture.1 +++ b/doc/man1/wimcapture.1 @@ -1,4 +1,4 @@ -.TH WIMCAPTURE "1" "September 2023" "wimlib 1.14.3" "User Commands" +.TH WIMCAPTURE "1" "February 2024" "wimlib 1.14.4" "User Commands" .SH NAME wimcapture, wimappend \- Capture or append a WIM image .SH SYNOPSIS diff --git a/doc/man1/wimdelete.1 b/doc/man1/wimdelete.1 index 49c136ef..9c323a46 100644 --- a/doc/man1/wimdelete.1 +++ b/doc/man1/wimdelete.1 @@ -1,4 +1,4 @@ -.TH WIMDELETE "1" "September 2023" "wimlib 1.14.3" "User Commands" +.TH WIMDELETE "1" "February 2024" "wimlib 1.14.4" "User Commands" .SH NAME wimdelete \- Delete an image from a WIM archive .SH SYNOPSIS diff --git a/doc/man1/wimdir.1 b/doc/man1/wimdir.1 index 0a09cc64..541c6aac 100644 --- a/doc/man1/wimdir.1 +++ b/doc/man1/wimdir.1 @@ -1,4 +1,4 @@ -.TH WIMDIR "1" "September 2023" "wimlib 1.14.3" "User Commands" +.TH WIMDIR "1" "February 2024" "wimlib 1.14.4" "User Commands" .SH NAME wimdir \- List the files contained in a WIM image .SH SYNOPSIS diff --git a/doc/man1/wimexport.1 b/doc/man1/wimexport.1 index e131413d..e99558fd 100644 --- a/doc/man1/wimexport.1 +++ b/doc/man1/wimexport.1 @@ -1,4 +1,4 @@ -.TH WIMEXPORT "1" "September 2023" "wimlib 1.14.3" "User Commands" +.TH WIMEXPORT "1" "February 2024" "wimlib 1.14.4" "User Commands" .SH NAME wimexport \- Export image(s) from a WIM archive .SH SYNOPSIS diff --git a/doc/man1/wimextract.1 b/doc/man1/wimextract.1 index 36e37cba..6fae7e04 100644 --- a/doc/man1/wimextract.1 +++ b/doc/man1/wimextract.1 @@ -1,4 +1,4 @@ -.TH WIMEXTRACT "1" "September 2023" "wimlib 1.14.3" "User Commands" +.TH WIMEXTRACT "1" "February 2024" "wimlib 1.14.4" "User Commands" .SH NAME wimextract \- Extract files from a WIM image .SH SYNOPSIS diff --git a/doc/man1/wiminfo.1 b/doc/man1/wiminfo.1 index e46d46cd..9df6fbc1 100644 --- a/doc/man1/wiminfo.1 +++ b/doc/man1/wiminfo.1 @@ -1,4 +1,4 @@ -.TH WIMINFO "1" "September 2023" "wimlib 1.14.3" "User Commands" +.TH WIMINFO "1" "February 2024" "wimlib 1.14.4" "User Commands" .SH NAME wiminfo \- Display or change information about a WIM file or image .SH SYNOPSIS diff --git a/doc/man1/wimjoin.1 b/doc/man1/wimjoin.1 index ba1f4be8..4e32457b 100644 --- a/doc/man1/wimjoin.1 +++ b/doc/man1/wimjoin.1 @@ -1,4 +1,4 @@ -.TH WIMJOIN "1" "September 2023" "wimlib 1.14.3" "User Commands" +.TH WIMJOIN "1" "February 2024" "wimlib 1.14.4" "User Commands" .SH NAME wimjoin\- Join a split WIM into a standalone WIM .SH SYNOPSIS diff --git a/doc/man1/wimlib-imagex.1 b/doc/man1/wimlib-imagex.1 index e92b5df0..f75be199 100644 --- a/doc/man1/wimlib-imagex.1 +++ b/doc/man1/wimlib-imagex.1 @@ -1,4 +1,4 @@ -.TH WIMLIB-IMAGEX 1 "September 2023" "wimlib 1.14.3" "User Commands" +.TH WIMLIB-IMAGEX 1 "February 2024" "wimlib 1.14.4" "User Commands" .SH NAME wimlib-imagex \- Extract, create, modify, or mount a WIM archive .SH SYNOPSIS diff --git a/doc/man1/wimmount.1 b/doc/man1/wimmount.1 index 6638652f..96484965 100644 --- a/doc/man1/wimmount.1 +++ b/doc/man1/wimmount.1 @@ -1,4 +1,4 @@ -.TH WIMMOUNT "1" "September 2023" "wimlib 1.14.3" "User Commands" +.TH WIMMOUNT "1" "February 2024" "wimlib 1.14.4" "User Commands" .SH NAME wimmount, wimmountrw, wimunmount \- Mount or unmount a WIM image .SH SYNOPSIS diff --git a/doc/man1/wimoptimize.1 b/doc/man1/wimoptimize.1 index c8839c85..4e20884f 100644 --- a/doc/man1/wimoptimize.1 +++ b/doc/man1/wimoptimize.1 @@ -1,4 +1,4 @@ -.TH WIMOPTIMIZE "1" "September 2023" "wimlib 1.14.3" "User Commands" +.TH WIMOPTIMIZE "1" "February 2024" "wimlib 1.14.4" "User Commands" .SH NAME wimoptimize \- Optimize a WIM archive .SH SYNOPSIS diff --git a/doc/man1/wimsplit.1 b/doc/man1/wimsplit.1 index 9e65eb80..d77d84cb 100644 --- a/doc/man1/wimsplit.1 +++ b/doc/man1/wimsplit.1 @@ -1,4 +1,4 @@ -.TH WIMSPLIT "1" "September 2023" "wimlib 1.14.3" "User Commands" +.TH WIMSPLIT "1" "February 2024" "wimlib 1.14.4" "User Commands" .SH NAME wimsplit \- Split a WIM archive into multiple parts .SH SYNOPSIS diff --git a/doc/man1/wimupdate.1 b/doc/man1/wimupdate.1 index c5c2e653..f1c82ba4 100644 --- a/doc/man1/wimupdate.1 +++ b/doc/man1/wimupdate.1 @@ -1,4 +1,4 @@ -.TH WIMUPDATE "1" "September 2023" "wimlib 1.14.3" "User Commands" +.TH WIMUPDATE "1" "February 2024" "wimlib 1.14.4" "User Commands" .SH NAME wimupdate \- Update a WIM image .SH SYNOPSIS diff --git a/doc/man1/wimverify.1 b/doc/man1/wimverify.1 index 02b65a56..e77af954 100644 --- a/doc/man1/wimverify.1 +++ b/doc/man1/wimverify.1 @@ -1,4 +1,4 @@ -.TH WIMVERIFY "1" "September 2023" "wimlib 1.14.3" "User Commands" +.TH WIMVERIFY "1" "February 2024" "wimlib 1.14.4" "User Commands" .SH NAME wimverify \- Verify a WIM archive .SH SYNOPSIS diff --git a/include/wimlib.h b/include/wimlib.h index 55ed0f45..84f1e2ec 100644 --- a/include/wimlib.h +++ b/include/wimlib.h @@ -11,7 +11,7 @@ /** * @mainpage * - * This is the documentation for the library interface of wimlib 1.14.3, a C + * This is the documentation for the library interface of wimlib 1.14.4, a C * library for creating, modifying, extracting, and mounting files in the * Windows Imaging (WIM) format. This documentation is intended for developers * only. If you have installed wimlib and want to know how to use the @b @@ -433,7 +433,7 @@ #define WIMLIB_MINOR_VERSION 14 /** Patch version of the library (for example, the 5 in 1.2.5). */ -#define WIMLIB_PATCH_VERSION 3 +#define WIMLIB_PATCH_VERSION 4 #ifdef __cplusplus extern "C" { diff --git a/tools/get-version-number.sh b/tools/get-version-number.sh index ef4f54ec..24533555 100755 --- a/tools/get-version-number.sh +++ b/tools/get-version-number.sh @@ -7,6 +7,6 @@ vers=$(git describe --abbrev=8 --dirty --always 2>/dev/null | \ sed 's/^v//') if [ -z "$vers" ]; then # Fallback for people who use autoreconf on tarball releases - vers="1.14.3" + vers="1.14.4" fi echo "$vers" -- 2.43.0 From e1a95c6cb545af2666414d52d6b5d676e4993a66 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Fri, 19 Apr 2024 22:21:52 -0700 Subject: [PATCH 16/16] mount_image.c: add fallback definitions of RENAME_* constants This is needed on older distros. Reported at https://wimlib.net/forums/viewtopic.php?t=743 --- src/mount_image.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/mount_image.c b/src/mount_image.c index 4702d60d..36bf1b97 100644 --- a/src/mount_image.c +++ b/src/mount_image.c @@ -74,6 +74,13 @@ # define ENOATTR ENODATA #endif +#ifndef RENAME_NOREPLACE +# define RENAME_NOREPLACE (1 << 0) +#endif +#ifndef RENAME_EXCHANGE +# define RENAME_EXCHANGE (1 << 1) +#endif + #define WIMFS_MQUEUE_NAME_LEN 32 #define WIMLIB_UNMOUNT_FLAG_SEND_PROGRESS 0x80000000 -- 2.43.0