ntdll-Junction_Points: Updates from Erich E. Hoover.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50586
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50285
This commit is contained in:
Zebediah Figura 2021-02-27 00:07:31 -06:00
parent dfc989712e
commit 750044c08c
41 changed files with 994 additions and 384 deletions

View File

@ -1,7 +1,7 @@
From bf59059770b5398f4d440466c219b03b9c0a9d02 Mon Sep 17 00:00:00 2001
From 5b5d3c574a0586bf6690db9957dbe6708a8801ec 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: ntdll: Add support for junction point creation.
Subject: [PATCH] ntdll: Add support for junction point creation.
Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
---
@ -14,7 +14,7 @@ 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 df006e31e47..a944591343d 100644
index 0510b47963a..26af8a0a4b7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2216,6 +2216,8 @@ AC_CHECK_FUNCS(\
@ -27,7 +27,7 @@ index df006e31e47..a944591343d 100644
setproctitle \
setprogname \
diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c
index 8cfdb72ae97..6359c5bcd48 100644
index 498da270a34..792c07b0d8e 100644
--- a/dlls/ntdll/tests/file.c
+++ b/dlls/ntdll/tests/file.c
@@ -38,6 +38,7 @@
@ -38,7 +38,7 @@ index 8cfdb72ae97..6359c5bcd48 100644
#ifndef IO_COMPLETION_ALL_ACCESS
#define IO_COMPLETION_ALL_ACCESS 0x001F0003
@@ -5153,6 +5154,105 @@ static void test_mailslot_name(void)
@@ -5152,6 +5153,105 @@ static void test_mailslot_name(void)
CloseHandle( device );
}
@ -144,7 +144,7 @@ index 8cfdb72ae97..6359c5bcd48 100644
START_TEST(file)
{
HMODULE hkernel32 = GetModuleHandleA("kernel32.dll");
@@ -5225,5 +5325,6 @@ START_TEST(file)
@@ -5224,5 +5324,6 @@ START_TEST(file)
test_ioctl();
test_query_ea();
test_flush_buffers_file();
@ -152,7 +152,7 @@ index 8cfdb72ae97..6359c5bcd48 100644
test_mailslot_name();
}
diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c
index 53c1674c2eb..5d717a385cb 100644
index e9d88320bc2..a5b3d5090aa 100644
--- a/dlls/ntdll/unix/file.c
+++ b/dlls/ntdll/unix/file.c
@@ -36,6 +36,7 @@
@ -171,7 +171,7 @@ index 53c1674c2eb..5d717a385cb 100644
WINE_DEFAULT_DEBUG_CHANNEL(file);
WINE_DECLARE_DEBUG_CHANNEL(winediag);
@@ -155,6 +157,10 @@ WINE_DECLARE_DEBUG_CHANNEL(winediag);
@@ -153,6 +155,10 @@ WINE_DECLARE_DEBUG_CHANNEL(winediag);
#undef EXT2_IOC_GETFLAGS
#undef EXT4_CASEFOLD_FL
@ -182,7 +182,7 @@ index 53c1674c2eb..5d717a385cb 100644
#ifdef linux
/* We want the real kernel dirent structure, not the libc one */
@@ -481,6 +487,32 @@ static int xattr_set( const char *path, const char *name, void *value, size_t si
@@ -479,6 +485,32 @@ static int xattr_set( const char *path, const char *name, void *value, size_t si
#endif
}
@ -215,7 +215,7 @@ index 53c1674c2eb..5d717a385cb 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 )
{
@@ -5761,6 +5793,116 @@ static void ignore_server_ioctl_struct_holes( ULONG code, const void *in_buffer,
@@ -5840,6 +5872,116 @@ static void ignore_server_ioctl_struct_holes( ULONG code, const void *in_buffer,
}
@ -332,7 +332,7 @@ index 53c1674c2eb..5d717a385cb 100644
/******************************************************************************
* NtFsControlFile (NTDLL.@)
*/
@@ -5843,6 +5985,23 @@ NTSTATUS WINAPI NtFsControlFile( HANDLE handle, HANDLE event, PIO_APC_ROUTINE ap
@@ -5922,6 +6064,23 @@ NTSTATUS WINAPI NtFsControlFile( HANDLE handle, HANDLE event, PIO_APC_ROUTINE ap
break;
}
@ -357,7 +357,7 @@ index 53c1674c2eb..5d717a385cb 100644
TRACE("FSCTL_SET_SPARSE: Ignoring request\n");
io->Information = 0;
diff --git a/include/Makefile.in b/include/Makefile.in
index dc849da763c..9de1577aebc 100644
index 6c16e01a271..bf938cae250 100644
--- a/include/Makefile.in
+++ b/include/Makefile.in
@@ -533,6 +533,7 @@ SOURCES = \
@ -417,5 +417,5 @@ index 00000000000..21d42e17325
+
+#endif /* __WINE_NTIFS_H */
--
2.17.1
2.20.1

View File

@ -1,7 +1,7 @@
From a3a18766dd4ea00e86fd6a22b29df83a5acd9d75 Mon Sep 17 00:00:00 2001
From 115fc2745111b35ae65ea5c046428b93655d0a65 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: ntdll: Add support for reading junction points.
Subject: [PATCH] ntdll: Add support for reading junction points.
Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
---
@ -10,10 +10,10 @@ Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
2 files changed, 133 insertions(+), 1 deletion(-)
diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c
index 6359c5bcd48..8999a063163 100644
index 792c07b0d8e..88e114ab7a2 100644
--- a/dlls/ntdll/tests/file.c
+++ b/dlls/ntdll/tests/file.c
@@ -5190,9 +5190,10 @@ static void test_reparse_points(void)
@@ -5189,9 +5189,10 @@ static void test_reparse_points(void)
static const WCHAR dotW[] = {'.',0};
REPARSE_DATA_BUFFER *buffer = NULL;
DWORD dwret, dwLen, dwFlags;
@ -25,7 +25,7 @@ index 6359c5bcd48..8999a063163 100644
BOOL bret;
/* Create a temporary folder for the junction point tests */
@@ -5240,6 +5241,17 @@ static void test_reparse_points(void)
@@ -5239,6 +5240,17 @@ 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());
@ -44,10 +44,10 @@ index 6359c5bcd48..8999a063163 100644
cleanup:
diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c
index 5d717a385cb..5cb286cb6ff 100644
index a5b3d5090aa..13cc797e54e 100644
--- a/dlls/ntdll/unix/file.c
+++ b/dlls/ntdll/unix/file.c
@@ -5903,6 +5903,120 @@ cleanup:
@@ -5982,6 +5982,120 @@ cleanup:
}
@ -168,7 +168,7 @@ index 5d717a385cb..5cb286cb6ff 100644
/******************************************************************************
* NtFsControlFile (NTDLL.@)
*/
@@ -5985,6 +6099,12 @@ NTSTATUS WINAPI NtFsControlFile( HANDLE handle, HANDLE event, PIO_APC_ROUTINE ap
@@ -6064,6 +6178,12 @@ NTSTATUS WINAPI NtFsControlFile( HANDLE handle, HANDLE event, PIO_APC_ROUTINE ap
break;
}
@ -182,5 +182,5 @@ index 5d717a385cb..5cb286cb6ff 100644
{
REPARSE_DATA_BUFFER *buffer = (REPARSE_DATA_BUFFER *)in_buffer;
--
2.17.1
2.20.1

View File

@ -1,7 +1,7 @@
From f88a842e600e87a8e1ffed94f4ad3b5479fa6882 Mon Sep 17 00:00:00 2001
From 0a6eefc1c56cad4d75aa9a1384a94f2fd2d8bec9 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: ntdll: Add support for deleting junction points.
Subject: [PATCH] ntdll: Add support for deleting junction points.
Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
---
@ -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 8999a063163..a57bd8285dc 100644
index 88e114ab7a2..0dcefdef97b 100644
--- a/dlls/ntdll/tests/file.c
+++ b/dlls/ntdll/tests/file.c
@@ -5185,12 +5185,15 @@ static void test_reparse_points(void)
@@ -5184,12 +5184,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 8999a063163..a57bd8285dc 100644
UNICODE_STRING nameW;
HANDLE handle;
WCHAR *dest;
@@ -5238,6 +5241,8 @@ static void test_reparse_points(void)
@@ -5237,6 +5240,8 @@ static void test_reparse_points(void)
win_skip("Failed to open junction point directory handle (0x%x).\n", GetLastError());
goto cleanup;
}
@ -39,7 +39,7 @@ index 8999a063163..a57bd8285dc 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());
@@ -5252,6 +5257,22 @@ static void test_reparse_points(void)
@@ -5251,6 +5256,22 @@ static void test_reparse_points(void)
dest = &buffer->MountPointReparseBuffer.PathBuffer[buffer->MountPointReparseBuffer.SubstituteNameOffset/sizeof(WCHAR)];
ok((memcmp(dest, nameW.Buffer, string_len) == 0), "Junction point destination does not match ('%s' != '%s')!\n",
wine_dbgstr_w(dest), wine_dbgstr_w(nameW.Buffer));
@ -62,7 +62,7 @@ index 8999a063163..a57bd8285dc 100644
CloseHandle(handle);
cleanup:
@@ -5259,7 +5280,7 @@ cleanup:
@@ -5258,7 +5279,7 @@ cleanup:
pRtlFreeUnicodeString(&nameW);
HeapFree(GetProcessHeap(), 0, buffer);
bret = RemoveDirectoryW(reparse_path);
@ -72,10 +72,10 @@ index 8999a063163..a57bd8285dc 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 5cb286cb6ff..fe86f5a86b3 100644
index 13cc797e54e..28191fb9258 100644
--- a/dlls/ntdll/unix/file.c
+++ b/dlls/ntdll/unix/file.c
@@ -6017,6 +6017,87 @@ cleanup:
@@ -6096,6 +6096,87 @@ cleanup:
}
@ -163,7 +163,7 @@ index 5cb286cb6ff..fe86f5a86b3 100644
/******************************************************************************
* NtFsControlFile (NTDLL.@)
*/
@@ -6099,6 +6180,22 @@ NTSTATUS WINAPI NtFsControlFile( HANDLE handle, HANDLE event, PIO_APC_ROUTINE ap
@@ -6178,6 +6259,22 @@ NTSTATUS WINAPI NtFsControlFile( HANDLE handle, HANDLE event, PIO_APC_ROUTINE ap
break;
}
@ -208,5 +208,5 @@ index 21d42e17325..4539b89d583 100644
+
#endif /* __WINE_NTIFS_H */
--
2.17.1
2.20.1

View File

@ -1,7 +1,7 @@
From 17dbb234d78b753b71ae39e7ed9aca51f5d7f5cc Mon Sep 17 00:00:00 2001
From 68608b8100a07e22e873bc07dfd71bca128195f0 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: ntdll: Add a test for junction point advertisement.
Subject: [PATCH] ntdll: Add a test for junction point advertisement.
Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
---
@ -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 a57bd8285dc..49e2771f587 100644
index 0dcefdef97b..7ad25ffd239 100644
--- a/dlls/ntdll/tests/file.c
+++ b/dlls/ntdll/tests/file.c
@@ -5247,6 +5247,11 @@ static void test_reparse_points(void)
@@ -5246,6 +5246,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());
@ -25,5 +25,5 @@ index a57bd8285dc..49e2771f587 100644
HeapFree(GetProcessHeap(), 0, buffer);
buffer_len = sizeof(*buffer) + MAX_PATH*sizeof(WCHAR);
--
2.17.1
2.20.1

View File

@ -1,4 +1,4 @@
From 43a042096de57734560d7745bce70c45722c44fa Mon Sep 17 00:00:00 2001
From b56a57487422e65693d0308ac2a0683ec7bb21ce 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,8 +7,8 @@ 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 | 37 ++++++++++++++++++++++++++++---------
2 files changed, 61 insertions(+), 10 deletions(-)
server/fd.c | 36 +++++++++++++++++++++++++++---------
2 files changed, 60 insertions(+), 10 deletions(-)
diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c
index 7ad25ffd239..5a2ac2114b0 100644
@ -63,7 +63,7 @@ index 7ad25ffd239..5a2ac2114b0 100644
/* Cleanup */
pRtlFreeUnicodeString(&nameW);
diff --git a/server/fd.c b/server/fd.c
index 2dcdd04a892..b67814c7a4f 100644
index 65a6f876e5c..4f43f41fb31 100644
--- a/server/fd.c
+++ b/server/fd.c
@@ -169,7 +169,8 @@ struct closed_fd
@ -187,13 +187,12 @@ index 2dcdd04a892..b67814c7a4f 100644
/* check directory options */
if ((options & FILE_DIRECTORY_FILE) && !S_ISDIR(st.st_mode))
{
@@ -2610,10 +2628,11 @@ static void set_fd_name( struct fd *fd, struct fd *root, const char *nameptr, da
@@ -2611,10 +2629,10 @@ 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

@ -0,0 +1,140 @@
From 030f5dc385e009c1074817bc0ec528ac81e02737 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.
---
dlls/mountmgr.sys/device.c | 74 +++++++++++++++++++++++++++++++++++++-
dlls/ntdll/tests/file.c | 9 +++--
2 files changed, 80 insertions(+), 3 deletions(-)
diff --git a/dlls/mountmgr.sys/device.c b/dlls/mountmgr.sys/device.c
index dd2c7d70759..00cca81e9ad 100644
--- a/dlls/mountmgr.sys/device.c
+++ b/dlls/mountmgr.sys/device.c
@@ -31,6 +31,15 @@
#ifdef HAVE_SYS_IOCTL_H
# include <sys/ioctl.h>
#endif
+#ifdef HAVE_SYS_STATFS_H
+# include <sys/statfs.h>
+#endif
+#ifdef HAVE_SYS_SYSCALL_H
+# include <sys/syscall.h>
+#endif
+#ifdef HAVE_SYS_VFS_H
+# include <sys/vfs.h>
+#endif
#define NONAMELESSUNION
@@ -1828,6 +1837,68 @@ static NTSTATUS query_property( struct disk_device *device, IRP *irp )
return status;
}
+static DWORD get_fs_flags( struct volume *volume )
+{
+#if defined(__NR_renameat2) || defined(RENAME_SWAP)
+#if defined(HAVE_FSTATFS)
+ struct statfs stfs;
+#elif defined(HAVE_FSTATVFS)
+ struct statvfs stfs;
+#endif
+ int fd;
+
+ if ((fd = open_volume_file( volume, "" )) == -1)
+ return 0;
+#if defined(HAVE_FSTATFS)
+ if (fstatfs(fd, &stfs))
+ return 0;
+#elif defined(HAVE_FSTATVFS)
+ if (fstatvfs(fd, &stfs))
+ return 0;
+#endif
+ close( fd );
+#if defined(HAVE_FSTATFS) && defined(linux)
+ switch (stfs.f_type)
+ {
+ case 0x6969: /* nfs */
+ case 0xff534d42: /* cifs */
+ case 0x564c: /* ncpfs */
+ case 0x01021994: /* tmpfs */
+ case 0x28cd3d45: /* cramfs */
+ case 0x1373: /* devfs */
+ case 0x9fa0: /* procfs */
+ case 0xef51: /* old ext2 */
+ case 0xef53: /* ext2/3/4 */
+ case 0x4244: /* hfs */
+ case 0xf995e849: /* hpfs */
+ case 0x5346544e: /* ntfs */
+ return FILE_SUPPORTS_REPARSE_POINTS;
+ default:
+ break;
+ }
+#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__) || defined(__DragonFly__) || defined(__APPLE__) || defined(__NetBSD__)
+ if (!strcmp("apfs", stfs.f_fstypename) ||
+ !strcmp("nfs", stfs.f_fstypename) ||
+ !strcmp("cifs", stfs.f_fstypename) ||
+ !strcmp("ncpfs", stfs.f_fstypename) ||
+ !strcmp("tmpfs", stfs.f_fstypename) ||
+ !strcmp("cramfs", stfs.f_fstypename) ||
+ !strcmp("devfs", stfs.f_fstypename) ||
+ !strcmp("procfs", stfs.f_fstypename) ||
+ !strcmp("ext2", stfs.f_fstypename) ||
+ !strcmp("ext3", stfs.f_fstypename) ||
+ !strcmp("ext4", stfs.f_fstypename) ||
+ !strcmp("hfs", stfs.f_fstypename) ||
+ !strcmp("hpfs", stfs.f_fstypename) ||
+ !strcmp("ntfs", stfs.f_fstypename))
+ {
+ return FILE_SUPPORTS_REPARSE_POINTS;
+ }
+#endif
+#endif
+ return 0;
+}
+
static NTSTATUS WINAPI harddisk_query_volume( DEVICE_OBJECT *device, IRP *irp )
{
IO_STACK_LOCATION *irpsp = IoGetCurrentIrpStackLocation( irp );
@@ -1916,7 +1987,8 @@ static NTSTATUS WINAPI harddisk_query_volume( DEVICE_OBJECT *device, IRP *irp )
memcpy(info->FileSystemName, fat32W, info->FileSystemNameLength);
break;
default:
- info->FileSystemAttributes = FILE_CASE_PRESERVED_NAMES | FILE_PERSISTENT_ACLS;
+ info->FileSystemAttributes = FILE_CASE_PRESERVED_NAMES | FILE_PERSISTENT_ACLS
+ | get_fs_flags( volume );
info->MaximumComponentNameLength = 255;
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 5a2ac2114b0..5882793c883 100644
--- a/dlls/ntdll/tests/file.c
+++ b/dlls/ntdll/tests/file.c
@@ -5181,8 +5181,8 @@ static INT build_reparse_buffer(const WCHAR *filename, REPARSE_DATA_BUFFER **pbu
static void test_reparse_points(void)
{
+ WCHAR path[MAX_PATH], reparse_path[MAX_PATH], target_path[MAX_PATH], volnameW[MAX_PATH];
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};
FILE_BASIC_INFORMATION old_attrib, new_attrib;
static const WCHAR fooW[] = {'f','o','o',0};
@@ -5211,7 +5211,12 @@ static void test_reparse_points(void)
pRtlDosPathNameToNtPathName_U(path, &nameW, NULL, NULL);
volW[0] = nameW.Buffer[4];
pRtlFreeUnicodeString( &nameW );
- GetVolumeInformationW(volW, 0, 0, 0, &dwLen, &dwFlags, 0, 0);
+ if (!GetVolumeNameForVolumeMountPointW(volW, volnameW, MAX_PATH))
+ {
+ win_skip("Failed to obtain volume name for current volume.\n");
+ return;
+ }
+ GetVolumeInformationW(volnameW, 0, 0, 0, &dwLen, &dwFlags, 0, 0);
if (!(dwFlags & FILE_SUPPORTS_REPARSE_POINTS))
{
skip("File system does not support reparse points.\n");
--
2.20.1

View File

@ -1,7 +1,7 @@
From 9f4c292ed890fa1f0f334878c3fac453b9370759 Mon Sep 17 00:00:00 2001
From 572dccf8ef60557faa7ccf3495940d22487de7c1 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: ntdll: Add support for absolute symlink creation.
Subject: [PATCH] ntdll: Add support for absolute symlink creation.
Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
---
@ -11,10 +11,10 @@ Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
3 files changed, 143 insertions(+), 19 deletions(-)
diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c
index a2fce93c6eb..94160c21971 100644
index 5882793c883..53a24574eec 100644
--- a/dlls/ntdll/tests/file.c
+++ b/dlls/ntdll/tests/file.c
@@ -5154,26 +5154,50 @@ static void test_mailslot_name(void)
@@ -5153,26 +5153,50 @@ static void test_mailslot_name(void)
CloseHandle( device );
}
@ -73,7 +73,7 @@ index a2fce93c6eb..94160c21971 100644
lstrcpyW(subst_dest, filename);
lstrcpyW(print_dest, &filename[prefix_len]);
*pbuffer = buffer;
@@ -5193,10 +5217,12 @@ static void test_reparse_points(void)
@@ -5192,10 +5216,12 @@ static void test_reparse_points(void)
REPARSE_DATA_BUFFER *buffer = NULL;
DWORD dwret, dwLen, dwFlags, err;
INT buffer_len, string_len;
@ -87,7 +87,7 @@ index a2fce93c6eb..94160c21971 100644
BOOL bret;
/* Create a temporary folder for the junction point tests */
@@ -5245,7 +5271,7 @@ static void test_reparse_points(void)
@@ -5247,7 +5273,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 a2fce93c6eb..94160c21971 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());
@@ -5286,7 +5312,7 @@ static void test_reparse_points(void)
@@ -5288,7 +5314,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 a2fce93c6eb..94160c21971 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);
@@ -5301,7 +5327,7 @@ static void test_reparse_points(void)
@@ -5303,7 +5329,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 a2fce93c6eb..94160c21971 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);
@@ -5314,14 +5340,73 @@ static void test_reparse_points(void)
@@ -5316,14 +5342,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 a2fce93c6eb..94160c21971 100644
}
diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c
index fe86f5a86b3..ce331ae9276 100644
index 28191fb9258..25b26d963ef 100644
--- a/dlls/ntdll/unix/file.c
+++ b/dlls/ntdll/unix/file.c
@@ -5800,18 +5800,34 @@ static void ignore_server_ioctl_struct_holes( ULONG code, const void *in_buffer,
@@ -5879,18 +5879,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,7 +234,7 @@ index fe86f5a86b3..ce331ae9276 100644
if ((status = server_get_unix_fd( handle, FILE_SPECIAL_ACCESS, &dest_fd, &needs_close, NULL, NULL )))
return status;
@@ -5846,6 +5862,18 @@ NTSTATUS FILE_CreateSymlink(HANDLE handle, REPARSE_DATA_BUFFER *buffer)
@@ -5925,6 +5941,18 @@ NTSTATUS FILE_CreateSymlink(HANDLE handle, REPARSE_DATA_BUFFER *buffer)
strcat( magic_dest, "." );
strcat( magic_dest, "/" );
}
@ -253,7 +253,7 @@ index fe86f5a86b3..ce331ae9276 100644
strcat( magic_dest, unix_dest );
/* Produce the link in a temporary location in the same folder */
@@ -6209,6 +6237,7 @@ NTSTATUS WINAPI NtFsControlFile( HANDLE handle, HANDLE event, PIO_APC_ROUTINE ap
@@ -6288,6 +6316,7 @@ NTSTATUS WINAPI NtFsControlFile( HANDLE handle, HANDLE event, PIO_APC_ROUTINE ap
switch(buffer->ReparseTag)
{
case IO_REPARSE_TAG_MOUNT_POINT:
@ -295,5 +295,5 @@ index 4539b89d583..ab3273d3f81 100644
typedef struct _REPARSE_GUID_DATA_BUFFER {
DWORD ReparseTag;
--
2.17.1
2.20.1

View File

@ -1,7 +1,7 @@
From d870b2916e62a79d12b63ed40da6ad20e0575b75 Mon Sep 17 00:00:00 2001
From f65a80d742f049407acfb3fb6bccf9e037fcbcf9 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: ntdll: Add support for reading absolute symlinks.
Subject: [PATCH] ntdll: Add support for reading absolute symlinks.
Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
---
@ -10,10 +10,10 @@ Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
2 files changed, 34 insertions(+), 1 deletion(-)
diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c
index 94160c21971..f3ddd397e8e 100644
index 53a24574eec..9a6f72cb783 100644
--- a/dlls/ntdll/tests/file.c
+++ b/dlls/ntdll/tests/file.c
@@ -5391,7 +5391,6 @@ static void test_reparse_points(void)
@@ -5393,7 +5393,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 94160c21971..f3ddd397e8e 100644
ok(bret, "Failed to create symlink! (0x%x)\n", GetLastError());
/* Check the file attributes of the symlink */
@@ -5399,6 +5398,18 @@ static void test_reparse_points(void)
@@ -5401,6 +5400,18 @@ 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);
@ -41,10 +41,10 @@ index 94160c21971..f3ddd397e8e 100644
/* Cleanup */
pRtlFreeUnicodeString(&nameW);
diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c
index ce331ae9276..0a10ec33ced 100644
index 25b26d963ef..c8b04601efa 100644
--- a/dlls/ntdll/unix/file.c
+++ b/dlls/ntdll/unix/file.c
@@ -5945,6 +5945,7 @@ NTSTATUS FILE_GetSymlink(HANDLE handle, REPARSE_DATA_BUFFER *buffer, ULONG out_s
@@ -6024,6 +6024,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 ce331ae9276..0a10ec33ced 100644
WCHAR *nt_dest;
INT prefix_len;
ssize_t ret;
@@ -5989,6 +5990,17 @@ NTSTATUS FILE_GetSymlink(HANDLE handle, REPARSE_DATA_BUFFER *buffer, ULONG out_s
@@ -6068,6 +6069,17 @@ NTSTATUS FILE_GetSymlink(HANDLE handle, REPARSE_DATA_BUFFER *buffer, ULONG out_s
}
buffer->ReparseTag |= (val << i);
}
@ -70,7 +70,7 @@ index ce331ae9276..0a10ec33ced 100644
unix_dest_len -= (p - unix_dest);
memmove(unix_dest, p, unix_dest_len);
unix_dest[unix_dest_len] = 0;
@@ -6022,6 +6034,16 @@ NTSTATUS FILE_GetSymlink(HANDLE handle, REPARSE_DATA_BUFFER *buffer, ULONG out_s
@@ -6101,6 +6113,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;
@ -88,5 +88,5 @@ index ce331ae9276..0a10ec33ced 100644
/* unrecognized (regular) files should probably be treated as symlinks */
WARN("unrecognized symbolic link\n");
--
2.17.1
2.20.1

View File

@ -1,7 +1,7 @@
From 0dd3826e5cffa8e8f2841e4b4bc2e5739603cbcf Mon Sep 17 00:00:00 2001
From 1916474827593c822e41141d6e928001b408ee92 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: ntdll: Add support for deleting symlinks.
Subject: [PATCH] ntdll: Add support for deleting symlinks.
Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
---
@ -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 f3ddd397e8e..073759fcfb9 100644
index 9a6f72cb783..dd21083ebbb 100644
--- a/dlls/ntdll/tests/file.c
+++ b/dlls/ntdll/tests/file.c
@@ -5408,6 +5408,22 @@ static void test_reparse_points(void)
@@ -5410,6 +5410,22 @@ static void test_reparse_points(void)
ok(bret, "Failed to read symlink!\n");
ok((memcmp(dest, nameW.Buffer, string_len) == 0), "Symlink destination does not match ('%s' != '%s')!\n",
wine_dbgstr_w(dest), wine_dbgstr_w(nameW.Buffer));
@ -37,10 +37,10 @@ index f3ddd397e8e..073759fcfb9 100644
cleanup:
diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c
index 0a10ec33ced..3438c064f22 100644
index c8b04601efa..af01a1646c5 100644
--- a/dlls/ntdll/unix/file.c
+++ b/dlls/ntdll/unix/file.c
@@ -6237,6 +6237,7 @@ NTSTATUS WINAPI NtFsControlFile( HANDLE handle, HANDLE event, PIO_APC_ROUTINE ap
@@ -6316,6 +6316,7 @@ NTSTATUS WINAPI NtFsControlFile( HANDLE handle, HANDLE event, PIO_APC_ROUTINE ap
switch(buffer->ReparseTag)
{
case IO_REPARSE_TAG_MOUNT_POINT:
@ -49,5 +49,5 @@ index 0a10ec33ced..3438c064f22 100644
break;
default:
--
2.17.1
2.20.1

View File

@ -1,7 +1,7 @@
From 82bb8a8de84b36c610c10a489629f1526998e780 Mon Sep 17 00:00:00 2001
From 0fe1cf1db4e5115170a225596688b12bed103fe2 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: ntdll: Add support for relative symlink creation.
Subject: [PATCH] ntdll: Add support for relative symlink creation.
Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
---
@ -11,10 +11,10 @@ Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
3 files changed, 111 insertions(+), 13 deletions(-)
diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c
index 073759fcfb9..e2dae32ca18 100644
index dd21083ebbb..8ed749cfe33 100644
--- a/dlls/ntdll/tests/file.c
+++ b/dlls/ntdll/tests/file.c
@@ -5154,7 +5154,8 @@ static void test_mailslot_name(void)
@@ -5153,7 +5153,8 @@ static void test_mailslot_name(void)
CloseHandle( device );
}
@ -24,7 +24,7 @@ index 073759fcfb9..e2dae32ca18 100644
{
static INT header_size = offsetof(REPARSE_DATA_BUFFER, GenericReparseBuffer);
INT buffer_size, struct_size, data_size, string_len, prefix_len;
@@ -5172,7 +5173,7 @@ static INT build_reparse_buffer(const WCHAR *filename, ULONG tag, REPARSE_DATA_B
@@ -5171,7 +5172,7 @@ static INT build_reparse_buffer(const WCHAR *filename, ULONG tag, REPARSE_DATA_B
default:
return 0;
}
@ -33,7 +33,7 @@ index 073759fcfb9..e2dae32ca18 100644
string_len = lstrlenW(&filename[prefix_len]);
data_size = (prefix_len + 2 * string_len + 2) * sizeof(WCHAR);
buffer_size = struct_size + data_size;
@@ -5192,6 +5193,7 @@ static INT build_reparse_buffer(const WCHAR *filename, ULONG tag, REPARSE_DATA_B
@@ -5191,6 +5192,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 +41,7 @@ index 073759fcfb9..e2dae32ca18 100644
subst_dest = &buffer->SymbolicLinkReparseBuffer.PathBuffer[0];
print_dest = &buffer->SymbolicLinkReparseBuffer.PathBuffer[prefix_len + string_len + 1];
break;
@@ -5271,7 +5273,7 @@ static void test_reparse_points(void)
@@ -5273,7 +5275,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 +50,7 @@ index 073759fcfb9..e2dae32ca18 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());
@@ -5312,7 +5314,7 @@ static void test_reparse_points(void)
@@ -5314,7 +5316,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 +59,7 @@ index 073759fcfb9..e2dae32ca18 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);
@@ -5327,7 +5329,7 @@ static void test_reparse_points(void)
@@ -5329,7 +5331,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 +68,7 @@ index 073759fcfb9..e2dae32ca18 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);
@@ -5389,7 +5391,7 @@ static void test_reparse_points(void)
@@ -5391,7 +5393,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 +77,7 @@ index 073759fcfb9..e2dae32ca18 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());
@@ -5426,6 +5428,22 @@ static void test_reparse_points(void)
@@ -5428,6 +5430,22 @@ static void test_reparse_points(void)
"Symlink folder's access time does not match.\n");
CloseHandle(handle);
@ -101,10 +101,10 @@ index 073759fcfb9..e2dae32ca18 100644
/* Cleanup */
pRtlFreeUnicodeString(&nameW);
diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c
index 3438c064f22..1b3c019a929 100644
index af01a1646c5..28862eff52e 100644
--- a/dlls/ntdll/unix/file.c
+++ b/dlls/ntdll/unix/file.c
@@ -5799,17 +5799,20 @@ static void ignore_server_ioctl_struct_holes( ULONG code, const void *in_buffer,
@@ -5878,17 +5878,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 3438c064f22..1b3c019a929 100644
int i;
switch(buffer->ReparseTag)
@@ -5818,11 +5821,13 @@ NTSTATUS FILE_CreateSymlink(HANDLE handle, REPARSE_DATA_BUFFER *buffer)
@@ -5897,11 +5900,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 3438c064f22..1b3c019a929 100644
break;
default:
return STATUS_NOT_IMPLEMENTED;
@@ -5834,8 +5839,66 @@ NTSTATUS FILE_CreateSymlink(HANDLE handle, REPARSE_DATA_BUFFER *buffer)
@@ -5913,8 +5918,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 3438c064f22..1b3c019a929 100644
for (;;)
{
unix_dest = malloc( unix_dest_len );
@@ -5851,11 +5914,24 @@ NTSTATUS FILE_CreateSymlink(HANDLE handle, REPARSE_DATA_BUFFER *buffer)
@@ -5930,11 +5993,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 3438c064f22..1b3c019a929 100644
for (i = 0; i < sizeof(ULONG)*8; i++)
{
if ((buffer->ReparseTag >> i) & 1)
@@ -5874,7 +5950,7 @@ NTSTATUS FILE_CreateSymlink(HANDLE handle, REPARSE_DATA_BUFFER *buffer)
@@ -5953,7 +6029,7 @@ NTSTATUS FILE_CreateSymlink(HANDLE handle, REPARSE_DATA_BUFFER *buffer)
strcat( magic_dest, "." );
strcat( magic_dest, "/" );
}
@ -246,7 +246,7 @@ index 3438c064f22..1b3c019a929 100644
/* Produce the link in a temporary location in the same folder */
strcpy( tmpdir, unix_src );
@@ -5924,7 +6000,9 @@ NTSTATUS FILE_CreateSymlink(HANDLE handle, REPARSE_DATA_BUFFER *buffer)
@@ -6003,7 +6079,9 @@ NTSTATUS FILE_CreateSymlink(HANDLE handle, REPARSE_DATA_BUFFER *buffer)
cleanup:
if (tempdir_created) rmdir( tmpdir );
@ -268,5 +268,5 @@ index ab3273d3f81..0d02225bc4f 100644
+
#endif /* __WINE_NTIFS_H */
--
2.17.1
2.20.1

View File

@ -1,7 +1,7 @@
From d96043bc45facf3fd26a69f6338968f9fdb96be7 Mon Sep 17 00:00:00 2001
From dccfec5e07225d3be4ff653d294a4d49a3663c34 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: ntdll: Add support for reading relative symlinks.
Subject: [PATCH] ntdll: Add support for reading relative symlinks.
Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
---
@ -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 e2dae32ca18..cd207497b24 100644
index 8ed749cfe33..bdc1a151b45 100644
--- a/dlls/ntdll/tests/file.c
+++ b/dlls/ntdll/tests/file.c
@@ -5441,9 +5441,22 @@ static void test_reparse_points(void)
@@ -5443,9 +5443,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, 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 e2dae32ca18..cd207497b24 100644
/* Cleanup */
pRtlFreeUnicodeString(&nameW);
diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c
index 1b3c019a929..920d21af5bd 100644
index 28862eff52e..1554d19cc01 100644
--- a/dlls/ntdll/unix/file.c
+++ b/dlls/ntdll/unix/file.c
@@ -6046,6 +6046,11 @@ NTSTATUS FILE_GetSymlink(HANDLE handle, REPARSE_DATA_BUFFER *buffer, ULONG out_s
@@ -6125,6 +6125,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 1b3c019a929..920d21af5bd 100644
if (*p++ != '/')
{
status = STATUS_NOT_IMPLEMENTED;
@@ -6083,24 +6088,47 @@ NTSTATUS FILE_GetSymlink(HANDLE handle, REPARSE_DATA_BUFFER *buffer, ULONG out_s
@@ -6162,24 +6167,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;
@ -107,5 +107,5 @@ index 1b3c019a929..920d21af5bd 100644
{
case IO_REPARSE_TAG_MOUNT_POINT:
--
2.17.1
2.20.1

View File

@ -1,7 +1,7 @@
From 08ace54e7f14c7f5482da2ed0a086a6e79a37eb9 Mon Sep 17 00:00:00 2001
From faa53ece23717100c6d2ae407e8871576c3bb3f6 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: ntdll: Add support for file symlinks.
Subject: [PATCH] ntdll: Add support for file symlinks.
Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
---
@ -10,10 +10,10 @@ Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
2 files changed, 51 insertions(+), 5 deletions(-)
diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c
index cd207497b24..8d61257e1e5 100644
index bdc1a151b45..8938c5bf50c 100644
--- a/dlls/ntdll/tests/file.c
+++ b/dlls/ntdll/tests/file.c
@@ -5374,6 +5374,35 @@ static void test_reparse_points(void)
@@ -5376,6 +5376,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 cd207497b24..8d61257e1e5 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 920d21af5bd..410b3b4eee7 100644
index 1554d19cc01..d7b65399e64 100644
--- a/dlls/ntdll/unix/file.c
+++ b/dlls/ntdll/unix/file.c
@@ -5809,6 +5809,7 @@ NTSTATUS FILE_CreateSymlink(HANDLE handle, REPARSE_DATA_BUFFER *buffer)
@@ -5888,6 +5888,7 @@ NTSTATUS FILE_CreateSymlink(HANDLE handle, REPARSE_DATA_BUFFER *buffer)
int relative_offset = 0;
UNICODE_STRING nt_dest;
int dest_len, offset;
@ -61,7 +61,7 @@ index 920d21af5bd..410b3b4eee7 100644
NTSTATUS status;
struct stat st;
WCHAR *dest;
@@ -5946,7 +5947,8 @@ NTSTATUS FILE_CreateSymlink(HANDLE handle, REPARSE_DATA_BUFFER *buffer)
@@ -6025,7 +6026,8 @@ NTSTATUS FILE_CreateSymlink(HANDLE handle, REPARSE_DATA_BUFFER *buffer)
status = errno_to_status( errno );
goto cleanup;
}
@ -71,7 +71,7 @@ index 920d21af5bd..410b3b4eee7 100644
strcat( magic_dest, "." );
strcat( magic_dest, "/" );
}
@@ -5973,8 +5975,11 @@ NTSTATUS FILE_CreateSymlink(HANDLE handle, REPARSE_DATA_BUFFER *buffer)
@@ -6052,8 +6054,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 +85,7 @@ index 920d21af5bd..410b3b4eee7 100644
}
else if (errno == ENOSYS)
{
@@ -6182,6 +6187,7 @@ NTSTATUS FILE_RemoveSymlink(HANDLE handle, REPARSE_GUID_DATA_BUFFER *buffer)
@@ -6261,6 +6266,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 +93,7 @@ index 920d21af5bd..410b3b4eee7 100644
NTSTATUS status;
char *unix_name;
struct stat st;
@@ -6194,12 +6200,13 @@ NTSTATUS FILE_RemoveSymlink(HANDLE handle, REPARSE_GUID_DATA_BUFFER *buffer)
@@ -6273,12 +6279,13 @@ NTSTATUS FILE_RemoveSymlink(HANDLE handle, REPARSE_GUID_DATA_BUFFER *buffer)
TRACE( "Deleting symlink %s\n", unix_name );
@ -108,7 +108,7 @@ index 920d21af5bd..410b3b4eee7 100644
strcpy( tmpdir, unix_name );
d = dirname( tmpdir);
if (d != tmpdir) strcpy( tmpdir, d );
@@ -6212,11 +6219,21 @@ NTSTATUS FILE_RemoveSymlink(HANDLE handle, REPARSE_GUID_DATA_BUFFER *buffer)
@@ -6291,11 +6298,21 @@ NTSTATUS FILE_RemoveSymlink(HANDLE handle, REPARSE_GUID_DATA_BUFFER *buffer)
tempdir_created = TRUE;
strcpy( tmpfile, tmpdir );
strcat( tmpfile, "/tmpfile" );
@ -132,5 +132,5 @@ index 920d21af5bd..410b3b4eee7 100644
lchown( tmpfile, st.st_uid, st.st_gid );
/* Atomically move the directory into position */
--
2.17.1
2.20.1

View File

@ -1,8 +1,8 @@
From 7079e4f8ad185776771f4cc65ebbfb28d4e04c06 Mon Sep 17 00:00:00 2001
From 7a18980361dcbf958d1f5b1c614758283bc1e1cc 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>
---
@ -11,10 +11,10 @@ Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
2 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c
index 410b3b4eee7..7c553e9cfb1 100644
index d7b65399e64..d08f6813d28 100644
--- a/dlls/ntdll/unix/file.c
+++ b/dlls/ntdll/unix/file.c
@@ -3355,6 +3355,19 @@ static NTSTATUS lookup_unix_name( const WCHAR *name, int name_len, char **buffer
@@ -3432,6 +3432,19 @@ static NTSTATUS lookup_unix_name( const WCHAR *name, int name_len, char **buffer
status = STATUS_OBJECT_NAME_COLLISION;
}
}
@ -34,7 +34,7 @@ index 410b3b4eee7..7c553e9cfb1 100644
if (status != STATUS_SUCCESS) break;
@@ -5908,7 +5921,7 @@ NTSTATUS FILE_CreateSymlink(HANDLE handle, REPARSE_DATA_BUFFER *buffer)
@@ -5987,7 +6000,7 @@ NTSTATUS FILE_CreateSymlink(HANDLE handle, REPARSE_DATA_BUFFER *buffer)
status = STATUS_NO_MEMORY;
goto cleanup;
}
@ -44,10 +44,10 @@ index 410b3b4eee7..7c553e9cfb1 100644
free( unix_dest );
}
diff --git a/include/winternl.h b/include/winternl.h
index a89958cf2ab..68fef97087f 100644
index f0ab223ef2e..b804436ee98 100644
--- a/include/winternl.h
+++ b/include/winternl.h
@@ -2251,6 +2251,7 @@ typedef struct _RTL_HANDLE_TABLE
@@ -2268,6 +2268,7 @@ typedef struct _RTL_ATOM_TABLE
#define FILE_OVERWRITE 4
#define FILE_OVERWRITE_IF 5
#define FILE_MAXIMUM_DISPOSITION 5
@ -56,5 +56,5 @@ index a89958cf2ab..68fef97087f 100644
/* Characteristics of a File System */
#define FILE_REMOVABLE_MEDIA 0x00000001
--
2.17.1
2.20.1

View File

@ -1,7 +1,7 @@
From 00f71402f0ff5f3e857206c70165bba461c18d0a Mon Sep 17 00:00:00 2001
From e7429fc51d2bf337cccf3016e923ebea0326e2fd 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: ntdll: Correctly report file symbolic links as files.
Subject: [PATCH] ntdll: Correctly report file symbolic links as files.
Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
---
@ -9,10 +9,10 @@ Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
1 file changed, 76 insertions(+), 37 deletions(-)
diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c
index 7c553e9cfb1..8d42008a596 100644
index d08f6813d28..a992c66504a 100644
--- a/dlls/ntdll/unix/file.c
+++ b/dlls/ntdll/unix/file.c
@@ -1613,6 +1613,9 @@ static inline int get_file_xattr( char *hexattr, int attrlen )
@@ -1612,6 +1612,9 @@ static inline int get_file_xattr( char *hexattr, int attrlen )
return 0;
}
@ -22,7 +22,7 @@ index 7c553e9cfb1..8d42008a596 100644
/* fetch the attributes of a file */
static inline ULONG get_file_attributes( const struct stat *st )
{
@@ -1697,10 +1700,15 @@ static int get_file_info( const char *path, struct stat *st, ULONG *attr )
@@ -1696,10 +1699,15 @@ static int get_file_info( const char *path, struct stat *st, ULONG *attr )
if (ret == -1) return ret;
if (S_ISLNK( st->st_mode ))
{
@ -42,7 +42,7 @@ index 7c553e9cfb1..8d42008a596 100644
}
else if (S_ISDIR( st->st_mode ) && (parent_path = malloc( strlen(path) + 4 )))
{
@@ -6027,46 +6035,34 @@ cleanup:
@@ -6106,46 +6114,34 @@ cleanup:
}
@ -104,7 +104,7 @@ index 7c553e9cfb1..8d42008a596 100644
p++;
}
if (*p++ != '/')
@@ -6074,7 +6070,7 @@ NTSTATUS FILE_GetSymlink(HANDLE handle, REPARSE_DATA_BUFFER *buffer, ULONG out_s
@@ -6153,7 +6149,7 @@ NTSTATUS FILE_GetSymlink(HANDLE handle, REPARSE_DATA_BUFFER *buffer, ULONG out_s
status = STATUS_NOT_IMPLEMENTED;
goto cleanup;
}
@ -113,7 +113,7 @@ index 7c553e9cfb1..8d42008a596 100644
for (i = 0; i < sizeof(ULONG)*8; i++)
{
char c = *p++;
@@ -6089,21 +6085,64 @@ NTSTATUS FILE_GetSymlink(HANDLE handle, REPARSE_DATA_BUFFER *buffer, ULONG out_s
@@ -6168,21 +6164,64 @@ NTSTATUS FILE_GetSymlink(HANDLE handle, REPARSE_DATA_BUFFER *buffer, ULONG out_s
status = STATUS_NOT_IMPLEMENTED;
goto cleanup;
}
@ -184,5 +184,5 @@ index 7c553e9cfb1..8d42008a596 100644
/* convert the relative path into an absolute path */
--
2.17.1
2.20.1

View File

@ -1,15 +1,15 @@
From 15b9e40cc1ac1f96ca526d4954cd15a3bf543b5a Mon Sep 17 00:00:00 2001
From 6d623ff7c29b1913b89681993a2dd63627312928 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: kernelbase: Convert FILE_FLAG_OPEN_REPARSE_POINT for passing to
ntdll.
Subject: [PATCH] kernelbase: Convert FILE_FLAG_OPEN_REPARSE_POINT for passing
to ntdll.
---
dlls/kernelbase/file.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/dlls/kernelbase/file.c b/dlls/kernelbase/file.c
index 7b122e263b0..b06f003274f 100644
index abfdade04ed..ad3c002d8c6 100644
--- a/dlls/kernelbase/file.c
+++ b/dlls/kernelbase/file.c
@@ -723,6 +723,8 @@ static UINT get_nt_file_options( DWORD attributes )
@ -22,5 +22,5 @@ index 7b122e263b0..b06f003274f 100644
}
--
2.17.1
2.20.1

View File

@ -1,14 +1,55 @@
From 922266311e073e79403da082400814c5d68498ce Mon Sep 17 00:00:00 2001
From e95940380071fe812b54e5d92078d92993b8c21d 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: server: Implement FILE_OPEN_REPARSE_POINT option.
Subject: [PATCH] server: Implement FILE_OPEN_REPARSE_POINT option.
---
server/fd.c | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
dlls/ntdll/tests/file.c | 8 ++++----
server/fd.c | 18 +++++++++++++++++-
2 files changed, 21 insertions(+), 5 deletions(-)
diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c
index 8938c5bf50c..59f10ea8cce 100644
--- a/dlls/ntdll/tests/file.c
+++ b/dlls/ntdll/tests/file.c
@@ -5299,7 +5299,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);
- ok(dwret == STATUS_SUCCESS, "Failed to set junction point folder's attributes (0x%x).\n", dwret);
+ todo_wine ok(dwret == STATUS_SUCCESS, "Failed to set junction point folder's attributes (0x%x).\n", dwret);
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,
@@ -5308,7 +5308,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);
- ok(old_attrib.LastAccessTime.QuadPart == new_attrib.LastAccessTime.QuadPart,
+ todo_wine ok(old_attrib.LastAccessTime.QuadPart == new_attrib.LastAccessTime.QuadPart,
"Junction point folder's access time does not match.\n");
CloseHandle(handle);
@@ -5446,7 +5446,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);
- ok(dwret == STATUS_SUCCESS, "Failed to set symlink folder's attributes (0x%x).\n", dwret);
+ todo_wine ok(dwret == STATUS_SUCCESS, "Failed to set symlink folder's attributes (0x%x).\n", dwret);
memset(&guid_buffer, 0x00, sizeof(guid_buffer));
guid_buffer.ReparseTag = IO_REPARSE_TAG_SYMLINK;
bret = DeviceIoControl(handle, FSCTL_DELETE_REPARSE_POINT, (LPVOID)&guid_buffer,
@@ -5455,7 +5455,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);
- ok(old_attrib.LastAccessTime.QuadPart == new_attrib.LastAccessTime.QuadPart,
+ todo_wine ok(old_attrib.LastAccessTime.QuadPart == new_attrib.LastAccessTime.QuadPart,
"Symlink folder's access time does not match.\n");
CloseHandle(handle);
diff --git a/server/fd.c b/server/fd.c
index 622b3c246aa..d6cd4733d5d 100644
index 4f43f41fb31..a01d4c9c0f7 100644
--- a/server/fd.c
+++ b/server/fd.c
@@ -107,6 +107,10 @@
@ -22,7 +63,7 @@ index 622b3c246aa..d6cd4733d5d 100644
#if defined(HAVE_SYS_EPOLL_H) && defined(HAVE_EPOLL_CREATE)
# include <sys/epoll.h>
# define USE_EPOLL
@@ -1904,6 +1908,11 @@ struct fd *open_fd( struct fd *root, const char *name, int flags, mode_t *mode,
@@ -1958,6 +1962,11 @@ struct fd *open_fd( struct fd *root, const char *name, struct unicode_str nt_nam
}
else rw_mode = O_RDONLY;
@ -34,7 +75,7 @@ index 622b3c246aa..d6cd4733d5d 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 */
@@ -2385,6 +2394,7 @@ static struct fd *get_handle_fd_obj( struct process *process, obj_handle_t handl
@@ -2431,6 +2440,7 @@ static struct fd *get_handle_fd_obj( struct process *process, obj_handle_t handl
static int is_dir_empty( int fd )
{
@ -42,7 +83,7 @@ index 622b3c246aa..d6cd4733d5d 100644
DIR *dir;
int empty;
struct dirent *de;
@@ -2392,8 +2402,13 @@ static int is_dir_empty( int fd )
@@ -2438,8 +2448,13 @@ static int is_dir_empty( int fd )
if ((fd = dup( fd )) == -1)
return -1;
@ -57,7 +98,7 @@ index 622b3c246aa..d6cd4733d5d 100644
close( fd );
return -1;
}
@@ -2405,6 +2420,7 @@ static int is_dir_empty( int fd )
@@ -2451,6 +2466,7 @@ static int is_dir_empty( int fd )
empty = 0;
}
closedir( dir );
@ -66,5 +107,5 @@ index 622b3c246aa..d6cd4733d5d 100644
}
--
2.17.1
2.20.1

View File

@ -1,15 +1,17 @@
From 07a914c25e72ddb67226b5099c4fda9dc9f77f22 Mon Sep 17 00:00:00 2001
From ecba21139cff9cf2ec15377252b7c7f4b8ee217e 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: ntdll: Allow set_file_times_precise to work on reparse points.
Subject: [PATCH] ntdll: Allow set_file_times_precise to work on reparse
points.
---
configure.ac | 3 ++-
dlls/ntdll/unix/file.c | 22 ++++++++++++++++++----
2 files changed, 20 insertions(+), 5 deletions(-)
configure.ac | 3 ++-
dlls/ntdll/tests/file.c | 8 ++++----
dlls/ntdll/unix/file.c | 22 ++++++++++++++++++----
3 files changed, 24 insertions(+), 9 deletions(-)
diff --git a/configure.ac b/configure.ac
index a944591343d..efb4035295a 100644
index 26af8a0a4b7..ea5d767ab9a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2224,7 +2224,8 @@ AC_CHECK_FUNCS(\
@ -22,11 +24,51 @@ index a944591343d..efb4035295a 100644
)
CFLAGS="$ac_save_CFLAGS"
diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c
index 59f10ea8cce..8938c5bf50c 100644
--- a/dlls/ntdll/tests/file.c
+++ b/dlls/ntdll/tests/file.c
@@ -5299,7 +5299,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);
- todo_wine ok(dwret == STATUS_SUCCESS, "Failed to set junction point folder's attributes (0x%x).\n", dwret);
+ ok(dwret == STATUS_SUCCESS, "Failed to set junction point folder's attributes (0x%x).\n", dwret);
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,
@@ -5308,7 +5308,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);
- todo_wine ok(old_attrib.LastAccessTime.QuadPart == new_attrib.LastAccessTime.QuadPart,
+ ok(old_attrib.LastAccessTime.QuadPart == new_attrib.LastAccessTime.QuadPart,
"Junction point folder's access time does not match.\n");
CloseHandle(handle);
@@ -5446,7 +5446,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);
- todo_wine ok(dwret == STATUS_SUCCESS, "Failed to set symlink folder's attributes (0x%x).\n", dwret);
+ ok(dwret == STATUS_SUCCESS, "Failed to set symlink folder's attributes (0x%x).\n", dwret);
memset(&guid_buffer, 0x00, sizeof(guid_buffer));
guid_buffer.ReparseTag = IO_REPARSE_TAG_SYMLINK;
bret = DeviceIoControl(handle, FSCTL_DELETE_REPARSE_POINT, (LPVOID)&guid_buffer,
@@ -5455,7 +5455,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);
- todo_wine ok(old_attrib.LastAccessTime.QuadPart == new_attrib.LastAccessTime.QuadPart,
+ ok(old_attrib.LastAccessTime.QuadPart == new_attrib.LastAccessTime.QuadPart,
"Symlink folder's access time does not match.\n");
CloseHandle(handle);
diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c
index 8d42008a596..5375b94e02a 100644
index a992c66504a..4355f1ac473 100644
--- a/dlls/ntdll/unix/file.c
+++ b/dlls/ntdll/unix/file.c
@@ -1738,6 +1738,14 @@ static int get_file_info( const char *path, struct stat *st, ULONG *attr )
@@ -1737,6 +1737,14 @@ static int get_file_info( const char *path, struct stat *st, ULONG *attr )
}
@ -41,7 +83,7 @@ index 8d42008a596..5375b94e02a 100644
#if defined(__ANDROID__) && !defined(HAVE_FUTIMENS)
static int futimens( int fd, const struct timespec spec[2] )
{
@@ -1753,7 +1761,7 @@ static int futimens( int fd, const struct timespec spec[2] )
@@ -1752,7 +1760,7 @@ static int futimens( int fd, const struct timespec spec[2] )
static BOOL set_file_times_precise( int fd, const LARGE_INTEGER *mtime,
const LARGE_INTEGER *atime, NTSTATUS *status )
{
@ -50,7 +92,7 @@ index 8d42008a596..5375b94e02a 100644
struct timespec tv[2];
tv[0].tv_sec = tv[1].tv_sec = 0;
@@ -1769,10 +1777,16 @@ static BOOL set_file_times_precise( int fd, const LARGE_INTEGER *mtime,
@@ -1768,10 +1776,16 @@ static BOOL set_file_times_precise( int fd, const LARGE_INTEGER *mtime,
tv[1].tv_nsec = (mtime->QuadPart % 10000000) * 100;
}
#ifdef __APPLE__
@ -71,5 +113,5 @@ index 8d42008a596..5375b94e02a 100644
#else
return FALSE;
--
2.17.1
2.20.1

View File

@ -1,4 +1,4 @@
From c4916e098d2aefe4f078bc9c396015e15d6ed9d4 Mon Sep 17 00:00:00 2001
From a7d722fea77ebfea46c9ad70a8e452251c1b2ca6 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 e6c6807e0b2..0c7c5a1bf57 100644
index 8938c5bf50c..c5c186748b6 100644
--- a/dlls/ntdll/tests/file.c
+++ b/dlls/ntdll/tests/file.c
@@ -5386,18 +5386,18 @@ static void test_reparse_points(void)
@@ -5391,18 +5391,18 @@ static void test_reparse_points(void)
/* Check deleting a file symlink as if it were a directory */
bret = RemoveDirectoryW(reparse_path);
@ -39,7 +39,7 @@ index e6c6807e0b2..0c7c5a1bf57 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 fe662ce6bb5..8613769c1bf 100644
index a01d4c9c0f7..c4de093b40b 100644
--- a/server/fd.c
+++ b/server/fd.c
@@ -1902,6 +1902,55 @@ void get_nt_name( struct fd *fd, struct unicode_str *name )

View File

@ -1,17 +1,17 @@
From d41ad5ae59d2d74b2252f4860dd076717bf27e3b Mon Sep 17 00:00:00 2001
From cd8b189a3be04bcda04481f790be20d624eaaf02 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: server: Properly handle deleting dangling symlinks.
Subject: [PATCH] server: Properly handle deleting dangling symlinks.
---
server/fd.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/server/fd.c b/server/fd.c
index 0d8eece7bcb..78b1ae97f03 100644
index c4de093b40b..da5bee3e5ec 100644
--- a/server/fd.c
+++ b/server/fd.c
@@ -1983,6 +1983,7 @@ struct fd *open_fd( struct fd *root, const char *name, int flags, mode_t *mode,
@@ -2038,6 +2038,7 @@ struct fd *open_fd( struct fd *root, const char *name, struct unicode_str nt_nam
{
fd->unlink_name = path;
fd->unix_name = realpath( path, NULL );
@ -19,7 +19,7 @@ index 0d8eece7bcb..78b1ae97f03 100644
}
closed_fd->unix_fd = fd->unix_fd;
@@ -2495,7 +2496,7 @@ static void set_fd_disposition( struct fd *fd, int unlink )
@@ -2548,7 +2549,7 @@ static void set_fd_disposition( struct fd *fd, int unlink )
file_set_error();
return;
}
@ -29,5 +29,5 @@ index 0d8eece7bcb..78b1ae97f03 100644
if (!(st.st_mode & (S_IWUSR | S_IWGRP | S_IWOTH)))
{
--
2.17.1
2.20.1

View File

@ -1,14 +1,15 @@
From a7ccf5e390aa34567b4e2ce2f1dd5681e8f4724e Mon Sep 17 00:00:00 2001
From b43f01caa40215a41a135995adaebbde2bc619a1 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: kernelbase: Use FILE_OPEN_REPARSE_POINT in RemoveDirectory[A|W].
Subject: [PATCH] kernelbase: Use FILE_OPEN_REPARSE_POINT in
RemoveDirectory[A|W].
---
dlls/kernelbase/file.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/kernelbase/file.c b/dlls/kernelbase/file.c
index b06f003274f..712c4ab4170 100644
index ad3c002d8c6..375c00c7367 100644
--- a/dlls/kernelbase/file.c
+++ b/dlls/kernelbase/file.c
@@ -3482,7 +3482,7 @@ BOOL WINAPI DECLSPEC_HOTPATCH RemoveDirectoryW( LPCWSTR path )
@ -21,5 +22,5 @@ index b06f003274f..712c4ab4170 100644
if (!status)
--
2.17.1
2.20.1

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