From 94fd0e32a64292c4e40b98fe542f4be78112e3c9 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Sun, 18 Oct 2015 21:36:02 -0500 Subject: [PATCH] win32_apply.c: dereference reparse point when opening target dir --- NEWS | 2 ++ src/win32_apply.c | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index ffaa3db8..1f27d735 100644 --- a/NEWS +++ b/NEWS @@ -21,6 +21,8 @@ Version 1.8.3-BETA: Improved performance of wimlib_update_image() by delaying the update to the WIM's XML document until a write is requested. + On Windows, the target of an extraction may now be a reparse point. + Several improvements to System Compression (compact mode) support: wof.sys (or wofadk.sys) is now automatically attached to the diff --git a/src/win32_apply.c b/src/win32_apply.c index a19d138f..9ed563bb 100644 --- a/src/win32_apply.c +++ b/src/win32_apply.c @@ -989,6 +989,9 @@ open_target_directory(struct win32_apply_ctx *ctx) ctx->attr.Length = sizeof(ctx->attr); ctx->attr.RootDirectory = NULL; ctx->attr.ObjectName = &ctx->target_ntpath; + + /* Don't use FILE_OPEN_REPARSE_POINT here; we want the extraction to + * happen at the directory "pointed to" by the reparse point. */ status = (*func_NtCreateFile)(&ctx->h_target, FILE_TRAVERSE, &ctx->attr, @@ -998,7 +1001,6 @@ open_target_directory(struct win32_apply_ctx *ctx) FILE_SHARE_VALID_FLAGS, FILE_OPEN_IF, FILE_DIRECTORY_FILE | - FILE_OPEN_REPARSE_POINT | FILE_OPEN_FOR_BACKUP_INTENT, NULL, 0); -- 2.43.0