Rebase against 29dd84443976005a8ec713dd1c75458e27346591.

This commit is contained in:
Alistair Leslie-Hughes 2022-06-29 11:14:16 +10:00
parent 6be691c005
commit c9652a68e1
5 changed files with 39 additions and 34 deletions

View File

@ -1,8 +1,8 @@
From 35bc7e69e9100202e0f0d91ee66449a13ef4d075 Mon Sep 17 00:00:00 2001
From a25c97e1a004f773d8d1ad4d233aa140ca8d9c63 Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
Date: Tue, 30 Apr 2019 16:24:54 -0600
Subject: ntdll: Allow creation of dangling reparse points to non-existent
paths.
Subject: [PATCH] ntdll: Allow creation of dangling reparse points to
non-existent paths.
Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
---
@ -10,22 +10,22 @@ Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c
index e082ff5d322..e749e192f6f 100644
index 82abd3e451b..fb4b3b65756 100644
--- a/dlls/ntdll/unix/file.c
+++ b/dlls/ntdll/unix/file.c
@@ -3402,7 +3402,8 @@ static NTSTATUS lookup_unix_name( const WCHAR *name, int name_len, char **buffer
@@ -3394,7 +3394,8 @@ static NTSTATUS lookup_unix_name( const WCHAR *name, int name_len, char **buffer
/* if this is the last element, not finding it is not necessarily fatal */
if (!name_len)
{
- if (status == STATUS_OBJECT_PATH_NOT_FOUND)
+ if (status == STATUS_OBJECT_PATH_NOT_FOUND
- if (status == STATUS_OBJECT_NAME_NOT_FOUND)
+ if (status == STATUS_OBJECT_NAME_NOT_FOUND
+ || (disposition == FILE_WINE_PATH && status == STATUS_OBJECT_NAME_NOT_FOUND))
{
status = STATUS_OBJECT_NAME_NOT_FOUND;
if (disposition != FILE_OPEN && disposition != FILE_OVERWRITE)
@@ -3422,6 +3423,20 @@ static NTSTATUS lookup_unix_name( const WCHAR *name, int name_len, char **buffer
status = STATUS_OBJECT_NAME_COLLISION;
{
@@ -3416,6 +3417,20 @@ static NTSTATUS lookup_unix_name( const WCHAR *name, int name_len, char **buffer
}
if (end < next) strcat( unix_name, "/" );
}
+ else if (disposition == FILE_WINE_PATH && (status == STATUS_OBJECT_PATH_NOT_FOUND
+ || status == STATUS_OBJECT_NAME_NOT_FOUND))
@ -41,10 +41,10 @@ index e082ff5d322..e749e192f6f 100644
+ continue;
+ }
+ }
else if (status == STATUS_OBJECT_NAME_NOT_FOUND) status = STATUS_OBJECT_PATH_NOT_FOUND;
if (status != STATUS_SUCCESS) break;
@@ -6080,7 +6095,7 @@ NTSTATUS create_reparse_point(HANDLE handle, REPARSE_DATA_BUFFER *buffer)
@@ -6076,7 +6091,7 @@ NTSTATUS create_reparse_point(HANDLE handle, REPARSE_DATA_BUFFER *buffer)
status = STATUS_NO_MEMORY;
goto cleanup;
}
@ -54,5 +54,5 @@ index e082ff5d322..e749e192f6f 100644
free( unix_dest );
}
--
2.17.1
2.35.1

View File

@ -51,7 +51,7 @@ usage()
# Get the upstream commit sha
upstream_commit()
{
echo "af8ed02b572081206be6c505261f5f2e98a8053c"
echo "29dd84443976005a8ec713dd1c75458e27346591"
}
# Show version information

View File

@ -1,4 +1,4 @@
From c79db3f36aa653ec986ba948e547202fd95ed151 Mon Sep 17 00:00:00 2001
From fcd07d80234de455880990e2b2c488e9795f9dc0 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
@ -9,14 +9,14 @@ Changes in v2:
* Pay attention to requested access attributes - this fixes a couple more todo_wine's.
---
dlls/advapi32/tests/security.c | 32 ++++++++++++--------------------
server/fd.c | 20 ++++++++++++++++++++
2 files changed, 32 insertions(+), 20 deletions(-)
server/fd.c | 21 +++++++++++++++++++++
2 files changed, 33 insertions(+), 20 deletions(-)
diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c
index 135a45f7727..2147d0f1700 100644
index ed91ccc39d3..c534d1453d9 100644
--- a/dlls/advapi32/tests/security.c
+++ b/dlls/advapi32/tests/security.c
@@ -3710,17 +3710,13 @@ static void test_CreateDirectoryA(void)
@@ -3713,17 +3713,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 135a45f7727..2147d0f1700 100644
CloseHandle(hTemp);
/* Test inheritance of ACLs in NtCreateFile without security descriptor */
@@ -3789,17 +3785,13 @@ static void test_CreateDirectoryA(void)
@@ -3792,17 +3788,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,7 +65,7 @@ index 135a45f7727..2147d0f1700 100644
done:
diff --git a/server/fd.c b/server/fd.c
index 31b64b30d43..2ff0b480f40 100644
index bf59359de03..323dd92e653 100644
--- a/server/fd.c
+++ b/server/fd.c
@@ -2044,6 +2044,7 @@ struct fd *open_fd( struct fd *root, const char *name, struct unicode_str nt_nam
@ -76,7 +76,7 @@ index 31b64b30d43..2ff0b480f40 100644
int created = (flags & O_CREAT);
if (((options & FILE_DELETE_ON_CLOSE) && !(access & DELETE)) ||
@@ -2116,10 +2117,28 @@ struct fd *open_fd( struct fd *root, const char *name, struct unicode_str nt_nam
@@ -2116,6 +2117,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,12 +100,16 @@ index 31b64b30d43..2ff0b480f40 100644
if (fd->unix_fd == -1)
{
file_set_error();
@@ -2124,6 +2142,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();
+
+ if (do_chmod) chmod( name, *mode );
goto error;
}
}
@@ -2130,6 +2149,7 @@ struct fd *open_fd( struct fd *root, const char *name, struct unicode_str nt_nam
@@ -2134,6 +2154,7 @@ struct fd *open_fd( struct fd *root, const char *name, struct unicode_str nt_nam
closed_fd->unlink = 0;
closed_fd->unlink_name = fd->unlink_name;
closed_fd->unix_name = fd->unix_name;
@ -114,5 +118,5 @@ index 31b64b30d43..2ff0b480f40 100644
*mode = st.st_mode;
--
2.34.1
2.35.1

View File

@ -1,18 +1,19 @@
From c7b125afcbf75d7a95c0fcb78c0dadf8f30fd61f Mon Sep 17 00:00:00 2001
From 9de95b5af44aa9ac1cec60a27c70a546258a954d Mon Sep 17 00:00:00 2001
From: Qian Hong <qhong@codeweavers.com>
Date: Fri, 15 May 2015 15:28:17 +0800
Subject: ntdll/tests: Added tests for open behaviour on readonly files.
Subject: [PATCH] ntdll/tests: Added tests for open behaviour on readonly
files.
---
dlls/ntdll/tests/file.c | 78 +++++++++++++++++++++++++++++++++++++++++++++++++
dlls/ntdll/tests/file.c | 78 +++++++++++++++++++++++++++++++++++++++++
1 file changed, 78 insertions(+)
diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c
index 2df0edc..d365303 100644
index 35fab8ca427..5d6f9b83152 100644
--- a/dlls/ntdll/tests/file.c
+++ b/dlls/ntdll/tests/file.c
@@ -2073,6 +2073,83 @@ static void test_NtCreateFile(void)
DeleteFileW( path );
@@ -4259,6 +4259,83 @@ static void test_NtCreateFile(void)
RemoveDirectoryW( path );
}
+static void test_readonly(void)
@ -95,7 +96,7 @@ index 2df0edc..d365303 100644
static void test_read_write(void)
{
static const char contents[14] = "1234567890abcd";
@@ -2823,6 +2900,7 @@ START_TEST(file)
@@ -5838,6 +5915,7 @@ START_TEST(file)
test_read_write();
test_NtCreateFile();
@ -104,5 +105,5 @@ index 2df0edc..d365303 100644
open_file_test();
delete_file_test();
--
2.4.2
2.35.1

View File

@ -1 +1 @@
af8ed02b572081206be6c505261f5f2e98a8053c
29dd84443976005a8ec713dd1c75458e27346591