ntdll-Junction_Points: Updates from Erich E. Hoover.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50770
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51438
This commit is contained in:
Zebediah Figura 2021-07-30 18:44:02 -05:00
parent f7c80250ec
commit c91c63a5da
40 changed files with 281 additions and 271 deletions

View File

@ -1,4 +1,4 @@
From 1370cc026e08ebc0f9eb0314b86cc38220c22041 Mon Sep 17 00:00:00 2001
From deebd97b531b74f34fd30ab5ef699812c5be1fe1 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 596809f9f6a..e9a7c2d6088 100644
index 24bcc7448d2..f80fbd737ef 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2209,6 +2209,8 @@ AC_CHECK_FUNCS(\
@@ -2215,6 +2215,8 @@ AC_CHECK_FUNCS(\
proc_pidinfo \
pwrite \
readlink \
@ -152,7 +152,7 @@ index 46037546e6e..7a01e947e13 100644
test_mailslot_name();
}
diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c
index 94140d1cfbc..3699934caf8 100644
index 4e18e229b1a..f6c23f629b8 100644
--- a/dlls/ntdll/unix/file.c
+++ b/dlls/ntdll/unix/file.c
@@ -36,6 +36,7 @@
@ -215,7 +215,7 @@ index 94140d1cfbc..3699934caf8 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 )
{
@@ -5931,6 +5963,116 @@ static void ignore_server_ioctl_struct_holes( ULONG code, const void *in_buffer,
@@ -5942,6 +5974,116 @@ static void ignore_server_ioctl_struct_holes( ULONG code, const void *in_buffer,
}
@ -332,7 +332,7 @@ index 94140d1cfbc..3699934caf8 100644
/******************************************************************************
* NtFsControlFile (NTDLL.@)
*/
@@ -6013,6 +6155,23 @@ NTSTATUS WINAPI NtFsControlFile( HANDLE handle, HANDLE event, PIO_APC_ROUTINE ap
@@ -6024,6 +6166,23 @@ NTSTATUS WINAPI NtFsControlFile( HANDLE handle, HANDLE event, PIO_APC_ROUTINE ap
break;
}
@ -357,10 +357,10 @@ index 94140d1cfbc..3699934caf8 100644
TRACE("FSCTL_SET_SPARSE: Ignoring request\n");
io->Information = 0;
diff --git a/include/Makefile.in b/include/Makefile.in
index 61a74a210c9..e4a3a83ecc8 100644
index 9b397ffa183..ee440a07a94 100644
--- a/include/Makefile.in
+++ b/include/Makefile.in
@@ -541,6 +541,7 @@ SOURCES = \
@@ -543,6 +543,7 @@ SOURCES = \
ntdef.h \
ntdsapi.h \
ntgdi.h \

View File

@ -1,4 +1,4 @@
From 49ed938003d970383e684d7db56bf570d0d94b2a Mon Sep 17 00:00:00 2001
From cfcae7fcb7243890a6b5c7f3397313ca894b19be 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.
@ -10,10 +10,10 @@ Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
2 files changed, 144 insertions(+), 1 deletion(-)
diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c
index 54e06a3f126..a3f3485ce46 100644
index 7a01e947e13..3b7746650f3 100644
--- a/dlls/ntdll/tests/file.c
+++ b/dlls/ntdll/tests/file.c
@@ -5265,14 +5265,15 @@ static void test_reparse_points(void)
@@ -5354,14 +5354,15 @@ static void test_reparse_points(void)
static const WCHAR reparseW[] = {'\\','r','e','p','a','r','s','e',0};
WCHAR path[MAX_PATH], reparse_path[MAX_PATH], target_path[MAX_PATH];
static const WCHAR targetW[] = {'\\','t','a','r','g','e','t',0};
@ -30,7 +30,7 @@ index 54e06a3f126..a3f3485ce46 100644
BOOL bret;
/* Create a temporary folder for the junction point tests */
@@ -5320,6 +5321,23 @@ static void test_reparse_points(void)
@@ -5409,6 +5410,23 @@ static void test_reparse_points(void)
buffer_len = build_reparse_buffer(nameW.Buffer, &buffer);
bret = DeviceIoControl(handle, FSCTL_SET_REPARSE_POINT, (LPVOID)buffer, buffer_len, NULL, 0, &dwret, 0);
ok(bret, "Failed to create junction point! (0x%x)\n", GetLastError());
@ -55,10 +55,10 @@ index 54e06a3f126..a3f3485ce46 100644
cleanup:
diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c
index 492838d9031..5289c0eec71 100644
index f6c23f629b8..c6c4df8dba3 100644
--- a/dlls/ntdll/unix/file.c
+++ b/dlls/ntdll/unix/file.c
@@ -6092,6 +6092,125 @@ cleanup:
@@ -6084,6 +6084,125 @@ cleanup:
}
@ -184,7 +184,7 @@ index 492838d9031..5289c0eec71 100644
/******************************************************************************
* NtFsControlFile (NTDLL.@)
*/
@@ -6174,6 +6293,12 @@ NTSTATUS WINAPI NtFsControlFile( HANDLE handle, HANDLE event, PIO_APC_ROUTINE ap
@@ -6166,6 +6285,12 @@ NTSTATUS WINAPI NtFsControlFile( HANDLE handle, HANDLE event, PIO_APC_ROUTINE ap
break;
}

View File

@ -1,4 +1,4 @@
From cc1a2a1ade9c176a7c77a5673c26cee6ab85963c Mon Sep 17 00:00:00 2001
From 882f91cd59e014e985c58fc36f6dc2b2a5679bf8 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.
@ -11,10 +11,10 @@ Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
3 files changed, 131 insertions(+), 1 deletion(-)
diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c
index a3f3485ce46..b844fe9e1d3 100644
index 3b7746650f3..0031f49693c 100644
--- a/dlls/ntdll/tests/file.c
+++ b/dlls/ntdll/tests/file.c
@@ -5266,11 +5266,14 @@ static void test_reparse_points(void)
@@ -5355,11 +5355,14 @@ static void test_reparse_points(void)
WCHAR path[MAX_PATH], reparse_path[MAX_PATH], target_path[MAX_PATH];
static const WCHAR targetW[] = {'\\','t','a','r','g','e','t',0};
INT buffer_len, string_len, path_len, total_len;
@ -29,7 +29,7 @@ index a3f3485ce46..b844fe9e1d3 100644
UNICODE_STRING nameW;
HANDLE handle;
WCHAR *dest;
@@ -5318,6 +5321,8 @@ static void test_reparse_points(void)
@@ -5407,6 +5410,8 @@ static void test_reparse_points(void)
win_skip("Failed to open junction point directory handle (0x%x).\n", GetLastError());
goto cleanup;
}
@ -38,7 +38,7 @@ index a3f3485ce46..b844fe9e1d3 100644
buffer_len = build_reparse_buffer(nameW.Buffer, &buffer);
bret = DeviceIoControl(handle, FSCTL_SET_REPARSE_POINT, (LPVOID)buffer, buffer_len, NULL, 0, &dwret, 0);
ok(bret, "Failed to create junction point! (0x%x)\n", GetLastError());
@@ -5338,6 +5343,22 @@ static void test_reparse_points(void)
@@ -5427,6 +5432,22 @@ static void test_reparse_points(void)
- FIELD_OFFSET(typeof(*buffer), GenericReparseBuffer);
ok(buffer->ReparseDataLength == total_len, "ReparseDataLength has unexpected value (%d != %d)\n",
buffer->ReparseDataLength, total_len);
@ -61,7 +61,7 @@ index a3f3485ce46..b844fe9e1d3 100644
CloseHandle(handle);
cleanup:
@@ -5345,7 +5366,7 @@ cleanup:
@@ -5434,7 +5455,7 @@ cleanup:
pRtlFreeUnicodeString(&nameW);
HeapFree(GetProcessHeap(), 0, buffer);
bret = RemoveDirectoryW(reparse_path);
@ -71,10 +71,10 @@ index a3f3485ce46..b844fe9e1d3 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 5289c0eec71..118f81db3c1 100644
index c6c4df8dba3..c6cdf54a061 100644
--- a/dlls/ntdll/unix/file.c
+++ b/dlls/ntdll/unix/file.c
@@ -6211,6 +6211,87 @@ cleanup:
@@ -6203,6 +6203,87 @@ cleanup:
}
@ -162,7 +162,7 @@ index 5289c0eec71..118f81db3c1 100644
/******************************************************************************
* NtFsControlFile (NTDLL.@)
*/
@@ -6293,6 +6374,22 @@ NTSTATUS WINAPI NtFsControlFile( HANDLE handle, HANDLE event, PIO_APC_ROUTINE ap
@@ -6285,6 +6366,22 @@ NTSTATUS WINAPI NtFsControlFile( HANDLE handle, HANDLE event, PIO_APC_ROUTINE ap
break;
}

View File

@ -1,4 +1,4 @@
From 2b0a539941dcd1a292cda3f506abb6359f409527 Mon Sep 17 00:00:00 2001
From 233e652467335f4d618de1a68d7f39ac0c9bbcfd 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.
@ -9,10 +9,10 @@ Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
1 file changed, 5 insertions(+)
diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c
index b844fe9e1d3..504d67adde6 100644
index 0031f49693c..521857575d8 100644
--- a/dlls/ntdll/tests/file.c
+++ b/dlls/ntdll/tests/file.c
@@ -5327,6 +5327,11 @@ static void test_reparse_points(void)
@@ -5416,6 +5416,11 @@ static void test_reparse_points(void)
bret = DeviceIoControl(handle, FSCTL_SET_REPARSE_POINT, (LPVOID)buffer, buffer_len, NULL, 0, &dwret, 0);
ok(bret, "Failed to create junction point! (0x%x)\n", GetLastError());

View File

@ -1,4 +1,4 @@
From d5a062699b1a599fc87ba757e65b3aeb2ead9834 Mon Sep 17 00:00:00 2001
From 65dd6d4aa01884b7119cca1defe31b23c248f719 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
@ -7,14 +7,14 @@ Subject: [PATCH] server: Add support for deleting junction points with
Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
---
dlls/ntdll/tests/file.c | 34 +++++++++++++++++++++++++++++++++-
server/fd.c | 36 +++++++++++++++++++++++++++---------
2 files changed, 60 insertions(+), 10 deletions(-)
server/fd.c | 37 ++++++++++++++++++++++++++++---------
2 files changed, 61 insertions(+), 10 deletions(-)
diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c
index 504d67adde6..2ddabc865bf 100644
index 521857575d8..c5b3b83802e 100644
--- a/dlls/ntdll/tests/file.c
+++ b/dlls/ntdll/tests/file.c
@@ -5272,7 +5272,7 @@ static void test_reparse_points(void)
@@ -5361,7 +5361,7 @@ static void test_reparse_points(void)
REPARSE_GUID_DATA_BUFFER guid_buffer;
static const WCHAR dotW[] = {'.',0};
REPARSE_DATA_BUFFER *buffer = NULL;
@ -23,7 +23,7 @@ index 504d67adde6..2ddabc865bf 100644
IO_STATUS_BLOCK iosb;
UNICODE_STRING nameW;
HANDLE handle;
@@ -5366,6 +5366,38 @@ static void test_reparse_points(void)
@@ -5455,6 +5455,38 @@ static void test_reparse_points(void)
"Junction point folder's access time does not match.\n");
CloseHandle(handle);
@ -63,7 +63,7 @@ index 504d67adde6..2ddabc865bf 100644
/* Cleanup */
pRtlFreeUnicodeString(&nameW);
diff --git a/server/fd.c b/server/fd.c
index 481e9a88f0f..2605adf96ff 100644
index b953da2ab85..2adadceae25 100644
--- a/server/fd.c
+++ b/server/fd.c
@@ -169,7 +169,8 @@ struct closed_fd
@ -84,7 +84,7 @@ index 481e9a88f0f..2605adf96ff 100644
char *unix_name; /* unix file name */
WCHAR *nt_name; /* NT file name */
data_size_t nt_namelen; /* length of NT file name */
@@ -1121,6 +1123,7 @@ static void inode_close_pending( struct inode *inode, int keep_unlinks )
@@ -1118,6 +1120,7 @@ static void inode_close_pending( struct inode *inode, int keep_unlinks )
if (!keep_unlinks || !fd->unlink) /* get rid of it unless there's an unlink pending on that file */
{
list_remove( ptr );
@ -92,7 +92,7 @@ index 481e9a88f0f..2605adf96ff 100644
free( fd->unix_name );
free( fd );
}
@@ -1155,12 +1158,13 @@ static void inode_destroy( struct object *obj )
@@ -1152,12 +1155,13 @@ static void inode_destroy( struct object *obj )
{
/* make sure it is still the same file */
struct stat st;
@ -109,7 +109,7 @@ index 481e9a88f0f..2605adf96ff 100644
free( fd->unix_name );
free( fd );
}
@@ -1581,6 +1585,7 @@ static void fd_destroy( struct object *obj )
@@ -1578,6 +1582,7 @@ static void fd_destroy( struct object *obj )
else /* no inode, close it right away */
{
if (fd->unix_fd != -1) close( fd->unix_fd );
@ -117,7 +117,7 @@ index 481e9a88f0f..2605adf96ff 100644
free( fd->unix_name );
}
}
@@ -1690,6 +1695,7 @@ static struct fd *alloc_fd_object(void)
@@ -1687,6 +1692,7 @@ static struct fd *alloc_fd_object(void)
fd->options = 0;
fd->sharing = 0;
fd->unix_fd = -1;
@ -125,7 +125,7 @@ index 481e9a88f0f..2605adf96ff 100644
fd->unix_name = NULL;
fd->nt_name = NULL;
fd->nt_namelen = 0;
@@ -1727,6 +1733,7 @@ struct fd *alloc_pseudo_fd( const struct fd_ops *fd_user_ops, struct object *use
@@ -1724,6 +1730,7 @@ struct fd *alloc_pseudo_fd( const struct fd_ops *fd_user_ops, struct object *use
fd->access = 0;
fd->options = options;
fd->sharing = 0;
@ -133,7 +133,7 @@ index 481e9a88f0f..2605adf96ff 100644
fd->unix_name = NULL;
fd->nt_name = NULL;
fd->nt_namelen = 0;
@@ -1768,6 +1775,12 @@ struct fd *dup_fd_object( struct fd *orig, unsigned int access, unsigned int sha
@@ -1765,6 +1772,12 @@ struct fd *dup_fd_object( struct fd *orig, unsigned int access, unsigned int sha
fd->nt_namelen = orig->nt_namelen;
}
@ -146,7 +146,7 @@ index 481e9a88f0f..2605adf96ff 100644
if (orig->inode)
{
struct closed_fd *closed = mem_alloc( sizeof(*closed) );
@@ -1780,6 +1793,7 @@ struct fd *dup_fd_object( struct fd *orig, unsigned int access, unsigned int sha
@@ -1777,6 +1790,7 @@ struct fd *dup_fd_object( struct fd *orig, unsigned int access, unsigned int sha
}
closed->unix_fd = fd->unix_fd;
closed->unlink = 0;
@ -154,7 +154,7 @@ index 481e9a88f0f..2605adf96ff 100644
closed->unix_name = fd->unix_name;
fd->closed = closed;
fd->inode = (struct inode *)grab_object( orig->inode );
@@ -1964,18 +1978,19 @@ struct fd *open_fd( struct fd *root, const char *name, struct unicode_str nt_nam
@@ -1961,18 +1975,19 @@ struct fd *open_fd( struct fd *root, const char *name, struct unicode_str nt_nam
fd->unix_name = NULL;
if ((path = dup_fd_name( root, name )))
{
@ -177,7 +177,7 @@ index 481e9a88f0f..2605adf96ff 100644
{
unsigned int err;
struct inode *inode = get_inode( st.st_dev, st.st_ino, fd->unix_fd );
@@ -1993,6 +2008,9 @@ struct fd *open_fd( struct fd *root, const char *name, struct unicode_str nt_nam
@@ -1990,6 +2005,9 @@ struct fd *open_fd( struct fd *root, const char *name, struct unicode_str nt_nam
list_add_head( &inode->open, &fd->inode_entry );
closed_fd = NULL;
@ -187,12 +187,13 @@ index 481e9a88f0f..2605adf96ff 100644
/* check directory options */
if ((options & FILE_DIRECTORY_FILE) && !S_ISDIR(st.st_mode))
{
@@ -2605,10 +2623,10 @@ static void set_fd_name( struct fd *fd, struct fd *root, const char *nameptr, da
@@ -2619,10 +2637,11 @@ static void set_fd_name( struct fd *fd, struct fd *root, const char *nameptr, da
free( fd->nt_name );
fd->nt_name = dup_nt_name( root, nt_name, &fd->nt_namelen );
+ free( fd->unlink_name );
free( fd->unix_name );
+ fd->closed->unlink_name = fd->unlink_name = name;
fd->closed->unix_name = fd->unix_name = realpath( name, NULL );
- free( name );
- if (!fd->unix_name)

View File

@ -1,4 +1,4 @@
From 58c9e69484d7c8da358e61de61827ec1d8399bbd Mon Sep 17 00:00:00 2001
From 0066234ca48eee5b847de57d552966b8fbb14f95 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.
@ -114,10 +114,10 @@ index 04e8fe3c0f5..c8e7d6bf088 100644
info->FileSystemNameLength = min( sizeof(ntfsW), length - offsetof( FILE_FS_ATTRIBUTE_INFORMATION, FileSystemName ) );
memcpy(info->FileSystemName, ntfsW, info->FileSystemNameLength);
diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c
index 2ddabc865bf..699d5e67d88 100644
index c5b3b83802e..084398ba83d 100644
--- a/dlls/ntdll/tests/file.c
+++ b/dlls/ntdll/tests/file.c
@@ -5262,8 +5262,8 @@ static INT build_reparse_buffer(const WCHAR *filename, REPARSE_DATA_BUFFER **pbu
@@ -5351,8 +5351,8 @@ static INT build_reparse_buffer(const WCHAR *filename, REPARSE_DATA_BUFFER **pbu
static void test_reparse_points(void)
{
@ -127,7 +127,7 @@ index 2ddabc865bf..699d5e67d88 100644
static const WCHAR targetW[] = {'\\','t','a','r','g','e','t',0};
INT buffer_len, string_len, path_len, total_len;
FILE_BASIC_INFORMATION old_attrib, new_attrib;
@@ -5292,7 +5292,12 @@ static void test_reparse_points(void)
@@ -5381,7 +5381,12 @@ static void test_reparse_points(void)
pRtlDosPathNameToNtPathName_U(path, &nameW, NULL, NULL);
volW[0] = nameW.Buffer[4];
pRtlFreeUnicodeString( &nameW );

View File

@ -1,4 +1,4 @@
From fb7afe57f143a7777f54c1e936d60af5ace51865 Mon Sep 17 00:00:00 2001
From 4f24462df45c573934d5507fd5ec0a3cbe8c7bdd 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.
@ -11,10 +11,10 @@ Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
3 files changed, 146 insertions(+), 30 deletions(-)
diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c
index 699d5e67d88..e0fa36ea64f 100644
index 084398ba83d..81cc2ab5dab 100644
--- a/dlls/ntdll/tests/file.c
+++ b/dlls/ntdll/tests/file.c
@@ -5234,26 +5234,50 @@ static void test_mailslot_name(void)
@@ -5323,26 +5323,50 @@ static void test_mailslot_name(void)
CloseHandle( device );
}
@ -73,7 +73,7 @@ index 699d5e67d88..e0fa36ea64f 100644
lstrcpyW(subst_dest, filename);
lstrcpyW(print_dest, &filename[prefix_len]);
*pbuffer = buffer;
@@ -5273,10 +5297,12 @@ static void test_reparse_points(void)
@@ -5362,10 +5386,12 @@ static void test_reparse_points(void)
static const WCHAR dotW[] = {'.',0};
REPARSE_DATA_BUFFER *buffer = NULL;
DWORD dwret, dwLen, dwFlags, err;
@ -87,7 +87,7 @@ index 699d5e67d88..e0fa36ea64f 100644
BOOL bret;
/* Create a temporary folder for the junction point tests */
@@ -5328,7 +5354,7 @@ static void test_reparse_points(void)
@@ -5417,7 +5443,7 @@ static void test_reparse_points(void)
}
dwret = NtQueryInformationFile(handle, &iosb, &old_attrib, sizeof(old_attrib), FileBasicInformation);
ok(dwret == STATUS_SUCCESS, "Failed to get junction point folder's attributes (0x%x).\n", dwret);
@ -96,7 +96,7 @@ index 699d5e67d88..e0fa36ea64f 100644
bret = DeviceIoControl(handle, FSCTL_SET_REPARSE_POINT, (LPVOID)buffer, buffer_len, NULL, 0, &dwret, 0);
ok(bret, "Failed to create junction point! (0x%x)\n", GetLastError());
@@ -5375,7 +5401,7 @@ static void test_reparse_points(void)
@@ -5464,7 +5490,7 @@ static void test_reparse_points(void)
HeapFree(GetProcessHeap(), 0, buffer);
handle = CreateFileW(reparse_path, GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING,
FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_OPEN_REPARSE_POINT, 0);
@ -105,7 +105,7 @@ index 699d5e67d88..e0fa36ea64f 100644
bret = DeviceIoControl(handle, FSCTL_SET_REPARSE_POINT, (LPVOID)buffer, buffer_len, NULL, 0, &dwret, 0);
ok(bret, "Failed to create junction point! (0x%x)\n", GetLastError());
CloseHandle(handle);
@@ -5390,7 +5416,7 @@ static void test_reparse_points(void)
@@ -5479,7 +5505,7 @@ static void test_reparse_points(void)
ok(bret, "Failed to create junction point target directory.\n");
handle = CreateFileW(reparse_path, GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING,
FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_OPEN_REPARSE_POINT, 0);
@ -114,7 +114,7 @@ index 699d5e67d88..e0fa36ea64f 100644
bret = DeviceIoControl(handle, FSCTL_SET_REPARSE_POINT, (LPVOID)buffer, buffer_len, NULL, 0, &dwret, 0);
ok(bret, "Failed to create junction point! (0x%x)\n", GetLastError());
CloseHandle(handle);
@@ -5403,14 +5429,73 @@ static void test_reparse_points(void)
@@ -5492,14 +5518,73 @@ static void test_reparse_points(void)
ok(dwret != (DWORD)~0, "Junction point doesn't exist (attributes: 0x%x)!\n", dwret);
ok(dwret & FILE_ATTRIBUTE_REPARSE_POINT, "File is not a junction point! (attributes: 0x%x)\n", dwret);
@ -193,10 +193,10 @@ index 699d5e67d88..e0fa36ea64f 100644
}
diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c
index 118f81db3c1..da5136db68c 100644
index c6cdf54a061..d9e0388af2d 100644
--- a/dlls/ntdll/unix/file.c
+++ b/dlls/ntdll/unix/file.c
@@ -5989,18 +5989,35 @@ static void ignore_server_ioctl_struct_holes( ULONG code, const void *in_buffer,
@@ -5981,18 +5981,35 @@ static void ignore_server_ioctl_struct_holes( ULONG code, const void *in_buffer,
NTSTATUS create_reparse_point(HANDLE handle, REPARSE_DATA_BUFFER *buffer)
{
BOOL src_allocated = FALSE, dest_allocated = FALSE, tempdir_created = FALSE;
@ -235,7 +235,7 @@ index 118f81db3c1..da5136db68c 100644
if ((status = server_get_unix_fd( handle, FILE_SPECIAL_ACCESS, &dest_fd, &needs_close, NULL, NULL )))
return status;
@@ -6035,6 +6052,20 @@ NTSTATUS create_reparse_point(HANDLE handle, REPARSE_DATA_BUFFER *buffer)
@@ -6027,6 +6044,20 @@ NTSTATUS create_reparse_point(HANDLE handle, REPARSE_DATA_BUFFER *buffer)
strcat( magic_dest, "." );
strcat( magic_dest, "/" );
}
@ -256,7 +256,7 @@ index 118f81db3c1..da5136db68c 100644
strcat( magic_dest, unix_dest );
/* Produce the link in a temporary location in the same folder */
@@ -6399,17 +6430,7 @@ NTSTATUS WINAPI NtFsControlFile( HANDLE handle, HANDLE event, PIO_APC_ROUTINE ap
@@ -6391,17 +6422,7 @@ NTSTATUS WINAPI NtFsControlFile( HANDLE handle, HANDLE event, PIO_APC_ROUTINE ap
case FSCTL_SET_REPARSE_POINT:
{
REPARSE_DATA_BUFFER *buffer = (REPARSE_DATA_BUFFER *)in_buffer;

View File

@ -1,4 +1,4 @@
From 5859da2b48592d1a13f471a6932a2529aa1e0395 Mon Sep 17 00:00:00 2001
From febfe0aa6ee03bdcd4be96998f623648fe30e4e2 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.
@ -10,10 +10,10 @@ Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
2 files changed, 44 insertions(+), 1 deletion(-)
diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c
index e0fa36ea64f..cfc0d176b53 100644
index 81cc2ab5dab..bf9d9677412 100644
--- a/dlls/ntdll/tests/file.c
+++ b/dlls/ntdll/tests/file.c
@@ -5480,7 +5480,6 @@ static void test_reparse_points(void)
@@ -5569,7 +5569,6 @@ static void test_reparse_points(void)
ok(dwret == STATUS_SUCCESS, "Failed to get symlink folder's attributes (0x%x).\n", dwret);
buffer_len = build_reparse_buffer(nameW.Buffer, IO_REPARSE_TAG_SYMLINK, &buffer);
bret = DeviceIoControl(handle, FSCTL_SET_REPARSE_POINT, (LPVOID)buffer, buffer_len, NULL, 0, &dwret, 0);
@ -21,7 +21,7 @@ index e0fa36ea64f..cfc0d176b53 100644
ok(bret, "Failed to create symlink! (0x%x)\n", GetLastError());
/* Check the file attributes of the symlink */
@@ -5488,6 +5487,24 @@ static void test_reparse_points(void)
@@ -5577,6 +5576,24 @@ static void test_reparse_points(void)
ok(dwret != (DWORD)~0, "Symlink doesn't exist (attributes: 0x%x)!\n", dwret);
ok(dwret & FILE_ATTRIBUTE_REPARSE_POINT, "File is not a symlink! (attributes: %d)\n", dwret);
@ -47,10 +47,10 @@ index e0fa36ea64f..cfc0d176b53 100644
/* Cleanup */
pRtlFreeUnicodeString(&nameW);
diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c
index da5136db68c..668f4fe2c80 100644
index d9e0388af2d..24871ee8a32 100644
--- a/dlls/ntdll/unix/file.c
+++ b/dlls/ntdll/unix/file.c
@@ -6138,6 +6138,7 @@ NTSTATUS get_reparse_point(HANDLE handle, REPARSE_DATA_BUFFER *buffer, ULONG out
@@ -6130,6 +6130,7 @@ NTSTATUS get_reparse_point(HANDLE handle, REPARSE_DATA_BUFFER *buffer, ULONG out
int unix_dest_len;
DWORD max_length;
NTSTATUS status;
@ -58,7 +58,7 @@ index da5136db68c..668f4fe2c80 100644
WCHAR *nt_dest;
ssize_t ret;
char *p;
@@ -6181,6 +6182,17 @@ NTSTATUS get_reparse_point(HANDLE handle, REPARSE_DATA_BUFFER *buffer, ULONG out
@@ -6173,6 +6174,17 @@ NTSTATUS get_reparse_point(HANDLE handle, REPARSE_DATA_BUFFER *buffer, ULONG out
}
buffer->ReparseTag |= (val << i);
}
@ -76,7 +76,7 @@ index da5136db68c..668f4fe2c80 100644
unix_dest_len -= (p - unix_dest);
memmove(unix_dest, p, unix_dest_len);
unix_dest[unix_dest_len] = 0;
@@ -6218,6 +6230,20 @@ NTSTATUS get_reparse_point(HANDLE handle, REPARSE_DATA_BUFFER *buffer, ULONG out
@@ -6210,6 +6222,20 @@ NTSTATUS get_reparse_point(HANDLE handle, REPARSE_DATA_BUFFER *buffer, ULONG out
path_len += (nt_dest_len - prefix_len*sizeof(WCHAR)) + sizeof(WCHAR);
total_len = FIELD_OFFSET(typeof(*buffer), MountPointReparseBuffer.PathBuffer[path_len/sizeof(WCHAR)]);
break;

View File

@ -1,4 +1,4 @@
From 1cd53753c747d30cb1acee7f93264747a58c338b Mon Sep 17 00:00:00 2001
From 68b56e8cfc85063df0c7bf93bf32002d4a264858 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.
@ -10,10 +10,10 @@ Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
2 files changed, 17 insertions(+)
diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c
index cfc0d176b53..1fe5fea47d5 100644
index bf9d9677412..3a6396e5afc 100644
--- a/dlls/ntdll/tests/file.c
+++ b/dlls/ntdll/tests/file.c
@@ -5503,6 +5503,22 @@ static void test_reparse_points(void)
@@ -5592,6 +5592,22 @@ static void test_reparse_points(void)
- FIELD_OFFSET(typeof(*buffer), GenericReparseBuffer);
ok(buffer->ReparseDataLength == total_len, "ReparseDataLength has unexpected value (%d != %d)\n",
buffer->ReparseDataLength, total_len);
@ -37,10 +37,10 @@ index cfc0d176b53..1fe5fea47d5 100644
cleanup:
diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c
index 668f4fe2c80..bddf55faad8 100644
index 24871ee8a32..2ff931aa57c 100644
--- a/dlls/ntdll/unix/file.c
+++ b/dlls/ntdll/unix/file.c
@@ -6438,6 +6438,7 @@ NTSTATUS WINAPI NtFsControlFile( HANDLE handle, HANDLE event, PIO_APC_ROUTINE ap
@@ -6430,6 +6430,7 @@ NTSTATUS WINAPI NtFsControlFile( HANDLE handle, HANDLE event, PIO_APC_ROUTINE ap
switch(buffer->ReparseTag)
{
case IO_REPARSE_TAG_MOUNT_POINT:

View File

@ -1,20 +1,21 @@
From a56456fcccb14d889925b8f82c2f4c8506143b0a Mon Sep 17 00:00:00 2001
From 61a601cef64c692cd846b01478a3462c382afa04 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.
Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
---
dlls/ntdll/tests/file.c | 30 +++++++++++---
dlls/ntdll/unix/file.c | 92 +++++++++++++++++++++++++++++++++++++----
dlls/ntdll/tests/file.c | 30 ++++++++++---
dlls/ntdll/unix/file.c | 94 +++++++++++++++++++++++++++++++++++++----
include/ntifs.h | 2 +
3 files changed, 111 insertions(+), 13 deletions(-)
include/winternl.h | 1 +
4 files changed, 113 insertions(+), 14 deletions(-)
diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c
index 1fe5fea47d5..367eef539ce 100644
index 3a6396e5afc..1ace7f76c1f 100644
--- a/dlls/ntdll/tests/file.c
+++ b/dlls/ntdll/tests/file.c
@@ -5234,7 +5234,8 @@ static void test_mailslot_name(void)
@@ -5323,7 +5323,8 @@ static void test_mailslot_name(void)
CloseHandle( device );
}
@ -24,7 +25,7 @@ index 1fe5fea47d5..367eef539ce 100644
{
static INT header_size = offsetof(REPARSE_DATA_BUFFER, GenericReparseBuffer);
INT buffer_size, struct_size, data_size, string_len, prefix_len;
@@ -5252,7 +5253,7 @@ static INT build_reparse_buffer(const WCHAR *filename, ULONG tag, REPARSE_DATA_B
@@ -5341,7 +5342,7 @@ static INT build_reparse_buffer(const WCHAR *filename, ULONG tag, REPARSE_DATA_B
default:
return 0;
}
@ -33,7 +34,7 @@ index 1fe5fea47d5..367eef539ce 100644
string_len = lstrlenW(&filename[prefix_len]);
data_size = (prefix_len + 2 * string_len + 2) * sizeof(WCHAR);
buffer_size = struct_size + data_size;
@@ -5272,6 +5273,7 @@ static INT build_reparse_buffer(const WCHAR *filename, ULONG tag, REPARSE_DATA_B
@@ -5361,6 +5362,7 @@ static INT build_reparse_buffer(const WCHAR *filename, ULONG tag, REPARSE_DATA_B
buffer->SymbolicLinkReparseBuffer.SubstituteNameLength = (prefix_len + string_len) * sizeof(WCHAR);
buffer->SymbolicLinkReparseBuffer.PrintNameOffset = (prefix_len + string_len + 1) * sizeof(WCHAR);
buffer->SymbolicLinkReparseBuffer.PrintNameLength = string_len * sizeof(WCHAR);
@ -41,7 +42,7 @@ index 1fe5fea47d5..367eef539ce 100644
subst_dest = &buffer->SymbolicLinkReparseBuffer.PathBuffer[0];
print_dest = &buffer->SymbolicLinkReparseBuffer.PathBuffer[prefix_len + string_len + 1];
break;
@@ -5354,7 +5356,7 @@ static void test_reparse_points(void)
@@ -5443,7 +5445,7 @@ static void test_reparse_points(void)
}
dwret = NtQueryInformationFile(handle, &iosb, &old_attrib, sizeof(old_attrib), FileBasicInformation);
ok(dwret == STATUS_SUCCESS, "Failed to get junction point folder's attributes (0x%x).\n", dwret);
@ -50,7 +51,7 @@ index 1fe5fea47d5..367eef539ce 100644
bret = DeviceIoControl(handle, FSCTL_SET_REPARSE_POINT, (LPVOID)buffer, buffer_len, NULL, 0, &dwret, 0);
ok(bret, "Failed to create junction point! (0x%x)\n", GetLastError());
@@ -5401,7 +5403,7 @@ static void test_reparse_points(void)
@@ -5490,7 +5492,7 @@ static void test_reparse_points(void)
HeapFree(GetProcessHeap(), 0, buffer);
handle = CreateFileW(reparse_path, GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING,
FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_OPEN_REPARSE_POINT, 0);
@ -59,7 +60,7 @@ index 1fe5fea47d5..367eef539ce 100644
bret = DeviceIoControl(handle, FSCTL_SET_REPARSE_POINT, (LPVOID)buffer, buffer_len, NULL, 0, &dwret, 0);
ok(bret, "Failed to create junction point! (0x%x)\n", GetLastError());
CloseHandle(handle);
@@ -5416,7 +5418,7 @@ static void test_reparse_points(void)
@@ -5505,7 +5507,7 @@ static void test_reparse_points(void)
ok(bret, "Failed to create junction point target directory.\n");
handle = CreateFileW(reparse_path, GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING,
FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_OPEN_REPARSE_POINT, 0);
@ -68,7 +69,7 @@ index 1fe5fea47d5..367eef539ce 100644
bret = DeviceIoControl(handle, FSCTL_SET_REPARSE_POINT, (LPVOID)buffer, buffer_len, NULL, 0, &dwret, 0);
ok(bret, "Failed to create junction point! (0x%x)\n", GetLastError());
CloseHandle(handle);
@@ -5478,7 +5480,7 @@ static void test_reparse_points(void)
@@ -5567,7 +5569,7 @@ static void test_reparse_points(void)
}
dwret = NtQueryInformationFile(handle, &iosb, &old_attrib, sizeof(old_attrib), FileBasicInformation);
ok(dwret == STATUS_SUCCESS, "Failed to get symlink folder's attributes (0x%x).\n", dwret);
@ -77,7 +78,7 @@ index 1fe5fea47d5..367eef539ce 100644
bret = DeviceIoControl(handle, FSCTL_SET_REPARSE_POINT, (LPVOID)buffer, buffer_len, NULL, 0, &dwret, 0);
ok(bret, "Failed to create symlink! (0x%x)\n", GetLastError());
@@ -5521,6 +5523,22 @@ static void test_reparse_points(void)
@@ -5610,6 +5612,22 @@ static void test_reparse_points(void)
"Symlink folder's access time does not match.\n");
CloseHandle(handle);
@ -101,10 +102,19 @@ index 1fe5fea47d5..367eef539ce 100644
/* Cleanup */
pRtlFreeUnicodeString(&nameW);
diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c
index bddf55faad8..d907d455fc9 100644
index 2ff931aa57c..2f2658ffb3e 100644
--- a/dlls/ntdll/unix/file.c
+++ b/dlls/ntdll/unix/file.c
@@ -5988,17 +5988,20 @@ static void ignore_server_ioctl_struct_holes( ULONG code, const void *in_buffer,
@@ -3342,7 +3342,7 @@ static NTSTATUS lookup_unix_name( const WCHAR *name, int name_len, char **buffer
for (ptr = name, end = name + name_len; ptr < end; ptr++)
{
if (*ptr == '\\') return STATUS_OBJECT_NAME_INVALID; /* duplicate backslash */
- if (*ptr == '.')
+ if (*ptr == '.' && disposition != FILE_WINE_PATH)
{
if (ptr + 1 == end) return STATUS_OBJECT_NAME_INVALID; /* "." element */
if (ptr[1] == '\\') return STATUS_OBJECT_NAME_INVALID; /* "." element */
@@ -5980,17 +5980,20 @@ static void ignore_server_ioctl_struct_holes( ULONG code, const void *in_buffer,
*/
NTSTATUS create_reparse_point(HANDLE handle, REPARSE_DATA_BUFFER *buffer)
{
@ -127,7 +137,7 @@ index bddf55faad8..d907d455fc9 100644
int i;
switch(buffer->ReparseTag)
@@ -6007,11 +6010,13 @@ NTSTATUS create_reparse_point(HANDLE handle, REPARSE_DATA_BUFFER *buffer)
@@ -5999,11 +6002,13 @@ NTSTATUS create_reparse_point(HANDLE handle, REPARSE_DATA_BUFFER *buffer)
dest_len = buffer->MountPointReparseBuffer.SubstituteNameLength;
offset = buffer->MountPointReparseBuffer.SubstituteNameOffset;
dest = &buffer->MountPointReparseBuffer.PathBuffer[offset];
@ -141,7 +151,7 @@ index bddf55faad8..d907d455fc9 100644
break;
default:
FIXME("stub: FSCTL_SET_REPARSE_POINT(%x)\n", buffer->ReparseTag);
@@ -6024,8 +6029,66 @@ NTSTATUS create_reparse_point(HANDLE handle, REPARSE_DATA_BUFFER *buffer)
@@ -6016,8 +6021,66 @@ NTSTATUS create_reparse_point(HANDLE handle, REPARSE_DATA_BUFFER *buffer)
if ((status = server_get_unix_name( handle, &unix_src )))
goto cleanup;
src_allocated = TRUE;
@ -210,7 +220,7 @@ index bddf55faad8..d907d455fc9 100644
for (;;)
{
unix_dest = malloc( unix_dest_len );
@@ -6041,11 +6104,24 @@ NTSTATUS create_reparse_point(HANDLE handle, REPARSE_DATA_BUFFER *buffer)
@@ -6033,11 +6096,24 @@ NTSTATUS create_reparse_point(HANDLE handle, REPARSE_DATA_BUFFER *buffer)
if (status != STATUS_SUCCESS && status != STATUS_NO_SUCH_FILE)
goto cleanup;
dest_allocated = TRUE;
@ -237,7 +247,7 @@ index bddf55faad8..d907d455fc9 100644
for (i = 0; i < sizeof(ULONG)*8; i++)
{
if ((buffer->ReparseTag >> i) & 1)
@@ -6066,7 +6142,7 @@ NTSTATUS create_reparse_point(HANDLE handle, REPARSE_DATA_BUFFER *buffer)
@@ -6058,7 +6134,7 @@ NTSTATUS create_reparse_point(HANDLE handle, REPARSE_DATA_BUFFER *buffer)
strcat( magic_dest, "." );
strcat( magic_dest, "/" );
}
@ -246,7 +256,7 @@ index bddf55faad8..d907d455fc9 100644
/* Produce the link in a temporary location in the same folder */
strcpy( tmpdir, unix_src );
@@ -6116,7 +6192,9 @@ NTSTATUS create_reparse_point(HANDLE handle, REPARSE_DATA_BUFFER *buffer)
@@ -6108,7 +6184,9 @@ NTSTATUS create_reparse_point(HANDLE handle, REPARSE_DATA_BUFFER *buffer)
cleanup:
if (tempdir_created) rmdir( tmpdir );
@ -267,6 +277,18 @@ index ab3273d3f81..0d02225bc4f 100644
+#define SYMLINK_FLAG_RELATIVE 0x00000001
+
#endif /* __WINE_NTIFS_H */
diff --git a/include/winternl.h b/include/winternl.h
index 68aa4afc176..9e39f2aa5b8 100644
--- a/include/winternl.h
+++ b/include/winternl.h
@@ -2798,6 +2798,7 @@ typedef struct _RTL_ATOM_TABLE
#define FILE_OVERWRITE 4
#define FILE_OVERWRITE_IF 5
#define FILE_MAXIMUM_DISPOSITION 5
+#define FILE_WINE_PATH 6
/* Characteristics of a File System */
#define FILE_REMOVABLE_MEDIA 0x00000001
--
2.30.2

View File

@ -1,4 +1,4 @@
From de6ef008eced847e63429f1a09fe1e7573110093 Mon Sep 17 00:00:00 2001
From 9e13af5faec34f398440f88d357c16a01687c6ac 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.
@ -10,10 +10,10 @@ Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
2 files changed, 47 insertions(+), 6 deletions(-)
diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c
index 367eef539ce..46aadeb7e7d 100644
index 1ace7f76c1f..2f0903fe7f1 100644
--- a/dlls/ntdll/tests/file.c
+++ b/dlls/ntdll/tests/file.c
@@ -5536,9 +5536,22 @@ static void test_reparse_points(void)
@@ -5625,9 +5625,22 @@ static void test_reparse_points(void)
ok(dwret == STATUS_SUCCESS, "Failed to get symlink folder's attributes (0x%x).\n", dwret);
buffer_len = build_reparse_buffer(&targetW[1], IO_REPARSE_TAG_SYMLINK, SYMLINK_FLAG_RELATIVE, &buffer);
bret = DeviceIoControl(handle, FSCTL_SET_REPARSE_POINT, (LPVOID)buffer, buffer_len, NULL, 0, &dwret, 0);
@ -38,10 +38,10 @@ index 367eef539ce..46aadeb7e7d 100644
/* Cleanup */
pRtlFreeUnicodeString(&nameW);
diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c
index d907d455fc9..3a25b803d6f 100644
index 2f2658ffb3e..dd5924731ad 100644
--- a/dlls/ntdll/unix/file.c
+++ b/dlls/ntdll/unix/file.c
@@ -6238,6 +6238,11 @@ NTSTATUS get_reparse_point(HANDLE handle, REPARSE_DATA_BUFFER *buffer, ULONG out
@@ -6230,6 +6230,11 @@ NTSTATUS get_reparse_point(HANDLE handle, REPARSE_DATA_BUFFER *buffer, ULONG out
/* Decode the reparse tag from the symlink */
p = unix_dest;
@ -53,7 +53,7 @@ index d907d455fc9..3a25b803d6f 100644
if (*p++ != '/')
{
status = STATUS_NOT_IMPLEMENTED;
@@ -6275,24 +6280,47 @@ NTSTATUS get_reparse_point(HANDLE handle, REPARSE_DATA_BUFFER *buffer, ULONG out
@@ -6267,24 +6272,47 @@ NTSTATUS get_reparse_point(HANDLE handle, REPARSE_DATA_BUFFER *buffer, ULONG out
memmove(unix_dest, p, unix_dest_len);
unix_dest[unix_dest_len] = 0;

View File

@ -1,4 +1,4 @@
From 9129b44e1ef8458064d773a5605d1ff182d67c54 Mon Sep 17 00:00:00 2001
From 305cf8b8d52fee284d4b34160bdacd0aef8ddbb0 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.
@ -10,10 +10,10 @@ Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
2 files changed, 49 insertions(+), 5 deletions(-)
diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c
index 46aadeb7e7d..e5cfbb68793 100644
index 2f0903fe7f1..dd1fe247288 100644
--- a/dlls/ntdll/tests/file.c
+++ b/dlls/ntdll/tests/file.c
@@ -5463,6 +5463,35 @@ static void test_reparse_points(void)
@@ -5552,6 +5552,35 @@ static void test_reparse_points(void)
/* Delete the junction point directory and create a blank slate for symlink tests */
bret = RemoveDirectoryW(reparse_path);
ok(bret, "Failed to delete junction point!\n");
@ -50,10 +50,10 @@ index 46aadeb7e7d..e5cfbb68793 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 3a25b803d6f..ead0c48d62e 100644
index dd5924731ad..3e4341df363 100644
--- a/dlls/ntdll/unix/file.c
+++ b/dlls/ntdll/unix/file.c
@@ -5998,6 +5998,7 @@ NTSTATUS create_reparse_point(HANDLE handle, REPARSE_DATA_BUFFER *buffer)
@@ -5990,6 +5990,7 @@ NTSTATUS create_reparse_point(HANDLE handle, REPARSE_DATA_BUFFER *buffer)
int relative_offset = 0;
UNICODE_STRING nt_dest;
int dest_len, offset;
@ -61,7 +61,7 @@ index 3a25b803d6f..ead0c48d62e 100644
NTSTATUS status;
struct stat st;
WCHAR *dest;
@@ -6131,7 +6132,6 @@ NTSTATUS create_reparse_point(HANDLE handle, REPARSE_DATA_BUFFER *buffer)
@@ -6123,7 +6124,6 @@ NTSTATUS create_reparse_point(HANDLE handle, REPARSE_DATA_BUFFER *buffer)
/* Encode the type (file or directory) if NT symlink */
if (buffer->ReparseTag == IO_REPARSE_TAG_SYMLINK)
{
@ -69,7 +69,7 @@ index 3a25b803d6f..ead0c48d62e 100644
if (fstat( dest_fd, &st ) == -1)
{
status = errno_to_status( errno );
@@ -6165,8 +6165,11 @@ NTSTATUS create_reparse_point(HANDLE handle, REPARSE_DATA_BUFFER *buffer)
@@ -6157,8 +6157,11 @@ NTSTATUS create_reparse_point(HANDLE handle, REPARSE_DATA_BUFFER *buffer)
/* Atomically move the link into position */
if (!renameat2( -1, tmplink, -1, unix_src, RENAME_EXCHANGE ))
{
@ -83,7 +83,7 @@ index 3a25b803d6f..ead0c48d62e 100644
}
else if (errno == ENOSYS)
{
@@ -6383,6 +6386,7 @@ NTSTATUS remove_reparse_point(HANDLE handle, REPARSE_GUID_DATA_BUFFER *buffer)
@@ -6375,6 +6378,7 @@ NTSTATUS remove_reparse_point(HANDLE handle, REPARSE_GUID_DATA_BUFFER *buffer)
char tmpdir[PATH_MAX], tmpfile[PATH_MAX], *d;
BOOL tempdir_created = FALSE;
int dest_fd, needs_close;
@ -91,7 +91,7 @@ index 3a25b803d6f..ead0c48d62e 100644
NTSTATUS status;
char *unix_name;
struct stat st;
@@ -6395,12 +6399,13 @@ NTSTATUS remove_reparse_point(HANDLE handle, REPARSE_GUID_DATA_BUFFER *buffer)
@@ -6387,12 +6391,13 @@ NTSTATUS remove_reparse_point(HANDLE handle, REPARSE_GUID_DATA_BUFFER *buffer)
TRACE( "Deleting symlink %s\n", unix_name );
@ -106,7 +106,7 @@ index 3a25b803d6f..ead0c48d62e 100644
strcpy( tmpdir, unix_name );
d = dirname( tmpdir);
if (d != tmpdir) strcpy( tmpdir, d );
@@ -6413,11 +6418,21 @@ NTSTATUS remove_reparse_point(HANDLE handle, REPARSE_GUID_DATA_BUFFER *buffer)
@@ -6405,11 +6410,21 @@ NTSTATUS remove_reparse_point(HANDLE handle, REPARSE_GUID_DATA_BUFFER *buffer)
tempdir_created = TRUE;
strcpy( tmpfile, tmpdir );
strcat( tmpfile, "/tmpfile" );

View File

@ -1,4 +1,4 @@
From 5c409a2387a0df100f0fe163d48ab86b66fefa20 Mon Sep 17 00:00:00 2001
From f3adc1cfdff14e1baca4e8e0f42774435f85c110 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
@ -7,14 +7,13 @@ 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 | 19 +++++++++++++++++--
include/winternl.h | 1 +
2 files changed, 18 insertions(+), 2 deletions(-)
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c
index ead0c48d62e..be57865f6b3 100644
index 3e4341df363..d654f82e8d7 100644
--- a/dlls/ntdll/unix/file.c
+++ b/dlls/ntdll/unix/file.c
@@ -3388,7 +3388,8 @@ static NTSTATUS lookup_unix_name( const WCHAR *name, int name_len, char **buffer
@@ -3409,7 +3409,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)
{
@ -24,7 +23,7 @@ index ead0c48d62e..be57865f6b3 100644
{
status = STATUS_OBJECT_NAME_NOT_FOUND;
if (disposition != FILE_OPEN && disposition != FILE_OVERWRITE)
@@ -3408,6 +3409,20 @@ static NTSTATUS lookup_unix_name( const WCHAR *name, int name_len, char **buffer
@@ -3429,6 +3430,20 @@ static NTSTATUS lookup_unix_name( const WCHAR *name, int name_len, char **buffer
status = STATUS_OBJECT_NAME_COLLISION;
}
}
@ -45,7 +44,7 @@ index ead0c48d62e..be57865f6b3 100644
if (status != STATUS_SUCCESS) break;
@@ -6098,7 +6113,7 @@ NTSTATUS create_reparse_point(HANDLE handle, REPARSE_DATA_BUFFER *buffer)
@@ -6090,7 +6105,7 @@ NTSTATUS create_reparse_point(HANDLE handle, REPARSE_DATA_BUFFER *buffer)
status = STATUS_NO_MEMORY;
goto cleanup;
}
@ -54,18 +53,6 @@ index ead0c48d62e..be57865f6b3 100644
if (status != STATUS_BUFFER_TOO_SMALL) break;
free( unix_dest );
}
diff --git a/include/winternl.h b/include/winternl.h
index 8bfc7de67d0..2daee57e50f 100644
--- a/include/winternl.h
+++ b/include/winternl.h
@@ -2678,6 +2678,7 @@ typedef struct _RTL_ATOM_TABLE
#define FILE_OVERWRITE 4
#define FILE_OVERWRITE_IF 5
#define FILE_MAXIMUM_DISPOSITION 5
+#define FILE_WINE_PATH 6
/* Characteristics of a File System */
#define FILE_REMOVABLE_MEDIA 0x00000001
--
2.30.2

View File

@ -1,4 +1,4 @@
From 99f1cef882a3f8098c76cf0918b99882533d1bbd Mon Sep 17 00:00:00 2001
From ae2de3a0dd9c403317e6e681bb32d13907e2f61a 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.
@ -9,7 +9,7 @@ Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
1 file changed, 78 insertions(+), 38 deletions(-)
diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c
index be57865f6b3..94be474a0ff 100644
index d654f82e8d7..a84062df272 100644
--- a/dlls/ntdll/unix/file.c
+++ b/dlls/ntdll/unix/file.c
@@ -1606,6 +1606,9 @@ static inline int get_file_xattr( char *hexattr, int attrlen )
@ -42,7 +42,7 @@ index be57865f6b3..94be474a0ff 100644
}
else if (S_ISDIR( st->st_mode ) && (parent_path = malloc( strlen(path) + 4 )))
{
@@ -6219,46 +6227,35 @@ cleanup:
@@ -6211,46 +6219,35 @@ cleanup:
}
@ -105,7 +105,7 @@ index be57865f6b3..94be474a0ff 100644
p++;
}
if (*p++ != '/')
@@ -6266,7 +6263,7 @@ NTSTATUS get_reparse_point(HANDLE handle, REPARSE_DATA_BUFFER *buffer, ULONG out
@@ -6258,7 +6255,7 @@ NTSTATUS get_reparse_point(HANDLE handle, REPARSE_DATA_BUFFER *buffer, ULONG out
status = STATUS_NOT_IMPLEMENTED;
goto cleanup;
}
@ -114,7 +114,7 @@ index be57865f6b3..94be474a0ff 100644
for (i = 0; i < sizeof(ULONG)*8; i++)
{
char c = *p++;
@@ -6281,22 +6278,65 @@ NTSTATUS get_reparse_point(HANDLE handle, REPARSE_DATA_BUFFER *buffer, ULONG out
@@ -6273,22 +6270,65 @@ NTSTATUS get_reparse_point(HANDLE handle, REPARSE_DATA_BUFFER *buffer, ULONG out
status = STATUS_NOT_IMPLEMENTED;
goto cleanup;
}

View File

@ -1,4 +1,4 @@
From 29337136ad7b6bdacd2910622ef3685ebacfe8fa Mon Sep 17 00:00:00 2001
From 78a4666b1a010b45f8ac13cd4be3d4cdecb3dfdc 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 05c1471fc29add8269c805692def9107de436bfa Mon Sep 17 00:00:00 2001
From 8bf803c2e96ff62b165551f2cd4dae1cc98ca7b3 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.
@ -9,10 +9,10 @@ Subject: [PATCH] server: Implement FILE_OPEN_REPARSE_POINT option.
2 files changed, 55 insertions(+), 11 deletions(-)
diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c
index e5cfbb68793..f3eecbbc708 100644
index dd1fe247288..490d5160761 100644
--- a/dlls/ntdll/tests/file.c
+++ b/dlls/ntdll/tests/file.c
@@ -5299,6 +5299,7 @@ static void test_reparse_points(void)
@@ -5388,6 +5388,7 @@ static void test_reparse_points(void)
static const WCHAR dotW[] = {'.',0};
REPARSE_DATA_BUFFER *buffer = NULL;
DWORD dwret, dwLen, dwFlags, err;
@ -20,7 +20,7 @@ index e5cfbb68793..f3eecbbc708 100644
HANDLE handle, token;
IO_STATUS_BLOCK iosb;
UNICODE_STRING nameW;
@@ -5386,7 +5387,7 @@ static void test_reparse_points(void)
@@ -5475,7 +5476,7 @@ static void test_reparse_points(void)
memset(&old_attrib, 0x00, sizeof(old_attrib));
old_attrib.LastAccessTime.QuadPart = 0x200deadcafebeef;
dwret = NtSetInformationFile(handle, &iosb, &old_attrib, sizeof(old_attrib), FileBasicInformation);
@ -29,7 +29,7 @@ index e5cfbb68793..f3eecbbc708 100644
memset(&guid_buffer, 0x00, sizeof(guid_buffer));
guid_buffer.ReparseTag = IO_REPARSE_TAG_MOUNT_POINT;
bret = DeviceIoControl(handle, FSCTL_DELETE_REPARSE_POINT, (LPVOID)&guid_buffer,
@@ -5395,7 +5396,7 @@ static void test_reparse_points(void)
@@ -5484,7 +5485,7 @@ static void test_reparse_points(void)
memset(&new_attrib, 0x00, sizeof(new_attrib));
dwret = NtQueryInformationFile(handle, &iosb, &new_attrib, sizeof(new_attrib), FileBasicInformation);
ok(dwret == STATUS_SUCCESS, "Failed to get junction point folder's attributes (0x%x).\n", dwret);
@ -38,7 +38,7 @@ index e5cfbb68793..f3eecbbc708 100644
"Junction point folder's access time does not match.\n");
CloseHandle(handle);
@@ -5476,6 +5477,24 @@ static void test_reparse_points(void)
@@ -5565,6 +5566,24 @@ static void test_reparse_points(void)
ok(bret, "Failed to create symlink! (0x%x)\n", GetLastError());
CloseHandle(handle);
@ -63,7 +63,7 @@ index e5cfbb68793..f3eecbbc708 100644
/* Check deleting a file symlink as if it were a directory */
bret = RemoveDirectoryW(reparse_path);
todo_wine ok(!bret, "Succeeded in deleting file symlink as a directory!\n");
@@ -5539,7 +5558,7 @@ static void test_reparse_points(void)
@@ -5628,7 +5647,7 @@ static void test_reparse_points(void)
memset(&old_attrib, 0x00, sizeof(old_attrib));
old_attrib.LastAccessTime.QuadPart = 0x200deadcafebeef;
dwret = NtSetInformationFile(handle, &iosb, &old_attrib, sizeof(old_attrib), FileBasicInformation);
@ -72,7 +72,7 @@ index e5cfbb68793..f3eecbbc708 100644
memset(&guid_buffer, 0x00, sizeof(guid_buffer));
guid_buffer.ReparseTag = IO_REPARSE_TAG_SYMLINK;
bret = DeviceIoControl(handle, FSCTL_DELETE_REPARSE_POINT, (LPVOID)&guid_buffer,
@@ -5548,7 +5567,7 @@ static void test_reparse_points(void)
@@ -5637,7 +5656,7 @@ static void test_reparse_points(void)
memset(&new_attrib, 0x00, sizeof(new_attrib));
dwret = NtQueryInformationFile(handle, &iosb, &new_attrib, sizeof(new_attrib), FileBasicInformation);
ok(dwret == STATUS_SUCCESS, "Failed to get symlink folder's attributes (0x%x).\n", dwret);
@ -82,7 +82,7 @@ index e5cfbb68793..f3eecbbc708 100644
CloseHandle(handle);
diff --git a/server/fd.c b/server/fd.c
index 2605adf96ff..4fe7e6de53f 100644
index 2adadceae25..4f3197a470a 100644
--- a/server/fd.c
+++ b/server/fd.c
@@ -107,6 +107,10 @@
@ -96,7 +96,7 @@ index 2605adf96ff..4fe7e6de53f 100644
#if defined(HAVE_SYS_EPOLL_H) && defined(HAVE_EPOLL_CREATE)
# include <sys/epoll.h>
# define USE_EPOLL
@@ -1898,6 +1902,14 @@ void get_nt_name( struct fd *fd, struct unicode_str *name )
@@ -1895,6 +1899,14 @@ void get_nt_name( struct fd *fd, struct unicode_str *name )
name->len = fd->nt_namelen;
}
@ -111,7 +111,7 @@ index 2605adf96ff..4fe7e6de53f 100644
/* open() wrapper that returns a struct fd with no fd user set */
struct fd *open_fd( struct fd *root, const char *name, struct unicode_str nt_name,
int flags, mode_t *mode, unsigned int access,
@@ -1958,6 +1970,18 @@ struct fd *open_fd( struct fd *root, const char *name, struct unicode_str nt_nam
@@ -1955,6 +1967,18 @@ struct fd *open_fd( struct fd *root, const char *name, struct unicode_str nt_nam
}
else rw_mode = O_RDONLY;
@ -130,7 +130,7 @@ index 2605adf96ff..4fe7e6de53f 100644
if ((fd->unix_fd = open( name, rw_mode | (flags & ~O_TRUNC), *mode )) == -1)
{
/* if we tried to open a directory for write access, retry read-only */
@@ -1975,12 +1999,6 @@ struct fd *open_fd( struct fd *root, const char *name, struct unicode_str nt_nam
@@ -1972,12 +1996,6 @@ struct fd *open_fd( struct fd *root, const char *name, struct unicode_str nt_nam
}
fd->nt_name = dup_nt_name( root, nt_name, &fd->nt_namelen );
@ -143,7 +143,7 @@ index 2605adf96ff..4fe7e6de53f 100644
closed_fd->unix_fd = fd->unix_fd;
closed_fd->unlink = 0;
@@ -2425,6 +2443,7 @@ static struct fd *get_handle_fd_obj( struct process *process, obj_handle_t handl
@@ -2428,6 +2446,7 @@ static struct fd *get_handle_fd_obj( struct process *process, obj_handle_t handl
static int is_dir_empty( int fd )
{
@ -151,7 +151,7 @@ index 2605adf96ff..4fe7e6de53f 100644
DIR *dir;
int empty;
struct dirent *de;
@@ -2432,8 +2451,13 @@ static int is_dir_empty( int fd )
@@ -2435,8 +2454,13 @@ static int is_dir_empty( int fd )
if ((fd = dup( fd )) == -1)
return -1;
@ -166,7 +166,7 @@ index 2605adf96ff..4fe7e6de53f 100644
close( fd );
return -1;
}
@@ -2445,6 +2469,7 @@ static int is_dir_empty( int fd )
@@ -2448,6 +2472,7 @@ static int is_dir_empty( int fd )
empty = 0;
}
closedir( dir );

View File

@ -1,4 +1,4 @@
From 2b954893dcd3d0088f214c6a12846a3cf1149e24 Mon Sep 17 00:00:00 2001
From 27c9c2851bb3629cb47134efe3a2162bca80aca6 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 7553b22e76d..7ed08b6336d 100644
index f80fbd737ef..fb71556cfa3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2227,7 +2227,8 @@ AC_CHECK_FUNCS(\
@@ -2223,7 +2223,8 @@ AC_CHECK_FUNCS(\
sigprocmask \
symlink \
tcdrain \
@ -25,10 +25,10 @@ index 7553b22e76d..7ed08b6336d 100644
CFLAGS="$ac_save_CFLAGS"
diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c
index f3eecbbc708..17ed907d628 100644
index 490d5160761..2449ee54799 100644
--- a/dlls/ntdll/tests/file.c
+++ b/dlls/ntdll/tests/file.c
@@ -5387,7 +5387,7 @@ static void test_reparse_points(void)
@@ -5476,7 +5476,7 @@ static void test_reparse_points(void)
memset(&old_attrib, 0x00, sizeof(old_attrib));
old_attrib.LastAccessTime.QuadPart = 0x200deadcafebeef;
dwret = NtSetInformationFile(handle, &iosb, &old_attrib, sizeof(old_attrib), FileBasicInformation);
@ -37,7 +37,7 @@ index f3eecbbc708..17ed907d628 100644
memset(&guid_buffer, 0x00, sizeof(guid_buffer));
guid_buffer.ReparseTag = IO_REPARSE_TAG_MOUNT_POINT;
bret = DeviceIoControl(handle, FSCTL_DELETE_REPARSE_POINT, (LPVOID)&guid_buffer,
@@ -5396,7 +5396,7 @@ static void test_reparse_points(void)
@@ -5485,7 +5485,7 @@ static void test_reparse_points(void)
memset(&new_attrib, 0x00, sizeof(new_attrib));
dwret = NtQueryInformationFile(handle, &iosb, &new_attrib, sizeof(new_attrib), FileBasicInformation);
ok(dwret == STATUS_SUCCESS, "Failed to get junction point folder's attributes (0x%x).\n", dwret);
@ -46,7 +46,7 @@ index f3eecbbc708..17ed907d628 100644
"Junction point folder's access time does not match.\n");
CloseHandle(handle);
@@ -5558,7 +5558,7 @@ static void test_reparse_points(void)
@@ -5647,7 +5647,7 @@ static void test_reparse_points(void)
memset(&old_attrib, 0x00, sizeof(old_attrib));
old_attrib.LastAccessTime.QuadPart = 0x200deadcafebeef;
dwret = NtSetInformationFile(handle, &iosb, &old_attrib, sizeof(old_attrib), FileBasicInformation);
@ -55,7 +55,7 @@ index f3eecbbc708..17ed907d628 100644
memset(&guid_buffer, 0x00, sizeof(guid_buffer));
guid_buffer.ReparseTag = IO_REPARSE_TAG_SYMLINK;
bret = DeviceIoControl(handle, FSCTL_DELETE_REPARSE_POINT, (LPVOID)&guid_buffer,
@@ -5567,7 +5567,7 @@ static void test_reparse_points(void)
@@ -5656,7 +5656,7 @@ static void test_reparse_points(void)
memset(&new_attrib, 0x00, sizeof(new_attrib));
dwret = NtQueryInformationFile(handle, &iosb, &new_attrib, sizeof(new_attrib), FileBasicInformation);
ok(dwret == STATUS_SUCCESS, "Failed to get symlink folder's attributes (0x%x).\n", dwret);
@ -65,7 +65,7 @@ index f3eecbbc708..17ed907d628 100644
CloseHandle(handle);
diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c
index 94be474a0ff..319f42e9e0c 100644
index a84062df272..185f7e3bbeb 100644
--- a/dlls/ntdll/unix/file.c
+++ b/dlls/ntdll/unix/file.c
@@ -1731,6 +1731,14 @@ static int get_file_info( const char *path, struct stat *st, ULONG *attr )

View File

@ -1,4 +1,4 @@
From 4ee6ccb3ca1639d81bd9e8ce572131905e6a8df1 Mon Sep 17 00:00:00 2001
From 9b5273bca73d9bd0d86a30f4517c6d37297c8c12 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.
@ -10,10 +10,10 @@ Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
2 files changed, 62 insertions(+), 8 deletions(-)
diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c
index 17ed907d628..a4648dd65e0 100644
index 2449ee54799..9fe806ff3cc 100644
--- a/dlls/ntdll/tests/file.c
+++ b/dlls/ntdll/tests/file.c
@@ -5497,18 +5497,18 @@ static void test_reparse_points(void)
@@ -5586,18 +5586,18 @@ static void test_reparse_points(void)
/* Check deleting a file symlink as if it were a directory */
bret = RemoveDirectoryW(reparse_path);
@ -39,10 +39,10 @@ index 17ed907d628..a4648dd65e0 100644
/* Create a blank slate for directory symlink tests */
bret = CreateDirectoryW(reparse_path, NULL);
diff --git a/server/fd.c b/server/fd.c
index 4fe7e6de53f..fcffe4a4afd 100644
index 4f3197a470a..fa5805ba840 100644
--- a/server/fd.c
+++ b/server/fd.c
@@ -1910,6 +1910,55 @@ int check_symlink( char *name )
@@ -1907,6 +1907,55 @@ int check_symlink( char *name )
return S_ISLNK( st.st_mode );
}
@ -98,7 +98,7 @@ index 4fe7e6de53f..fcffe4a4afd 100644
/* open() wrapper that returns a struct fd with no fd user set */
struct fd *open_fd( struct fd *root, const char *name, struct unicode_str nt_name,
int flags, mode_t *mode, unsigned int access,
@@ -2012,6 +2061,7 @@ struct fd *open_fd( struct fd *root, const char *name, struct unicode_str nt_nam
@@ -2009,6 +2058,7 @@ struct fd *open_fd( struct fd *root, const char *name, struct unicode_str nt_nam
{
unsigned int err;
struct inode *inode = get_inode( st.st_dev, st.st_ino, fd->unix_fd );
@ -106,7 +106,7 @@ index 4fe7e6de53f..fcffe4a4afd 100644
if (!inode)
{
@@ -2026,16 +2076,20 @@ struct fd *open_fd( struct fd *root, const char *name, struct unicode_str nt_nam
@@ -2023,16 +2073,20 @@ struct fd *open_fd( struct fd *root, const char *name, struct unicode_str nt_nam
list_add_head( &inode->open, &fd->inode_entry );
closed_fd = NULL;

View File

@ -1,4 +1,4 @@
From 4f38f2552b1d31e427ea0c45f2146485a4ade4ee Mon Sep 17 00:00:00 2001
From ad32c366caa3737a2695c8d138972baafe5b152e 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.
@ -8,10 +8,10 @@ Subject: [PATCH] server: Properly handle deleting dangling symlinks.
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/server/fd.c b/server/fd.c
index fcffe4a4afd..4ef3c673268 100644
index fa5805ba840..c8fa494caf9 100644
--- a/server/fd.c
+++ b/server/fd.c
@@ -2029,6 +2029,7 @@ struct fd *open_fd( struct fd *root, const char *name, struct unicode_str nt_nam
@@ -2026,6 +2026,7 @@ struct fd *open_fd( struct fd *root, const char *name, struct unicode_str nt_nam
#endif
fd->unlink_name = path;
fd->unix_name = realpath( path, NULL );
@ -19,7 +19,7 @@ index fcffe4a4afd..4ef3c673268 100644
}
if ((fd->unix_fd = open( name, rw_mode | (flags & ~O_TRUNC), *mode )) == -1)
@@ -2551,7 +2552,7 @@ static void set_fd_disposition( struct fd *fd, int unlink )
@@ -2565,7 +2566,7 @@ static void set_fd_disposition( struct fd *fd, int unlink )
file_set_error();
return;
}

View File

@ -1,4 +1,4 @@
From 948fd2c1ec52cb7921d23b3fbaaf355075928611 Mon Sep 17 00:00:00 2001
From 5449c86f52875d80d4ce0e8001b17dd47552e1a7 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