From 0a378689b8aca5c1063010c633e4c75e2306eb1f Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Tue, 24 Nov 2015 22:19:01 -0600 Subject: [PATCH] win32_apply.c: don't clear directory DACL in NO_ACLS mode --- src/win32_apply.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) 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)) { -- 2.43.0