[PATCH 4/7] server: Allow setting delete disposition on a read-only directory.

Dmitry Timoshkov dmitry at baikal.ru
Thu Sep 27 03:30:54 CDT 2018


This makes next patch work for RemoveDirectory() call in
dlls/kernel32/tests/profile.c,test_profile_directory_readonly().

Signed-off-by: Dmitry Timoshkov <dmitry at baikal.ru>
---
 server/fd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/server/fd.c b/server/fd.c
index 6118f52dd5..65ff087f18 100644
--- a/server/fd.c
+++ b/server/fd.c
@@ -2247,8 +2247,8 @@ static void set_fd_disposition( struct fd *fd, int unlink )
         return;
     }
 
-    /* can't unlink files we don't have permission to access */
-    if (unlink && !(st.st_mode & (S_IWUSR | S_IWGRP | S_IWOTH)))
+    /* can't unlink files we don't have permission to write */
+    if (unlink && !(st.st_mode & (S_IWUSR | S_IWGRP | S_IWOTH)) && !S_ISDIR(st.st_mode))
     {
         set_error( STATUS_CANNOT_DELETE );
         return;
-- 
2.17.1




More information about the wine-devel mailing list