Rebase against 00e55c8fc0c08e14c39880e62526f8503468b641

This commit is contained in:
Alistair Leslie-Hughes
2020-03-24 08:55:13 +11:00
parent 7c7868f4bb
commit 75c7644c3d
10 changed files with 85 additions and 159 deletions

View File

@@ -1,25 +1,26 @@
From fb234cc16f1101ed2189ceb578b7d5f1f79ebe72 Mon Sep 17 00:00:00 2001
From 6b5ac1e9eaf73aa0d6dddf8e7f53bd9802a25f5b Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sun, 16 Oct 2016 03:21:42 +0200
Subject: server: Improve STATUS_CANNOT_DELETE checks for directory case.
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 17b1b66..77c7026 100644
index 784a8c08867..d238c43cf1f 100644
--- a/server/fd.c
+++ b/server/fd.c
@@ -1755,6 +1755,7 @@ struct fd *open_fd( struct fd *root, const char *name, int flags, mode_t *mode,
struct fd *fd;
@@ -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)))
@@ -1793,6 +1794,7 @@ struct fd *open_fd( struct fd *root, const char *name, int flags, mode_t *mode,
@@ -1863,6 +1864,7 @@ struct fd *open_fd( struct fd *root, const char *name, int flags, mode_t *mode,
file_set_error();
goto error;
}
@@ -27,7 +28,7 @@ index 17b1b66..77c7026 100644
}
flags &= ~(O_CREAT | O_EXCL | O_TRUNC);
}
@@ -1865,7 +1867,7 @@ struct fd *open_fd( struct fd *root, const char *name, int flags, mode_t *mode,
@@ -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 */
@@ -37,5 +38,5 @@ index 17b1b66..77c7026 100644
{
set_error( STATUS_CANNOT_DELETE );
--
2.9.0
2.25.1

View File

@@ -1,4 +1,4 @@
From 848a3f3238116a1cb172cd4ed6d9a54a31f945a7 Mon Sep 17 00:00:00 2001
From 9ecf9653d3f4d564f000d4e0f7f96ae0cd3610b2 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Fri, 3 Apr 2015 03:58:47 +0200
Subject: [PATCH] server: Allow to open files without any permission bits. (try
@@ -13,10 +13,10 @@ Changes in v2:
2 files changed, 32 insertions(+), 20 deletions(-)
diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c
index 0cc7bc9a594..5f152d0f42b 100644
index 1ec2e6bbb48..cc59210e609 100644
--- a/dlls/advapi32/tests/security.c
+++ b/dlls/advapi32/tests/security.c
@@ -3719,17 +3719,13 @@ static void test_CreateDirectoryA(void)
@@ -3702,17 +3702,13 @@ static void test_CreateDirectoryA(void)
error = pGetNamedSecurityInfoA(tmpfile, SE_FILE_OBJECT,
OWNER_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION,
(PSID *)&owner, NULL, &pDacl, NULL, &pSD);
@@ -40,7 +40,7 @@ index 0cc7bc9a594..5f152d0f42b 100644
CloseHandle(hTemp);
/* Test inheritance of ACLs in NtCreateFile without security descriptor */
@@ -3798,17 +3794,13 @@ static void test_CreateDirectoryA(void)
@@ -3781,17 +3777,13 @@ static void test_CreateDirectoryA(void)
error = pGetNamedSecurityInfoA(tmpfile, SE_FILE_OBJECT,
OWNER_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION,
(PSID *)&owner, NULL, &pDacl, NULL, &pSD);
@@ -65,18 +65,18 @@ index 0cc7bc9a594..5f152d0f42b 100644
done:
diff --git a/server/fd.c b/server/fd.c
index 33720176aa3..9fc8f28ec84 100644
index d238c43cf1f..8292a0b82f2 100644
--- a/server/fd.c
+++ b/server/fd.c
@@ -1824,6 +1824,7 @@ struct fd *open_fd( struct fd *root, const char *name, int flags, mode_t *mode,
struct fd *fd;
@@ -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 do_chmod = 0;
int created = (flags & O_CREAT);
if (((options & FILE_DELETE_ON_CLOSE) && !(access & DELETE)) ||
@@ -1892,10 +1893,28 @@ struct fd *open_fd( struct fd *root, const char *name, int flags, mode_t *mode,
@@ -1891,10 +1892,28 @@ struct fd *open_fd( struct fd *root, const char *name, int flags, mode_t *mode,
fd->unix_fd = open( name, rw_mode | O_SYMLINK | (flags & ~O_TRUNC), *mode );
}
#endif
@@ -105,7 +105,7 @@ index 33720176aa3..9fc8f28ec84 100644
goto error;
}
}
@@ -1903,6 +1922,7 @@ struct fd *open_fd( struct fd *root, const char *name, int flags, mode_t *mode,
@@ -1909,6 +1928,7 @@ struct fd *open_fd( struct fd *root, const char *name, int flags, mode_t *mode,
closed_fd->unix_fd = fd->unix_fd;
closed_fd->unlink = 0;
closed_fd->unix_name = fd->unix_name;
@@ -114,5 +114,5 @@ index 33720176aa3..9fc8f28ec84 100644
*mode = st.st_mode;
--
2.17.1
2.25.1