From 21b92f96111d6d9b167611d6b32c4e0f06269b81 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Fri, 1 Mar 2024 23:44:13 -0600 Subject: [PATCH] server-File_Permissions: Remove patch 0001. This patch concerns the case where we successfully create a read-only directory with FILE_DELETE_ON_CLOSE. Currently we return STATUS_CANNOT_DELETE (having cleared O_CREAT). This patch would change that to return success. However, tests show that this is incorrect. Actually FILE_DELETE_ON_CLOSE should always fail on a read-only file, including when that file is created by the same call. --- ...TATUS_CANNOT_DELETE-checks-for-direc.patch | 42 ------------------- 1 file changed, 42 deletions(-) delete mode 100644 patches/server-File_Permissions/0001-server-Improve-STATUS_CANNOT_DELETE-checks-for-direc.patch diff --git a/patches/server-File_Permissions/0001-server-Improve-STATUS_CANNOT_DELETE-checks-for-direc.patch b/patches/server-File_Permissions/0001-server-Improve-STATUS_CANNOT_DELETE-checks-for-direc.patch deleted file mode 100644 index 9d8d290a..00000000 --- a/patches/server-File_Permissions/0001-server-Improve-STATUS_CANNOT_DELETE-checks-for-direc.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 6b5ac1e9eaf73aa0d6dddf8e7f53bd9802a25f5b Mon Sep 17 00:00:00 2001 -From: Sebastian Lackner -Date: Sun, 16 Oct 2016 03:21:42 +0200 -Subject: [PATCH] server: Improve STATUS_CANNOT_DELETE checks for directory - case. - ---- - server/fd.c | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/server/fd.c b/server/fd.c -index 784a8c08867..d238c43cf1f 100644 ---- a/server/fd.c -+++ b/server/fd.c -@@ -1825,6 +1825,7 @@ struct fd *open_fd( struct fd *root, const char *name, int flags, mode_t *mode, - int root_fd = -1; - int rw_mode; - char *path; -+ int created = (flags & O_CREAT); - - if (((options & FILE_DELETE_ON_CLOSE) && !(access & DELETE)) || - ((options & FILE_DIRECTORY_FILE) && (flags & O_TRUNC))) -@@ -1863,6 +1864,7 @@ struct fd *open_fd( struct fd *root, const char *name, int flags, mode_t *mode, - file_set_error(); - goto error; - } -+ created = 0; - } - flags &= ~(O_CREAT | O_EXCL | O_TRUNC); - } -@@ -1955,7 +1957,7 @@ struct fd *open_fd( struct fd *root, const char *name, int flags, mode_t *mode, - } - - /* can't unlink files if we don't have permission to access */ -- if ((options & FILE_DELETE_ON_CLOSE) && !(flags & O_CREAT) && -+ if ((options & FILE_DELETE_ON_CLOSE) && !created && - !(st.st_mode & (S_IWUSR | S_IWGRP | S_IWOTH))) - { - set_error( STATUS_CANNOT_DELETE ); --- -2.25.1 -