From: Eric Biggers Date: Wed, 25 Nov 2015 04:19:01 +0000 (-0600) Subject: win32_apply.c: don't clear directory DACL in NO_ACLS mode X-Git-Tag: v1.9.0~46 X-Git-Url: https://wimlib.net/git/?p=wimlib;a=commitdiff_plain;h=0a378689b8aca5c1063010c633e4c75e2306eb1f;ds=sidebyside win32_apply.c: don't clear directory DACL in NO_ACLS mode --- diff --git a/src/win32_apply.c b/src/win32_apply.c index 4c2f97d3..ef0823ab 100644 --- a/src/win32_apply.c +++ b/src/win32_apply.c @@ -1675,15 +1675,18 @@ retry: * STATUS_ACCESS_DENIED when creating a named data stream that * was just deleted, using a directory-relative open. I have no * idea why Windows is broken in this case. */ - static const SECURITY_DESCRIPTOR_RELATIVE desc = { - .Revision = SECURITY_DESCRIPTOR_REVISION1, - .Control = SE_SELF_RELATIVE | SE_DACL_PRESENT, - .Owner = 0, - .Group = 0, - .Sacl = 0, - .Dacl = 0, - }; - (*func_NtSetSecurityObject)(h, DACL_SECURITY_INFORMATION, (void *)&desc); + if (!(ctx->common.extract_flags & WIMLIB_EXTRACT_FLAG_NO_ACLS)) { + static const SECURITY_DESCRIPTOR_RELATIVE desc = { + .Revision = SECURITY_DESCRIPTOR_REVISION1, + .Control = SE_SELF_RELATIVE | SE_DACL_PRESENT, + .Owner = 0, + .Group = 0, + .Sacl = 0, + .Dacl = 0, + }; + (*func_NtSetSecurityObject)(h, DACL_SECURITY_INFORMATION, + (void *)&desc); + } } if (!dentry_is_root(dentry)) {