]> wimlib.net Git - wimlib/blobdiff - src/win32_apply.c
NTFS-3g apply: Open extracted files by MFT reference
[wimlib] / src / win32_apply.c
index b59f7a8a0b6d795b273150e2cfe0ad3fc70f4da4..00ace99e7243963e8bf7dddcf1a6c4d2f861e2b6 100644 (file)
@@ -162,19 +162,19 @@ error:
 }
 
 static int
-win32_extract_unnamed_stream(const wchar_t *path,
+win32_extract_unnamed_stream(file_spec_t file,
                             struct wim_lookup_table_entry *lte,
                             struct apply_ctx *ctx)
 {
-       return win32_extract_stream(path, NULL, 0, lte, ctx);
+       return win32_extract_stream(file.path, NULL, 0, lte, ctx);
 }
 
 static int
-win32_extract_named_stream(const wchar_t *path, const wchar_t *stream_name,
+win32_extract_named_stream(file_spec_t file, const wchar_t *stream_name,
                           size_t stream_name_nchars,
                           struct wim_lookup_table_entry *lte, struct apply_ctx *ctx)
 {
-       return win32_extract_stream(path, stream_name,
+       return win32_extract_stream(file.path, stream_name,
                                    stream_name_nchars, lte, ctx);
 }
 
@@ -422,7 +422,7 @@ error:
 
 static int
 win32_set_security_descriptor(const wchar_t *path, const u8 *desc, size_t desc_size,
-                             struct apply_ctx *ctx, bool strict)
+                             struct apply_ctx *ctx)
 {
        SECURITY_INFORMATION info;
 
@@ -432,7 +432,8 @@ win32_set_security_descriptor(const wchar_t *path, const u8 *desc, size_t desc_s
                SACL_SECURITY_INFORMATION;
 retry:
        if (!SetFileSecurity(path, info, (PSECURITY_DESCRIPTOR)desc)) {
-               if (!strict && GetLastError() == ERROR_PRIVILEGE_NOT_HELD &&
+               if (!(ctx->extract_flags & WIMLIB_EXTRACT_FLAG_STRICT_ACLS) &&
+                   GetLastError() == ERROR_PRIVILEGE_NOT_HELD &&
                    (info & SACL_SECURITY_INFORMATION))
                {
                        info &= ~SACL_SECURITY_INFORMATION;