From f84102ca83ae3ab8e6dffc4a1880d901b64d5442 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Tue, 24 Nov 2015 22:18:48 -0600 Subject: [PATCH] win32_apply.c: don't clear directory attributes in NO_ATTRIBUTES mode --- src/win32_apply.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/win32_apply.c b/src/win32_apply.c index 34740732..4c2f97d3 100644 --- a/src/win32_apply.c +++ b/src/win32_apply.c @@ -1661,9 +1661,13 @@ retry: * directory, even though this contradicts Microsoft's * documentation for FILE_ATTRIBUTE_READONLY which states it is * not honored for directories! */ - FILE_BASIC_INFORMATION basic_info = { .FileAttributes = FILE_ATTRIBUTE_NORMAL }; - (*func_NtSetInformationFile)(h, &ctx->iosb, &basic_info, - sizeof(basic_info), FileBasicInformation); + if (!(ctx->common.extract_flags & WIMLIB_EXTRACT_FLAG_NO_ATTRIBUTES)) { + FILE_BASIC_INFORMATION basic_info = + { .FileAttributes = FILE_ATTRIBUTE_NORMAL }; + (*func_NtSetInformationFile)(h, &ctx->iosb, &basic_info, + sizeof(basic_info), + FileBasicInformation); + } /* Also try to remove the directory's DACL. This isn't supposed * to be necessary because we *always* use backup semantics. -- 2.43.0