Rebase against 98b73b5c32fa82218081f0e7668f9836ffe1b55d.

This commit is contained in:
Alistair Leslie-Hughes
2023-06-28 08:27:58 +10:00
parent d94c192f10
commit ef85449de2
4 changed files with 44 additions and 94 deletions

View File

@@ -1,4 +1,4 @@
From bab7a4b5d00822b0a7965ac338a73538e06b5aa7 Mon Sep 17 00:00:00 2001
From e23cd96f76a62e983730d43e5d9ed401fdc09721 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,7 +13,7 @@ Changes in v2:
2 files changed, 33 insertions(+), 20 deletions(-)
diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c
index 51bf60d0f36..ed8db358ab8 100644
index 5e5000cfcb5..abb1b070f7d 100644
--- a/dlls/advapi32/tests/security.c
+++ b/dlls/advapi32/tests/security.c
@@ -3782,17 +3782,13 @@ static void test_CreateDirectoryA(void)
@@ -65,10 +65,10 @@ index 51bf60d0f36..ed8db358ab8 100644
done:
diff --git a/server/fd.c b/server/fd.c
index db265a9b1b8..f025d51a1e0 100644
index 3edfca018d1..fe6318b2e0e 100644
--- a/server/fd.c
+++ b/server/fd.c
@@ -2006,6 +2006,7 @@ struct fd *open_fd( struct fd *root, const char *name, struct unicode_str nt_nam
@@ -2047,6 +2047,7 @@ struct fd *open_fd( struct fd *root, const char *name, struct unicode_str nt_nam
int root_fd = -1;
int rw_mode;
char *path;
@@ -76,7 +76,7 @@ index db265a9b1b8..f025d51a1e0 100644
int created = (flags & O_CREAT);
if (((options & FILE_DELETE_ON_CLOSE) && !(access & DELETE)) ||
@@ -2074,6 +2075,23 @@ struct fd *open_fd( struct fd *root, const char *name, struct unicode_str nt_nam
@@ -2115,6 +2116,23 @@ struct fd *open_fd( struct fd *root, const char *name, struct unicode_str nt_nam
if ((access & FILE_UNIX_WRITE_ACCESS) || (flags & O_CREAT))
fd->unix_fd = open( name, O_RDONLY | (flags & ~(O_TRUNC | O_CREAT | O_EXCL)), *mode );
}
@@ -100,7 +100,7 @@ index db265a9b1b8..f025d51a1e0 100644
if (fd->unix_fd == -1)
{
@@ -2082,6 +2100,8 @@ struct fd *open_fd( struct fd *root, const char *name, struct unicode_str nt_nam
@@ -2123,6 +2141,8 @@ struct fd *open_fd( struct fd *root, const char *name, struct unicode_str nt_nam
set_error( STATUS_OBJECT_NAME_INVALID );
else
file_set_error();
@@ -109,14 +109,14 @@ index db265a9b1b8..f025d51a1e0 100644
goto error;
}
}
@@ -2097,6 +2117,7 @@ struct fd *open_fd( struct fd *root, const char *name, struct unicode_str nt_nam
@@ -2138,6 +2158,7 @@ struct fd *open_fd( struct fd *root, const char *name, struct unicode_str nt_nam
closed_fd->unix_fd = fd->unix_fd;
closed_fd->unlink = 0;
closed_fd->disp_flags = 0;
closed_fd->unix_name = fd->unix_name;
+ if (do_chmod) chmod( name, *mode );
fstat( fd->unix_fd, &st );
*mode = st.st_mode;
--
2.35.1
2.40.1