From: Eric Biggers Date: Wed, 25 Nov 2015 04:18:48 +0000 (-0600) Subject: win32_apply.c: don't clear directory attributes in NO_ATTRIBUTES mode X-Git-Tag: v1.9.0~47 X-Git-Url: https://wimlib.net/git/?p=wimlib;a=commitdiff_plain;h=f84102ca83ae3ab8e6dffc4a1880d901b64d5442 win32_apply.c: don't clear directory attributes in NO_ATTRIBUTES mode --- 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.