[PATCH 2/4] kernel32: Limit requested access to DELETE in DeleteFile

Ben Peddell klightspeed at netspace.net.au
Wed Jun 27 20:31:39 CDT 2012


Reduce the requested access mask

---
 dlls/kernel32/file.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/dlls/kernel32/file.c b/dlls/kernel32/file.c
index 18ed188..f69b778 100644
--- a/dlls/kernel32/file.c
+++ b/dlls/kernel32/file.c
@@ -1486,7 +1486,7 @@ BOOL WINAPI DeleteFileW( LPCWSTR path )
     attr.SecurityDescriptor = NULL;
     attr.SecurityQualityOfService = NULL;
 
-    status = NtCreateFile(&hFile, GENERIC_READ | GENERIC_WRITE | DELETE,
+    status = NtCreateFile(&hFile, DELETE,
 			  &attr, &io, NULL, 0,
 			  FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
 			  FILE_OPEN, FILE_DELETE_ON_CLOSE | FILE_NON_DIRECTORY_FILE, NULL, 0);
-- 
1.7.3.4




More information about the wine-patches mailing list