ntdll-Junction_Points: Updates from Erich E. Hoover.

This commit is contained in:
Zebediah Figura 2021-03-05 21:27:36 -06:00
parent f4cb879b3d
commit 89c049ee68
38 changed files with 167 additions and 152 deletions

View File

@ -1,4 +1,4 @@
From 5b5d3c574a0586bf6690db9957dbe6708a8801ec Mon Sep 17 00:00:00 2001
From 719f4d5ab7ba2b2e9f3797dfce0370fa5cba5a66 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.
@ -14,10 +14,10 @@ Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
create mode 100644 include/ntifs.h
diff --git a/configure.ac b/configure.ac
index 0510b47963a..26af8a0a4b7 100644
index ce6bad68f68..11f57d13274 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2216,6 +2216,8 @@ AC_CHECK_FUNCS(\
@@ -2218,6 +2218,8 @@ AC_CHECK_FUNCS(\
proc_pidinfo \
pwrite \
readlink \
@ -152,7 +152,7 @@ index 498da270a34..792c07b0d8e 100644
test_mailslot_name();
}
diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c
index e9d88320bc2..a5b3d5090aa 100644
index a4728003cf8..ea9c0d811f5 100644
--- a/dlls/ntdll/unix/file.c
+++ b/dlls/ntdll/unix/file.c
@@ -36,6 +36,7 @@
@ -215,7 +215,7 @@ index e9d88320bc2..a5b3d5090aa 100644
/* get space from the current directory data buffer, allocating a new one if necessary */
static void *get_dir_data_space( struct dir_data *data, unsigned int size )
{
@@ -5840,6 +5872,116 @@ static void ignore_server_ioctl_struct_holes( ULONG code, const void *in_buffer,
@@ -5806,6 +5838,116 @@ static void ignore_server_ioctl_struct_holes( ULONG code, const void *in_buffer,
}
@ -332,7 +332,7 @@ index e9d88320bc2..a5b3d5090aa 100644
/******************************************************************************
* NtFsControlFile (NTDLL.@)
*/
@@ -5922,6 +6064,23 @@ NTSTATUS WINAPI NtFsControlFile( HANDLE handle, HANDLE event, PIO_APC_ROUTINE ap
@@ -5888,6 +6030,23 @@ NTSTATUS WINAPI NtFsControlFile( HANDLE handle, HANDLE event, PIO_APC_ROUTINE ap
break;
}

View File

@ -1,4 +1,4 @@
From 115fc2745111b35ae65ea5c046428b93655d0a65 Mon Sep 17 00:00:00 2001
From ba7660d29357412b0a12475dacd1d96da9d5679c Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
Date: Thu, 16 Jan 2014 20:57:57 -0700
Subject: [PATCH] ntdll: Add support for reading junction points.
@ -44,10 +44,10 @@ index 792c07b0d8e..88e114ab7a2 100644
cleanup:
diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c
index a5b3d5090aa..13cc797e54e 100644
index ea9c0d811f5..6389e7c8f20 100644
--- a/dlls/ntdll/unix/file.c
+++ b/dlls/ntdll/unix/file.c
@@ -5982,6 +5982,120 @@ cleanup:
@@ -5948,6 +5948,120 @@ cleanup:
}
@ -168,7 +168,7 @@ index a5b3d5090aa..13cc797e54e 100644
/******************************************************************************
* NtFsControlFile (NTDLL.@)
*/
@@ -6064,6 +6178,12 @@ NTSTATUS WINAPI NtFsControlFile( HANDLE handle, HANDLE event, PIO_APC_ROUTINE ap
@@ -6030,6 +6144,12 @@ NTSTATUS WINAPI NtFsControlFile( HANDLE handle, HANDLE event, PIO_APC_ROUTINE ap
break;
}

View File

@ -1,4 +1,4 @@
From 0a6eefc1c56cad4d75aa9a1384a94f2fd2d8bec9 Mon Sep 17 00:00:00 2001
From 7554efacce44c930a981312bcf341b74e896fc17 Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
Date: Thu, 16 Jan 2014 21:00:21 -0700
Subject: [PATCH] ntdll: Add support for deleting junction points.
@ -72,10 +72,10 @@ index 88e114ab7a2..0dcefdef97b 100644
ok(bret, "Failed to remove temporary target directory!\n");
RemoveDirectoryW(path);
diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c
index 13cc797e54e..28191fb9258 100644
index 6389e7c8f20..982df84d029 100644
--- a/dlls/ntdll/unix/file.c
+++ b/dlls/ntdll/unix/file.c
@@ -6096,6 +6096,87 @@ cleanup:
@@ -6062,6 +6062,87 @@ cleanup:
}
@ -163,7 +163,7 @@ index 13cc797e54e..28191fb9258 100644
/******************************************************************************
* NtFsControlFile (NTDLL.@)
*/
@@ -6178,6 +6259,22 @@ NTSTATUS WINAPI NtFsControlFile( HANDLE handle, HANDLE event, PIO_APC_ROUTINE ap
@@ -6144,6 +6225,22 @@ NTSTATUS WINAPI NtFsControlFile( HANDLE handle, HANDLE event, PIO_APC_ROUTINE ap
break;
}

View File

@ -1,4 +1,4 @@
From 68608b8100a07e22e873bc07dfd71bca128195f0 Mon Sep 17 00:00:00 2001
From c0fe3802d5baca7d4048abfca0dcc261fb63ad2c Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
Date: Thu, 16 Jan 2014 21:01:25 -0700
Subject: [PATCH] ntdll: Add a test for junction point advertisement.

View File

@ -1,4 +1,4 @@
From b56a57487422e65693d0308ac2a0683ec7bb21ce Mon Sep 17 00:00:00 2001
From 55571cb23f81d2d5836c69793d5621f09f535009 Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
Date: Thu, 16 Jan 2014 21:02:11 -0700
Subject: [PATCH] server: Add support for deleting junction points with

View File

@ -1,4 +1,4 @@
From 1b9189f1aecf65f2ab73b5e26a1707e11c7d1926 Mon Sep 17 00:00:00 2001
From 2086a18555c0c4111c48676af90c642828ce87f5 Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@wine-staging.com>
Date: Sat, 12 Dec 2020 17:28:31 -0700
Subject: [PATCH] kernel32: Advertise junction point support.

View File

@ -1,4 +1,4 @@
From 572dccf8ef60557faa7ccf3495940d22487de7c1 Mon Sep 17 00:00:00 2001
From 7e61f5b75c7bebded9476d271e5a1377a63938b1 Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
Date: Thu, 16 Jan 2014 21:06:24 -0700
Subject: [PATCH] ntdll: Add support for absolute symlink creation.
@ -6,9 +6,9 @@ Subject: [PATCH] ntdll: Add support for absolute symlink creation.
Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
---
dlls/ntdll/tests/file.c | 117 ++++++++++++++++++++++++++++++++++------
dlls/ntdll/unix/file.c | 35 ++++++++++--
dlls/ntdll/unix/file.c | 33 ++++++++++--
include/ntifs.h | 10 ++++
3 files changed, 143 insertions(+), 19 deletions(-)
3 files changed, 141 insertions(+), 19 deletions(-)
diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c
index 5882793c883..53a24574eec 100644
@ -193,10 +193,10 @@ index 5882793c883..53a24574eec 100644
}
diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c
index 28191fb9258..25b26d963ef 100644
index 982df84d029..11a7269c09e 100644
--- a/dlls/ntdll/unix/file.c
+++ b/dlls/ntdll/unix/file.c
@@ -5879,18 +5879,34 @@ static void ignore_server_ioctl_struct_holes( ULONG code, const void *in_buffer,
@@ -5845,18 +5845,34 @@ static void ignore_server_ioctl_struct_holes( ULONG code, const void *in_buffer,
NTSTATUS FILE_CreateSymlink(HANDLE handle, REPARSE_DATA_BUFFER *buffer)
{
BOOL src_allocated = FALSE, dest_allocated = FALSE, tempdir_created = FALSE;
@ -234,26 +234,24 @@ index 28191fb9258..25b26d963ef 100644
if ((status = server_get_unix_fd( handle, FILE_SPECIAL_ACCESS, &dest_fd, &needs_close, NULL, NULL )))
return status;
@@ -5925,6 +5941,18 @@ NTSTATUS FILE_CreateSymlink(HANDLE handle, REPARSE_DATA_BUFFER *buffer)
@@ -5891,6 +5907,16 @@ NTSTATUS FILE_CreateSymlink(HANDLE handle, REPARSE_DATA_BUFFER *buffer)
strcat( magic_dest, "." );
strcat( magic_dest, "/" );
}
+ /* Encode the type (file or directory) if NT symlink */
+ if (buffer->ReparseTag == IO_REPARSE_TAG_SYMLINK)
+ {
+ if (fstat( dest_fd, &st ) == -1)
+ {
+ status = errno_to_status( errno );
+ goto cleanup;
+ }
+ if (S_ISDIR(st.st_mode))
+ BOOL is_dir = FALSE; /* treat dangling symlinks as files */
+ if (!stat( unix_dest, &st ))
+ is_dir = S_ISDIR(st.st_mode);
+ if (is_dir)
+ strcat( magic_dest, "." );
+ strcat( magic_dest, "/" );
+ }
strcat( magic_dest, unix_dest );
/* Produce the link in a temporary location in the same folder */
@@ -6288,6 +6316,7 @@ NTSTATUS WINAPI NtFsControlFile( HANDLE handle, HANDLE event, PIO_APC_ROUTINE ap
@@ -6254,6 +6280,7 @@ NTSTATUS WINAPI NtFsControlFile( HANDLE handle, HANDLE event, PIO_APC_ROUTINE ap
switch(buffer->ReparseTag)
{
case IO_REPARSE_TAG_MOUNT_POINT:

View File

@ -1,4 +1,4 @@
From f65a80d742f049407acfb3fb6bccf9e037fcbcf9 Mon Sep 17 00:00:00 2001
From 59ba8b3a0f29945da7e1f082b197ce398bf442f2 Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
Date: Wed, 13 Mar 2019 12:55:20 -0600
Subject: [PATCH] ntdll: Add support for reading absolute symlinks.
@ -41,10 +41,10 @@ index 53a24574eec..9a6f72cb783 100644
/* Cleanup */
pRtlFreeUnicodeString(&nameW);
diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c
index 25b26d963ef..c8b04601efa 100644
index 11a7269c09e..19a2d0ae471 100644
--- a/dlls/ntdll/unix/file.c
+++ b/dlls/ntdll/unix/file.c
@@ -6024,6 +6024,7 @@ NTSTATUS FILE_GetSymlink(HANDLE handle, REPARSE_DATA_BUFFER *buffer, ULONG out_s
@@ -5988,6 +5988,7 @@ NTSTATUS FILE_GetSymlink(HANDLE handle, REPARSE_DATA_BUFFER *buffer, ULONG out_s
int unix_dest_len;
DWORD max_length;
NTSTATUS status;
@ -52,7 +52,7 @@ index 25b26d963ef..c8b04601efa 100644
WCHAR *nt_dest;
INT prefix_len;
ssize_t ret;
@@ -6068,6 +6069,17 @@ NTSTATUS FILE_GetSymlink(HANDLE handle, REPARSE_DATA_BUFFER *buffer, ULONG out_s
@@ -6032,6 +6033,17 @@ NTSTATUS FILE_GetSymlink(HANDLE handle, REPARSE_DATA_BUFFER *buffer, ULONG out_s
}
buffer->ReparseTag |= (val << i);
}
@ -70,7 +70,7 @@ index 25b26d963ef..c8b04601efa 100644
unix_dest_len -= (p - unix_dest);
memmove(unix_dest, p, unix_dest_len);
unix_dest[unix_dest_len] = 0;
@@ -6101,6 +6113,16 @@ NTSTATUS FILE_GetSymlink(HANDLE handle, REPARSE_DATA_BUFFER *buffer, ULONG out_s
@@ -6065,6 +6077,16 @@ NTSTATUS FILE_GetSymlink(HANDLE handle, REPARSE_DATA_BUFFER *buffer, ULONG out_s
buffer->MountPointReparseBuffer.PrintNameLength = nt_dest_len - prefix_len*sizeof(WCHAR);
print_name = &buffer->MountPointReparseBuffer.PathBuffer[buffer->MountPointReparseBuffer.PrintNameOffset/sizeof(WCHAR)];
break;

View File

@ -1,4 +1,4 @@
From 1916474827593c822e41141d6e928001b408ee92 Mon Sep 17 00:00:00 2001
From a563404dcdc796241cb83da788c5ac62dfe1fc17 Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
Date: Wed, 13 Mar 2019 13:02:22 -0600
Subject: [PATCH] ntdll: Add support for deleting symlinks.
@ -37,10 +37,10 @@ index 9a6f72cb783..dd21083ebbb 100644
cleanup:
diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c
index c8b04601efa..af01a1646c5 100644
index 19a2d0ae471..4e16db830d2 100644
--- a/dlls/ntdll/unix/file.c
+++ b/dlls/ntdll/unix/file.c
@@ -6316,6 +6316,7 @@ NTSTATUS WINAPI NtFsControlFile( HANDLE handle, HANDLE event, PIO_APC_ROUTINE ap
@@ -6280,6 +6280,7 @@ NTSTATUS WINAPI NtFsControlFile( HANDLE handle, HANDLE event, PIO_APC_ROUTINE ap
switch(buffer->ReparseTag)
{
case IO_REPARSE_TAG_MOUNT_POINT:

View File

@ -1,4 +1,4 @@
From 0fe1cf1db4e5115170a225596688b12bed103fe2 Mon Sep 17 00:00:00 2001
From b5698ce1750769a0b57372be14bf4efb5f1c872c Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
Date: Thu, 11 Apr 2019 12:16:49 -0600
Subject: [PATCH] ntdll: Add support for relative symlink creation.
@ -101,10 +101,10 @@ index dd21083ebbb..8ed749cfe33 100644
/* Cleanup */
pRtlFreeUnicodeString(&nameW);
diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c
index af01a1646c5..28862eff52e 100644
index 4e16db830d2..45aab990fb5 100644
--- a/dlls/ntdll/unix/file.c
+++ b/dlls/ntdll/unix/file.c
@@ -5878,17 +5878,20 @@ static void ignore_server_ioctl_struct_holes( ULONG code, const void *in_buffer,
@@ -5844,17 +5844,20 @@ static void ignore_server_ioctl_struct_holes( ULONG code, const void *in_buffer,
*/
NTSTATUS FILE_CreateSymlink(HANDLE handle, REPARSE_DATA_BUFFER *buffer)
{
@ -127,7 +127,7 @@ index af01a1646c5..28862eff52e 100644
int i;
switch(buffer->ReparseTag)
@@ -5897,11 +5900,13 @@ NTSTATUS FILE_CreateSymlink(HANDLE handle, REPARSE_DATA_BUFFER *buffer)
@@ -5863,11 +5866,13 @@ NTSTATUS FILE_CreateSymlink(HANDLE handle, REPARSE_DATA_BUFFER *buffer)
dest_len = buffer->MountPointReparseBuffer.SubstituteNameLength;
offset = buffer->MountPointReparseBuffer.SubstituteNameOffset;
dest = &buffer->MountPointReparseBuffer.PathBuffer[offset];
@ -141,7 +141,7 @@ index af01a1646c5..28862eff52e 100644
break;
default:
return STATUS_NOT_IMPLEMENTED;
@@ -5913,8 +5918,66 @@ NTSTATUS FILE_CreateSymlink(HANDLE handle, REPARSE_DATA_BUFFER *buffer)
@@ -5879,8 +5884,66 @@ NTSTATUS FILE_CreateSymlink(HANDLE handle, REPARSE_DATA_BUFFER *buffer)
if ((status = server_get_unix_name( handle, &unix_src )))
goto cleanup;
src_allocated = TRUE;
@ -210,7 +210,7 @@ index af01a1646c5..28862eff52e 100644
for (;;)
{
unix_dest = malloc( unix_dest_len );
@@ -5930,11 +5993,24 @@ NTSTATUS FILE_CreateSymlink(HANDLE handle, REPARSE_DATA_BUFFER *buffer)
@@ -5896,11 +5959,24 @@ NTSTATUS FILE_CreateSymlink(HANDLE handle, REPARSE_DATA_BUFFER *buffer)
if (status != STATUS_SUCCESS && status != STATUS_NO_SUCH_FILE)
goto cleanup;
dest_allocated = TRUE;
@ -237,7 +237,7 @@ index af01a1646c5..28862eff52e 100644
for (i = 0; i < sizeof(ULONG)*8; i++)
{
if ((buffer->ReparseTag >> i) & 1)
@@ -5953,7 +6029,7 @@ NTSTATUS FILE_CreateSymlink(HANDLE handle, REPARSE_DATA_BUFFER *buffer)
@@ -5917,7 +5993,7 @@ NTSTATUS FILE_CreateSymlink(HANDLE handle, REPARSE_DATA_BUFFER *buffer)
strcat( magic_dest, "." );
strcat( magic_dest, "/" );
}
@ -246,7 +246,7 @@ index af01a1646c5..28862eff52e 100644
/* Produce the link in a temporary location in the same folder */
strcpy( tmpdir, unix_src );
@@ -6003,7 +6079,9 @@ NTSTATUS FILE_CreateSymlink(HANDLE handle, REPARSE_DATA_BUFFER *buffer)
@@ -5967,7 +6043,9 @@ NTSTATUS FILE_CreateSymlink(HANDLE handle, REPARSE_DATA_BUFFER *buffer)
cleanup:
if (tempdir_created) rmdir( tmpdir );

View File

@ -1,4 +1,4 @@
From dccfec5e07225d3be4ff653d294a4d49a3663c34 Mon Sep 17 00:00:00 2001
From 26b27a370a0fac1344dc6f480648d6698a10876e Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
Date: Thu, 11 Apr 2019 12:31:16 -0600
Subject: [PATCH] ntdll: Add support for reading relative symlinks.
@ -38,10 +38,10 @@ index 8ed749cfe33..bdc1a151b45 100644
/* Cleanup */
pRtlFreeUnicodeString(&nameW);
diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c
index 28862eff52e..1554d19cc01 100644
index 45aab990fb5..522cc38f2fc 100644
--- a/dlls/ntdll/unix/file.c
+++ b/dlls/ntdll/unix/file.c
@@ -6125,6 +6125,11 @@ NTSTATUS FILE_GetSymlink(HANDLE handle, REPARSE_DATA_BUFFER *buffer, ULONG out_s
@@ -6089,6 +6089,11 @@ NTSTATUS FILE_GetSymlink(HANDLE handle, REPARSE_DATA_BUFFER *buffer, ULONG out_s
/* Decode the reparse tag from the symlink */
p = unix_dest;
@ -53,7 +53,7 @@ index 28862eff52e..1554d19cc01 100644
if (*p++ != '/')
{
status = STATUS_NOT_IMPLEMENTED;
@@ -6162,24 +6167,47 @@ NTSTATUS FILE_GetSymlink(HANDLE handle, REPARSE_DATA_BUFFER *buffer, ULONG out_s
@@ -6126,24 +6131,47 @@ NTSTATUS FILE_GetSymlink(HANDLE handle, REPARSE_DATA_BUFFER *buffer, ULONG out_s
memmove(unix_dest, p, unix_dest_len);
unix_dest[unix_dest_len] = 0;

View File

@ -1,4 +1,4 @@
From faa53ece23717100c6d2ae407e8871576c3bb3f6 Mon Sep 17 00:00:00 2001
From 9dd02015d50ecfdf378fe5cced2697f50eb56794 Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
Date: Thu, 11 Apr 2019 17:57:53 -0600
Subject: [PATCH] ntdll: Add support for file symlinks.
@ -6,8 +6,8 @@ Subject: [PATCH] ntdll: Add support for file symlinks.
Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
---
dlls/ntdll/tests/file.c | 29 +++++++++++++++++++++++++++++
dlls/ntdll/unix/file.c | 27 ++++++++++++++++++++++-----
2 files changed, 51 insertions(+), 5 deletions(-)
dlls/ntdll/unix/file.c | 26 +++++++++++++++++++++-----
2 files changed, 50 insertions(+), 5 deletions(-)
diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c
index bdc1a151b45..8938c5bf50c 100644
@ -50,10 +50,10 @@ index bdc1a151b45..8938c5bf50c 100644
ok(bret, "Failed to create junction point directory.\n");
dwret = GetFileAttributesW(reparse_path);
diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c
index 1554d19cc01..d7b65399e64 100644
index 522cc38f2fc..0655371dc66 100644
--- a/dlls/ntdll/unix/file.c
+++ b/dlls/ntdll/unix/file.c
@@ -5888,6 +5888,7 @@ NTSTATUS FILE_CreateSymlink(HANDLE handle, REPARSE_DATA_BUFFER *buffer)
@@ -5854,6 +5854,7 @@ NTSTATUS FILE_CreateSymlink(HANDLE handle, REPARSE_DATA_BUFFER *buffer)
int relative_offset = 0;
UNICODE_STRING nt_dest;
int dest_len, offset;
@ -61,17 +61,16 @@ index 1554d19cc01..d7b65399e64 100644
NTSTATUS status;
struct stat st;
WCHAR *dest;
@@ -6025,7 +6026,8 @@ NTSTATUS FILE_CreateSymlink(HANDLE handle, REPARSE_DATA_BUFFER *buffer)
status = errno_to_status( errno );
goto cleanup;
}
- if (S_ISDIR(st.st_mode))
+ is_dir = S_ISDIR(st.st_mode);
+ if (is_dir)
strcat( magic_dest, "." );
strcat( magic_dest, "/" );
}
@@ -6052,8 +6054,11 @@ NTSTATUS FILE_CreateSymlink(HANDLE handle, REPARSE_DATA_BUFFER *buffer)
@@ -5986,7 +5987,7 @@ NTSTATUS FILE_CreateSymlink(HANDLE handle, REPARSE_DATA_BUFFER *buffer)
/* Encode the type (file or directory) if NT symlink */
if (buffer->ReparseTag == IO_REPARSE_TAG_SYMLINK)
{
- BOOL is_dir = FALSE; /* treat dangling symlinks as files */
+ is_dir = FALSE; /* treat dangling symlinks as files */
if (!stat( unix_dest, &st ))
is_dir = S_ISDIR(st.st_mode);
if (is_dir)
@@ -6016,8 +6017,11 @@ NTSTATUS FILE_CreateSymlink(HANDLE handle, REPARSE_DATA_BUFFER *buffer)
/* Atomically move the link into position */
if (!renameat2( -1, tmplink, -1, unix_src, RENAME_EXCHANGE ))
{
@ -85,7 +84,7 @@ index 1554d19cc01..d7b65399e64 100644
}
else if (errno == ENOSYS)
{
@@ -6261,6 +6266,7 @@ NTSTATUS FILE_RemoveSymlink(HANDLE handle, REPARSE_GUID_DATA_BUFFER *buffer)
@@ -6225,6 +6229,7 @@ NTSTATUS FILE_RemoveSymlink(HANDLE handle, REPARSE_GUID_DATA_BUFFER *buffer)
char tmpdir[PATH_MAX], tmpfile[PATH_MAX], *d;
BOOL tempdir_created = FALSE;
int dest_fd, needs_close;
@ -93,7 +92,7 @@ index 1554d19cc01..d7b65399e64 100644
NTSTATUS status;
char *unix_name;
struct stat st;
@@ -6273,12 +6279,13 @@ NTSTATUS FILE_RemoveSymlink(HANDLE handle, REPARSE_GUID_DATA_BUFFER *buffer)
@@ -6237,12 +6242,13 @@ NTSTATUS FILE_RemoveSymlink(HANDLE handle, REPARSE_GUID_DATA_BUFFER *buffer)
TRACE( "Deleting symlink %s\n", unix_name );
@ -108,7 +107,7 @@ index 1554d19cc01..d7b65399e64 100644
strcpy( tmpdir, unix_name );
d = dirname( tmpdir);
if (d != tmpdir) strcpy( tmpdir, d );
@@ -6291,11 +6298,21 @@ NTSTATUS FILE_RemoveSymlink(HANDLE handle, REPARSE_GUID_DATA_BUFFER *buffer)
@@ -6255,11 +6261,21 @@ NTSTATUS FILE_RemoveSymlink(HANDLE handle, REPARSE_GUID_DATA_BUFFER *buffer)
tempdir_created = TRUE;
strcpy( tmpfile, tmpdir );
strcat( tmpfile, "/tmpfile" );

View File

@ -1,4 +1,4 @@
From 7a18980361dcbf958d1f5b1c614758283bc1e1cc Mon Sep 17 00:00:00 2001
From ba365806d06a93493f1f91d6ca8ab3676a513136 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,15 +6,25 @@ Subject: [PATCH] ntdll: Allow creation of dangling reparse points to
Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
---
dlls/ntdll/unix/file.c | 15 ++++++++++++++-
dlls/ntdll/unix/file.c | 18 ++++++++++++++++--
include/winternl.h | 1 +
2 files changed, 15 insertions(+), 1 deletion(-)
2 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c
index d7b65399e64..d08f6813d28 100644
index 0655371dc66..a9fcf6cc444 100644
--- a/dlls/ntdll/unix/file.c
+++ b/dlls/ntdll/unix/file.c
@@ -3432,6 +3432,19 @@ static NTSTATUS lookup_unix_name( const WCHAR *name, int name_len, char **buffer
@@ -3378,7 +3378,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
+ || (disposition == FILE_WINE_PATH && status == STATUS_OBJECT_NAME_NOT_FOUND))
{
status = STATUS_OBJECT_NAME_NOT_FOUND;
if (disposition != FILE_OPEN && disposition != FILE_OVERWRITE)
@@ -3398,6 +3399,19 @@ static NTSTATUS lookup_unix_name( const WCHAR *name, int name_len, char **buffer
status = STATUS_OBJECT_NAME_COLLISION;
}
}
@ -34,7 +44,7 @@ index d7b65399e64..d08f6813d28 100644
if (status != STATUS_SUCCESS) break;
@@ -5987,7 +6000,7 @@ NTSTATUS FILE_CreateSymlink(HANDLE handle, REPARSE_DATA_BUFFER *buffer)
@@ -5953,7 +5967,7 @@ NTSTATUS FILE_CreateSymlink(HANDLE handle, REPARSE_DATA_BUFFER *buffer)
status = STATUS_NO_MEMORY;
goto cleanup;
}
@ -44,10 +54,10 @@ index d7b65399e64..d08f6813d28 100644
free( unix_dest );
}
diff --git a/include/winternl.h b/include/winternl.h
index f0ab223ef2e..b804436ee98 100644
index d35d509eb41..561a83bd648 100644
--- a/include/winternl.h
+++ b/include/winternl.h
@@ -2268,6 +2268,7 @@ typedef struct _RTL_ATOM_TABLE
@@ -2513,6 +2513,7 @@ typedef struct _RTL_ATOM_TABLE
#define FILE_OVERWRITE 4
#define FILE_OVERWRITE_IF 5
#define FILE_MAXIMUM_DISPOSITION 5

View File

@ -1,15 +1,15 @@
From e7429fc51d2bf337cccf3016e923ebea0326e2fd Mon Sep 17 00:00:00 2001
From 30353100c8647bd85bdf53fe95ccc039ca3ee867 Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
Date: Sat, 30 Mar 2019 12:00:51 -0600
Subject: [PATCH] ntdll: Correctly report file symbolic links as files.
Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
---
dlls/ntdll/unix/file.c | 113 +++++++++++++++++++++++++++--------------
1 file changed, 76 insertions(+), 37 deletions(-)
dlls/ntdll/unix/file.c | 115 +++++++++++++++++++++++++++--------------
1 file changed, 77 insertions(+), 38 deletions(-)
diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c
index d08f6813d28..a992c66504a 100644
index a9fcf6cc444..5d41919267e 100644
--- a/dlls/ntdll/unix/file.c
+++ b/dlls/ntdll/unix/file.c
@@ -1612,6 +1612,9 @@ static inline int get_file_xattr( char *hexattr, int attrlen )
@ -42,7 +42,7 @@ index d08f6813d28..a992c66504a 100644
}
else if (S_ISDIR( st->st_mode ) && (parent_path = malloc( strlen(path) + 4 )))
{
@@ -6106,46 +6114,34 @@ cleanup:
@@ -6070,46 +6078,35 @@ cleanup:
}
@ -93,6 +93,7 @@ index d08f6813d28..a992c66504a 100644
}
- unix_dest_len = ret;
+ len = ret;
+ tmp[len] = 0;
/* Decode the reparse tag from the symlink */
- p = unix_dest;
@ -104,7 +105,7 @@ index d08f6813d28..a992c66504a 100644
p++;
}
if (*p++ != '/')
@@ -6153,7 +6149,7 @@ NTSTATUS FILE_GetSymlink(HANDLE handle, REPARSE_DATA_BUFFER *buffer, ULONG out_s
@@ -6117,7 +6114,7 @@ NTSTATUS FILE_GetSymlink(HANDLE handle, REPARSE_DATA_BUFFER *buffer, ULONG out_s
status = STATUS_NOT_IMPLEMENTED;
goto cleanup;
}
@ -113,7 +114,7 @@ index d08f6813d28..a992c66504a 100644
for (i = 0; i < sizeof(ULONG)*8; i++)
{
char c = *p++;
@@ -6168,21 +6164,64 @@ NTSTATUS FILE_GetSymlink(HANDLE handle, REPARSE_DATA_BUFFER *buffer, ULONG out_s
@@ -6132,22 +6129,64 @@ NTSTATUS FILE_GetSymlink(HANDLE handle, REPARSE_DATA_BUFFER *buffer, ULONG out_s
status = STATUS_NOT_IMPLEMENTED;
goto cleanup;
}
@ -139,6 +140,7 @@ index d08f6813d28..a992c66504a 100644
}
- unix_dest_len -= (p - unix_dest);
- memmove(unix_dest, p, unix_dest_len);
- unix_dest[unix_dest_len] = 0;
+ else
+ dir_flag = TRUE;
+ len -= (p - tmp);
@ -180,9 +182,9 @@ index d08f6813d28..a992c66504a 100644
+
+ if ((status = FILE_DecodeSymlink( unix_src, unix_dest, &unix_dest_len, &buffer->ReparseTag, &flags, NULL )))
+ goto cleanup;
unix_dest[unix_dest_len] = 0;
/* convert the relative path into an absolute path */
if (flags == SYMLINK_FLAG_RELATIVE)
--
2.20.1

View File

@ -1,4 +1,4 @@
From 6d623ff7c29b1913b89681993a2dd63627312928 Mon Sep 17 00:00:00 2001
From 17a86aec0579d7632eaa718800d51cdda191a4b4 Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@wine-staging.com>
Date: Sun, 22 Nov 2020 22:35:50 -0700
Subject: [PATCH] kernelbase: Convert FILE_FLAG_OPEN_REPARSE_POINT for passing

View File

@ -1,4 +1,4 @@
From e95940380071fe812b54e5d92078d92993b8c21d Mon Sep 17 00:00:00 2001
From 663544d9d76dcd9d9338528a41a4e58343a8fc75 Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@wine-staging.com>
Date: Sat, 12 Dec 2020 16:54:28 -0700
Subject: [PATCH] server: Implement FILE_OPEN_REPARSE_POINT option.

View File

@ -1,4 +1,4 @@
From ecba21139cff9cf2ec15377252b7c7f4b8ee217e Mon Sep 17 00:00:00 2001
From 9303f780842e09a09c2e7d0a763cdd93f4289b8a Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@wine-staging.com>
Date: Sun, 22 Nov 2020 22:37:33 -0700
Subject: [PATCH] ntdll: Allow set_file_times_precise to work on reparse
@ -11,10 +11,10 @@ Subject: [PATCH] ntdll: Allow set_file_times_precise to work on reparse
3 files changed, 24 insertions(+), 9 deletions(-)
diff --git a/configure.ac b/configure.ac
index 26af8a0a4b7..ea5d767ab9a 100644
index 11f57d13274..eea5847c51f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2224,7 +2224,8 @@ AC_CHECK_FUNCS(\
@@ -2226,7 +2226,8 @@ AC_CHECK_FUNCS(\
sigprocmask \
symlink \
tcdrain \
@ -65,7 +65,7 @@ index 59f10ea8cce..8938c5bf50c 100644
CloseHandle(handle);
diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c
index a992c66504a..4355f1ac473 100644
index 5d41919267e..4fb5afc2755 100644
--- a/dlls/ntdll/unix/file.c
+++ b/dlls/ntdll/unix/file.c
@@ -1737,6 +1737,14 @@ static int get_file_info( const char *path, struct stat *st, ULONG *attr )

View File

@ -1,4 +1,4 @@
From a7d722fea77ebfea46c9ad70a8e452251c1b2ca6 Mon Sep 17 00:00:00 2001
From b17dd0d9dbfe6aff1654c1b8fe49019d5f97d139 Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
Date: Sat, 30 Mar 2019 13:41:07 -0600
Subject: [PATCH] server: Properly handle file symlink deletion.

View File

@ -1,4 +1,4 @@
From cd8b189a3be04bcda04481f790be20d624eaaf02 Mon Sep 17 00:00:00 2001
From 879b893a5429ba4aa0ced3fdefd284dcca0b0a7d Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@wine-staging.com>
Date: Sat, 12 Dec 2020 17:40:27 -0700
Subject: [PATCH] server: Properly handle deleting dangling symlinks.

View File

@ -1,4 +1,4 @@
From b43f01caa40215a41a135995adaebbde2bc619a1 Mon Sep 17 00:00:00 2001
From b5c33b762b57ac73bc374e8aea6199730524ea59 Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@wine-staging.com>
Date: Sat, 12 Dec 2020 17:35:21 -0700
Subject: [PATCH] kernelbase: Use FILE_OPEN_REPARSE_POINT in

Some files were not shown because too many files have changed in this diff Show More