Rebase against 948a6a47b8dbd0ddd86cad04de03f0e4ba81b65d.

This commit is contained in:
Zebediah Figura
2020-06-12 18:15:13 -05:00
parent eb4f9db59c
commit b6595d9e28
23 changed files with 509 additions and 744 deletions

View File

@@ -1,4 +1,4 @@
From e171bdbabedaeaafc0181ee156bf08ef180809da Mon Sep 17 00:00:00 2001
From e3e2a837a2dd411b3e265581388fba1050e08c53 Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
Date: Thu, 16 Jan 2014 20:56:49 -0700
Subject: [PATCH] ntdll: Add support for junction point creation.
@@ -18,10 +18,10 @@ Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
create mode 100644 libs/port/renameat2.c
diff --git a/configure.ac b/configure.ac
index 816e3684510..a1b6096b9b7 100644
index 8a76b74e83d..d3bd12a6340 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2202,6 +2202,8 @@ AC_CHECK_FUNCS(\
@@ -2203,6 +2203,8 @@ AC_CHECK_FUNCS(\
pwrite \
readdir \
readlink \
@@ -31,7 +31,7 @@ index 816e3684510..a1b6096b9b7 100644
select \
setproctitle \
diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c
index 013706889bb..37dca75651c 100644
index b3e881ac3c9..5a4004a61a4 100644
--- a/dlls/ntdll/file.c
+++ b/dlls/ntdll/file.c
@@ -21,6 +21,7 @@
@@ -49,8 +49,8 @@ index 013706889bb..37dca75651c 100644
+#include "ntifs.h"
WINE_DEFAULT_DEBUG_CHANNEL(ntdll);
WINE_DECLARE_DEBUG_CHANNEL(winediag);
@@ -1663,6 +1665,104 @@ NTSTATUS WINAPI NtDeviceIoControlFile(HANDLE handle, HANDLE event,
@@ -1545,6 +1547,104 @@ NTSTATUS WINAPI NtDeviceIoControlFile(HANDLE handle, HANDLE event,
}
@@ -155,7 +155,7 @@ index 013706889bb..37dca75651c 100644
/**************************************************************************
* NtFsControlFile [NTDLL.@]
* ZwFsControlFile [NTDLL.@]
@@ -1747,6 +1847,24 @@ NTSTATUS WINAPI NtFsControlFile(HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc
@@ -1629,6 +1729,24 @@ NTSTATUS WINAPI NtFsControlFile(HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc
io->Information = 0;
status = STATUS_SUCCESS;
break;
@@ -181,7 +181,7 @@ index 013706889bb..37dca75651c 100644
return server_ioctl_file( handle, event, apc, apc_context, io, code,
in_buffer, in_size, out_buffer, out_size );
diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c
index 31c18454f0e..046b49c2d2b 100644
index 184b7cdad59..8b5ddbb0da1 100644
--- a/dlls/ntdll/tests/file.c
+++ b/dlls/ntdll/tests/file.c
@@ -38,6 +38,7 @@
@@ -192,7 +192,7 @@ index 31c18454f0e..046b49c2d2b 100644
#ifndef IO_COMPLETION_ALL_ACCESS
#define IO_COMPLETION_ALL_ACCESS 0x001F0003
@@ -4953,6 +4954,105 @@ static void test_file_readonly_access(void)
@@ -4971,6 +4972,105 @@ static void test_file_readonly_access(void)
DeleteFileW(path);
}
@@ -298,17 +298,17 @@ index 31c18454f0e..046b49c2d2b 100644
START_TEST(file)
{
HMODULE hkernel32 = GetModuleHandleA("kernel32.dll");
@@ -5023,4 +5123,5 @@ START_TEST(file)
@@ -5041,4 +5141,5 @@ START_TEST(file)
test_query_attribute_information_file();
test_ioctl();
test_flush_buffers_file();
+ test_reparse_points();
}
diff --git a/include/Makefile.in b/include/Makefile.in
index 9796dd8e5d9..410ae718e99 100644
index 9f70e72b4c7..1c5c456aa39 100644
--- a/include/Makefile.in
+++ b/include/Makefile.in
@@ -517,6 +517,7 @@ SOURCES = \
@@ -518,6 +518,7 @@ SOURCES = \
ntddvdeo.h \
ntdef.h \
ntdsapi.h \
@@ -458,5 +458,5 @@ index 00000000000..f46f407ec71
+}
+#endif /* HAVE_RENAMEAT2 */
--
2.26.2
2.27.0

View File

@@ -1,4 +1,4 @@
From 5b9831bcc26ab81b428b9c8f996c50b50c195a5d Mon Sep 17 00:00:00 2001
From 804bc6397bcf91a50ec6d13ca296e564ee19d689 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: [PATCH] ntdll: Allow creation of dangling reparse points to
@@ -6,16 +6,31 @@ Subject: [PATCH] ntdll: Allow creation of dangling reparse points to
Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
---
dlls/ntdll/directory.c | 13 +++++++++++++
dlls/ntdll/file.c | 3 ++-
dlls/ntdll/unix/file.c | 13 +++++++++++++
include/winternl.h | 1 +
3 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/dlls/ntdll/directory.c b/dlls/ntdll/directory.c
index 7b0627cd3d..669fd56cbe 100644
--- a/dlls/ntdll/directory.c
+++ b/dlls/ntdll/directory.c
@@ -2644,6 +2644,19 @@ static NTSTATUS lookup_unix_name( const WCHAR *name, int name_len, char **buffer
diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c
index 6c5da524aad..aad4ba5615b 100644
--- a/dlls/ntdll/file.c
+++ b/dlls/ntdll/file.c
@@ -1619,8 +1619,9 @@ NTSTATUS FILE_CreateSymlink(HANDLE handle, REPARSE_DATA_BUFFER *buffer)
RtlCreateUnicodeString( &nt_dest, dest );
nt_dest.Length = dest_len;
}
+
nt_dest_allocated = TRUE;
- status = wine_nt_to_unix_file_name( &nt_dest, &unix_dest, 0, FALSE );
+ status = wine_nt_to_unix_file_name( &nt_dest, &unix_dest, FILE_WINE_PATH, FALSE );
if (status != STATUS_SUCCESS && status != STATUS_NO_SUCH_FILE)
goto cleanup;
dest_allocated = TRUE;
diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c
index 13096e085e8..a2fc2a6425b 100644
--- a/dlls/ntdll/unix/file.c
+++ b/dlls/ntdll/unix/file.c
@@ -2726,6 +2726,19 @@ static NTSTATUS lookup_unix_name( const WCHAR *name, int name_len, char **buffer
status = STATUS_OBJECT_NAME_COLLISION;
}
}
@@ -35,26 +50,11 @@ index 7b0627cd3d..669fd56cbe 100644
if (status != STATUS_SUCCESS) break;
diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c
index e27382adf7..22764f05f3 100644
--- a/dlls/ntdll/file.c
+++ b/dlls/ntdll/file.c
@@ -1714,8 +1714,9 @@ NTSTATUS FILE_CreateSymlink(HANDLE handle, REPARSE_DATA_BUFFER *buffer)
RtlCreateUnicodeString( &nt_dest, dest );
nt_dest.Length = dest_len;
}
+
nt_dest_allocated = TRUE;
- status = wine_nt_to_unix_file_name( &nt_dest, &unix_dest, 0, FALSE );
+ status = wine_nt_to_unix_file_name( &nt_dest, &unix_dest, FILE_WINE_PATH, FALSE );
if (status != STATUS_SUCCESS && status != STATUS_NO_SUCH_FILE)
goto cleanup;
dest_allocated = TRUE;
diff --git a/include/winternl.h b/include/winternl.h
index e0a827a11c..b71e456b53 100644
index 39776d36f92..2e8c3866a3a 100644
--- a/include/winternl.h
+++ b/include/winternl.h
@@ -1816,6 +1816,7 @@ typedef struct _RTL_HANDLE_TABLE
@@ -1839,6 +1839,7 @@ typedef struct _RTL_HANDLE_TABLE
#define FILE_OVERWRITE 4
#define FILE_OVERWRITE_IF 5
#define FILE_MAXIMUM_DISPOSITION 5
@@ -63,5 +63,5 @@ index e0a827a11c..b71e456b53 100644
/* Characteristics of a File System */
#define FILE_REMOVABLE_MEDIA 0x00000001
--
2.24.1
2.27.0

View File

@@ -1,4 +1,4 @@
From 1a7f83237f0d843be63c947f3c9e2aaaa90156a8 Mon Sep 17 00:00:00 2001
From e17d27788c8368ac1d395c6e142c42249f1e02f4 Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
Date: Wed, 1 May 2019 17:48:51 -0600
Subject: [PATCH] ntdll: Find dangling symlinks quickly.
@@ -8,14 +8,14 @@ case-insensitive lookups of files.
Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
---
dlls/ntdll/directory.c | 6 +++---
dlls/ntdll/unix/file.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/dlls/ntdll/directory.c b/dlls/ntdll/directory.c
index 669fd56cbe..95af2dde24 100644
--- a/dlls/ntdll/directory.c
+++ b/dlls/ntdll/directory.c
@@ -2053,7 +2053,7 @@ static NTSTATUS find_file_in_dir( char *unix_name, int pos, const WCHAR *name, i
diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c
index a2fc2a6425b..66ce2eb5fe4 100644
--- a/dlls/ntdll/unix/file.c
+++ b/dlls/ntdll/unix/file.c
@@ -2146,7 +2146,7 @@ static NTSTATUS find_file_in_dir( char *unix_name, int pos, const WCHAR *name, i
if (ret >= 0 && ret <= MAX_DIR_ENTRY_LEN)
{
unix_name[pos + ret] = 0;
@@ -24,7 +24,7 @@ index 669fd56cbe..95af2dde24 100644
{
if (is_win_dir) *is_win_dir = is_same_file( &windir, &st );
return STATUS_SUCCESS;
@@ -2175,7 +2175,7 @@ not_found:
@@ -2257,7 +2257,7 @@ not_found:
return STATUS_OBJECT_PATH_NOT_FOUND;
success:
@@ -33,7 +33,7 @@ index 669fd56cbe..95af2dde24 100644
return STATUS_SUCCESS;
}
@@ -2580,7 +2580,7 @@ static NTSTATUS lookup_unix_name( const WCHAR *name, int name_len, char **buffer
@@ -2662,7 +2662,7 @@ static NTSTATUS lookup_unix_name( const WCHAR *name, int name_len, char **buffer
for (p = unix_name + pos ; *p; p++) if (*p == '\\') *p = '/';
if (!name_len || !redirect || (!strstr( unix_name, "/windows/") && strncmp( unix_name, "windows/", 8 )))
{
@@ -43,5 +43,5 @@ index 669fd56cbe..95af2dde24 100644
if (disposition == FILE_CREATE)
return STATUS_OBJECT_NAME_COLLISION;
--
2.24.1
2.27.0