diff options
Diffstat (limited to 'runtime/shims/file_system.cpp')
| -rw-r--r-- | runtime/shims/file_system.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/runtime/shims/file_system.cpp b/runtime/shims/file_system.cpp index 0ca9e04ac..bc148d12a 100644 --- a/runtime/shims/file_system.cpp +++ b/runtime/shims/file_system.cpp | |||
| @@ -890,6 +890,13 @@ BOOL WINAPI delete_file_w(LPCWSTR name) { | |||
| 890 | SetLastError(ERROR_ACCESS_DENIED); | 890 | SetLastError(ERROR_ACCESS_DENIED); |
| 891 | return FALSE; | 891 | return FALSE; |
| 892 | } | 892 | } |
| 893 | // The overlay delete already checked its own attributes. Without an overlay, the package file's | ||
| 894 | // read-only bit still applies even though deletion only writes a marker instead of deleting that file. | ||
| 895 | if (!removed) { | ||
| 896 | const DWORD attributes = ::GetFileAttributesW(package_path.c_str()); | ||
| 897 | if (attributes != INVALID_FILE_ATTRIBUTES && (attributes & FILE_ATTRIBUTE_READONLY) != 0) | ||
| 898 | return fail_bool(ERROR_ACCESS_DENIED); | ||
| 899 | } | ||
| 893 | // The package file stays where it is; the marker is what hides it. | 900 | // The package file stays where it is; the marker is what hides it. |
| 894 | DWORD error = 0; | 901 | DWORD error = 0; |
| 895 | if (!write_marker(marker(r.overlay, parts), error)) return fail_bool(error); | 902 | if (!write_marker(marker(r.overlay, parts), error)) return fail_bool(error); |