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

View File

@ -1,7 +1,7 @@
From 41b736c18690d4cc1c7fcff0d45f29a2b5ce0889 Mon Sep 17 00:00:00 2001
From 5aa006dcd294a7cff1c9cc9572f906280cd7ffb5 Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
Date: Wed, 1 May 2019 12:06:20 -0600
Subject: ntdll: Always report symbolic links as containing zero bytes.
Subject: [PATCH] ntdll: Always report symbolic links as containing zero bytes.
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, 46 insertions(+), 2 deletions(-)
diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c
index b9d9c817eaa..994bfb23a5e 100644
index c5c186748b6..fb168549641 100644
--- a/dlls/ntdll/tests/file.c
+++ b/dlls/ntdll/tests/file.c
@@ -5218,7 +5218,9 @@ static void test_reparse_points(void)
@@ -5217,7 +5217,9 @@ static void test_reparse_points(void)
static const WCHAR dotW[] = {'.',0};
REPARSE_DATA_BUFFER *buffer = NULL;
DWORD dwret, dwLen, dwFlags, err;
@ -23,7 +23,7 @@ index b9d9c817eaa..994bfb23a5e 100644
HANDLE handle, token;
IO_STATUS_BLOCK iosb;
UNICODE_STRING nameW;
@@ -5348,8 +5350,6 @@ static void test_reparse_points(void)
@@ -5350,8 +5352,6 @@ static void test_reparse_points(void)
"Unexpected junction point attributes (0x%x != 0x410)!\n", dwret);
bret = RemoveDirectoryW(target_path);
ok(bret, "Failed to delete junction point target!\n");
@ -32,7 +32,7 @@ index b9d9c817eaa..994bfb23a5e 100644
/* Establish permissions for symlink creation */
bret = OpenProcessToken(GetCurrentProcess(), TOKEN_ALL_ACCESS, &token);
@@ -5374,6 +5374,13 @@ static void test_reparse_points(void)
@@ -5376,6 +5376,13 @@ 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");
@ -46,7 +46,7 @@ index b9d9c817eaa..994bfb23a5e 100644
/* Create the file symlink */
HeapFree(GetProcessHeap(), 0, buffer);
@@ -5387,6 +5394,37 @@ static void test_reparse_points(void)
@@ -5389,6 +5396,37 @@ static void test_reparse_points(void)
ok(bret, "Failed to create symlink! (0x%x)\n", GetLastError());
CloseHandle(handle);
@ -84,7 +84,7 @@ index b9d9c817eaa..994bfb23a5e 100644
/* Check deleting a file symlink as if it were a directory */
bret = RemoveDirectoryW(reparse_path);
ok(!bret, "Succeeded in deleting file symlink as a directory!\n");
@@ -5408,6 +5446,10 @@ static void test_reparse_points(void)
@@ -5410,6 +5448,10 @@ static void test_reparse_points(void)
dwret = GetFileAttributesW(reparse_path);
ok(dwret != (DWORD)~0, "Path doesn't exist (attributes: 0x%x)!\n", dwret);
ok(!(dwret & FILE_ATTRIBUTE_REPARSE_POINT), "File is already a reparse point! (attributes: %d)\n", dwret);
@ -96,10 +96,10 @@ index b9d9c817eaa..994bfb23a5e 100644
/* Create the directory symlink */
HeapFree(GetProcessHeap(), 0, buffer);
diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c
index 5375b94e02a..0a6f615c702 100644
index 4355f1ac473..1775ec24fe5 100644
--- a/dlls/ntdll/unix/file.c
+++ b/dlls/ntdll/unix/file.c
@@ -1704,6 +1704,8 @@ static int get_file_info( const char *path, struct stat *st, ULONG *attr )
@@ -1703,6 +1703,8 @@ static int get_file_info( const char *path, struct stat *st, ULONG *attr )
/* return information about the destination (unless this is a dangling symlink) */
stat( path, st );
@ -109,5 +109,5 @@ index 5375b94e02a..0a6f615c702 100644
*attr |= FILE_ATTRIBUTE_REPARSE_POINT;
/* whether a reparse point is a file or a directory is stored inside the link target */
--
2.17.1
2.20.1

View File

@ -1,7 +1,7 @@
From ef84cfc973142a9cd754091ffa6a196220909a8f Mon Sep 17 00:00:00 2001
From b4aee2ec695bb6de8798f9bb824ff9d816111654 Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
Date: Wed, 1 May 2019 17:48:51 -0600
Subject: ntdll: Find dangling symlinks quickly.
Subject: [PATCH] ntdll: Find dangling symlinks quickly.
This is also necessary on systems (such as MacOS) that support
case-insensitive lookups of files.
@ -12,10 +12,10 @@ Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c
index 0a6f615c702..746e01e91a0 100644
index 1775ec24fe5..712b0196f05 100644
--- a/dlls/ntdll/unix/file.c
+++ b/dlls/ntdll/unix/file.c
@@ -2717,7 +2717,7 @@ static NTSTATUS find_file_in_dir( char *unix_name, int pos, const WCHAR *name, i
@@ -2716,7 +2716,7 @@ static NTSTATUS find_file_in_dir( char *unix_name, int pos, const WCHAR *name, i
if (ret >= 0 && ret <= MAX_DIR_ENTRY_LEN)
{
unix_name[pos + ret] = 0;
@ -24,7 +24,7 @@ index 0a6f615c702..746e01e91a0 100644
{
if (is_win_dir) *is_win_dir = is_same_file( &windir, &st );
return STATUS_SUCCESS;
@@ -2821,7 +2821,7 @@ not_found:
@@ -2820,7 +2820,7 @@ not_found:
return STATUS_OBJECT_PATH_NOT_FOUND;
success:
@ -33,7 +33,7 @@ index 0a6f615c702..746e01e91a0 100644
return STATUS_SUCCESS;
}
@@ -3316,7 +3316,7 @@ static NTSTATUS lookup_unix_name( const WCHAR *name, int name_len, char **buffer
@@ -3393,7 +3393,7 @@ static NTSTATUS lookup_unix_name( const WCHAR *name, int name_len, char **buffer
for (p = unix_name + pos ; *p; p++) if (*p == '\\') *p = '/';
if (!name_len || !redirect || (!strstr( unix_name, "/windows/") && strncmp( unix_name, "windows/", 8 )))
{
@ -43,5 +43,5 @@ index 0a6f615c702..746e01e91a0 100644
if (disposition == FILE_CREATE)
return STATUS_OBJECT_NAME_COLLISION;
--
2.17.1
2.20.1

View File

@ -1,8 +1,8 @@
From 79be4ce22135fcf52d67ea70314081ca97678d20 Mon Sep 17 00:00:00 2001
From cfb87d4a7081fe17596ca63cfdb15671462d9e74 Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
Date: Wed, 13 Mar 2019 16:02:05 -0600
Subject: kernel32: Implement CreateSymbolicLink[A|W] with ntdll reparse
points.
Subject: [PATCH] kernel32: Implement CreateSymbolicLink[A|W] with ntdll
reparse points.
Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
---
@ -161,7 +161,7 @@ index f49af6d5bfe..bc2cd84a65d 100644
+ test_CreateSymbolicLink();
}
diff --git a/dlls/kernelbase/file.c b/dlls/kernelbase/file.c
index 712c4ab4170..1a83d0ad902 100644
index 375c00c7367..6040fa18059 100644
--- a/dlls/kernelbase/file.c
+++ b/dlls/kernelbase/file.c
@@ -38,6 +38,7 @@
@ -282,10 +282,10 @@ index 712c4ab4170..1a83d0ad902 100644
diff --git a/dlls/msvcp120/tests/msvcp120.c b/dlls/msvcp120/tests/msvcp120.c
index 54d959b694c..38f5a960521 100644
index 35e90cfa29c..552a1de81cb 100644
--- a/dlls/msvcp120/tests/msvcp120.c
+++ b/dlls/msvcp120/tests/msvcp120.c
@@ -1596,15 +1596,14 @@ static void test_tr2_sys__Stat(void)
@@ -1609,15 +1609,14 @@ static void test_tr2_sys__Stat(void)
char const *path;
enum file_type ret;
int err_code;
@ -308,7 +308,7 @@ index 54d959b694c..38f5a960521 100644
};
CreateDirectoryA("tr2_test_dir", NULL);
@@ -1647,16 +1646,14 @@ static void test_tr2_sys__Stat(void)
@@ -1660,16 +1659,14 @@ static void test_tr2_sys__Stat(void)
for(i=0; i<ARRAY_SIZE(tests); i++) {
err_code = 0xdeadbeef;
val = p_tr2_sys__Stat(tests[i].path, &err_code);
@ -327,7 +327,7 @@ index 54d959b694c..38f5a960521 100644
ok(tests[i].err_code == err_code, "tr2_sys__Lstat(): test %d err_code expect: %d, got %d\n",
i+1, tests[i].err_code, err_code);
}
@@ -1671,8 +1668,8 @@ static void test_tr2_sys__Stat(void)
@@ -1684,8 +1681,8 @@ static void test_tr2_sys__Stat(void)
ok(ERROR_SUCCESS == err_code, "tr2_sys__Lstat_wchar(): err_code expect ERROR_SUCCESS, got %d\n", err_code);
if(ret) {
@ -338,7 +338,7 @@ index 54d959b694c..38f5a960521 100644
}
ok(DeleteFileA("tr2_test_dir/f1"), "expect tr2_test_dir/f1 to exist\n");
ok(RemoveDirectoryA("tr2_test_dir"), "expect tr2_test_dir to exist\n");
@@ -1901,16 +1898,15 @@ static void test_tr2_sys__Symlink(void)
@@ -1914,16 +1911,15 @@ static void test_tr2_sys__Symlink(void)
char const *existing_path;
char const *new_path;
int last_error;
@ -363,7 +363,7 @@ index 54d959b694c..38f5a960521 100644
};
ret = p_tr2_sys__Make_dir("tr2_test_dir");
@@ -1935,18 +1931,17 @@ static void test_tr2_sys__Symlink(void)
@@ -1948,18 +1944,17 @@ static void test_tr2_sys__Symlink(void)
}
ok(errno == 0xdeadbeef, "tr2_sys__Symlink(): test %d errno expect 0xdeadbeef, got %d\n", i+1, errno);
@ -388,7 +388,7 @@ index 54d959b694c..38f5a960521 100644
ret = p_tr2_sys__Remove_dir("tr2_test_dir");
ok(ret == 1, "tr2_sys__Remove_dir(): expect 1 got %d\n", ret);
}
@@ -1960,15 +1955,14 @@ static void test_tr2_sys__Unlink(void)
@@ -1973,15 +1968,14 @@ static void test_tr2_sys__Unlink(void)
struct {
char const *path;
int last_error;
@ -411,7 +411,7 @@ index 54d959b694c..38f5a960521 100644
};
GetCurrentDirectoryA(MAX_PATH, current_path);
@@ -1997,9 +1991,8 @@ static void test_tr2_sys__Unlink(void)
@@ -2010,9 +2004,8 @@ static void test_tr2_sys__Unlink(void)
for(i=0; i<ARRAY_SIZE(tests); i++) {
errno = 0xdeadbeef;
ret = p_tr2_sys__Unlink(tests[i].path);
@ -424,10 +424,10 @@ index 54d959b694c..38f5a960521 100644
}
diff --git a/dlls/msvcp140/tests/msvcp140.c b/dlls/msvcp140/tests/msvcp140.c
index ae21feaf9e4..c10e925f8b3 100644
index 8a3771842a0..a55998e0d79 100644
--- a/dlls/msvcp140/tests/msvcp140.c
+++ b/dlls/msvcp140/tests/msvcp140.c
@@ -784,16 +784,15 @@ static void test_Stat(void)
@@ -787,16 +787,15 @@ static void test_Stat(void)
WCHAR const *path;
enum file_type ret;
int perms;
@ -452,7 +452,7 @@ index ae21feaf9e4..c10e925f8b3 100644
};
GetCurrentDirectoryW(MAX_PATH, origin_path);
@@ -851,26 +850,20 @@ static void test_Stat(void)
@@ -854,26 +853,20 @@ static void test_Stat(void)
for(i=0; i<ARRAY_SIZE(tests); i++) {
perms = 0xdeadbeef;
val = p_Stat(tests[i].path, &perms);
@ -487,7 +487,7 @@ index ae21feaf9e4..c10e925f8b3 100644
}
GetSystemDirectoryW(sys_path, MAX_PATH);
@@ -882,9 +875,9 @@ static void test_Stat(void)
@@ -885,9 +878,9 @@ static void test_Stat(void)
ok(perms == expected_perms, "_Stat(): perms expect: 0%o, got 0%o\n", expected_perms, perms);
if(ret) {
@ -499,7 +499,7 @@ index ae21feaf9e4..c10e925f8b3 100644
"expect wine_test_dir/dir_link to exist\n");
}
ok(DeleteFileW(L"wine_test_dir/f1"), "expect wine_test_dir/f1 to exist\n");
@@ -1003,15 +996,14 @@ static void test_Unlink(void)
@@ -1006,15 +999,14 @@ static void test_Unlink(void)
struct {
WCHAR const *path;
int last_error;
@ -522,7 +522,7 @@ index ae21feaf9e4..c10e925f8b3 100644
};
GetCurrentDirectoryW(MAX_PATH, current_path);
@@ -1040,9 +1032,8 @@ static void test_Unlink(void)
@@ -1043,9 +1035,8 @@ static void test_Unlink(void)
for(i=0; i<ARRAY_SIZE(tests); i++) {
errno = 0xdeadbeef;
ret = p_Unlink(tests[i].path);
@ -535,5 +535,5 @@ index ae21feaf9e4..c10e925f8b3 100644
}
--
2.17.1
2.20.1

View File

@ -1,7 +1,7 @@
From a03acf6635b090d9593abf2f5250eb7f26af6939 Mon Sep 17 00:00:00 2001
From 09525ce7c090eece4c5a9b0dc972b086e25d5a64 Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
Date: Wed, 29 May 2019 15:11:42 -0600
Subject: kernel32: Add reparse support to FindNextFile.
Subject: [PATCH] kernel32: Add reparse support to FindNextFile.
Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
---
@ -9,7 +9,7 @@ Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
1 file changed, 35 insertions(+)
diff --git a/dlls/kernelbase/file.c b/dlls/kernelbase/file.c
index 1a83d0ad902..1908a8b03b8 100644
index 6040fa18059..2f89f78ffd4 100644
--- a/dlls/kernelbase/file.c
+++ b/dlls/kernelbase/file.c
@@ -1495,6 +1495,41 @@ BOOL WINAPI DECLSPEC_HOTPATCH FindNextFileW( HANDLE handle, WIN32_FIND_DATAW *da
@ -55,5 +55,5 @@ index 1a83d0ad902..1908a8b03b8 100644
{
memcpy( data->cAlternateFileName, dir_info->ShortName, dir_info->ShortNameLength );
--
2.17.1
2.20.1

View File

@ -1,7 +1,7 @@
From a98908cfe4b02667e6edbbe23feecc6f1044b274 Mon Sep 17 00:00:00 2001
From b67fce62c7b91b4b569bb16af51e7b1c0a6e6c98 Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
Date: Wed, 29 May 2019 15:18:50 -0600
Subject: wcmd: Display reparse point type in directory listings.
Subject: [PATCH] wcmd: Display reparse point type in directory listings.
Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
---
@ -46,5 +46,5 @@ index 24b18bfa81b..40554aed368 100644
dir_count++;
--
2.17.1
2.20.1

View File

@ -1,7 +1,7 @@
From 62cff45e50e2ebc5266b444753259e7ffeeff4a5 Mon Sep 17 00:00:00 2001
From 46d0f8141530dc254c2cc57c056f762d91e62db1 Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
Date: Wed, 29 May 2019 15:38:30 -0600
Subject: wcmd: Show reparse point target in directory listing.
Subject: [PATCH] wcmd: Show reparse point target in directory listing.
Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
---
@ -62,5 +62,5 @@ index 40554aed368..0618ffec8d1 100644
if (!((lstrcmpW(fd[i].cFileName, L".") == 0) ||
(lstrcmpW(fd[i].cFileName, L"..") == 0))) {
--
2.17.1
2.20.1

View File

@ -1,7 +1,7 @@
From 505ec0efa320fcc9c4aa379bf2c656fe7e63046b Mon Sep 17 00:00:00 2001
From 4334ed826f3055b5cf359919e27be08effad1713 Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
Date: Wed, 29 May 2019 16:01:45 -0600
Subject: wcmd: Add junction point support to mklink.
Subject: [PATCH] wcmd: Add junction point support to mklink.
Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
---
@ -9,7 +9,7 @@ Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
1 file changed, 47 insertions(+), 1 deletion(-)
diff --git a/programs/cmd/builtins.c b/programs/cmd/builtins.c
index 19265bdbe78..20cf0991184 100644
index 0fb40d94e49..07d34c10706 100644
--- a/programs/cmd/builtins.c
+++ b/programs/cmd/builtins.c
@@ -31,6 +31,9 @@
@ -22,7 +22,7 @@ index 19265bdbe78..20cf0991184 100644
WINE_DEFAULT_DEBUG_CHANNEL(cmd);
@@ -4967,6 +4970,49 @@ void WCMD_color (void) {
@@ -4973,6 +4976,49 @@ void WCMD_color (void) {
}
}
@ -72,7 +72,7 @@ index 19265bdbe78..20cf0991184 100644
/****************************************************************************
* WCMD_mklink
*/
@@ -5015,7 +5061,7 @@ void WCMD_mklink(WCHAR *args)
@@ -5021,7 +5067,7 @@ void WCMD_mklink(WCHAR *args)
else if(!junction)
ret = CreateSymbolicLinkW(file1, file2, isdir);
else
@ -82,5 +82,5 @@ index 19265bdbe78..20cf0991184 100644
if(!ret)
WCMD_output_stderr(WCMD_LoadMessage(WCMD_READFAIL), file1);
--
2.17.1
2.20.1

View File

@ -1,7 +1,7 @@
From 33fd7e14918d6acc6416bd0430e6ceae98959c75 Mon Sep 17 00:00:00 2001
From 03347baf370ccc769cfd2cd76e6953fd9e2345ed Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
Date: Sat, 18 Jul 2020 09:13:29 -0600
Subject: server: Fix obtaining information about a symlink.
Subject: [PATCH] server: Fix obtaining information about a symlink.
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, 15 insertions(+), 12 deletions(-)
diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c
index 746e01e91a0..809832dc6f0 100644
index 712b0196f05..f77b8184183 100644
--- a/dlls/ntdll/unix/file.c
+++ b/dlls/ntdll/unix/file.c
@@ -1996,7 +1996,7 @@ static NTSTATUS fill_file_info( const struct stat *st, ULONG attr, void *ptr,
@@ -1995,7 +1995,7 @@ static NTSTATUS fill_file_info( const struct stat *st, ULONG attr, void *ptr,
}
@ -23,7 +23,7 @@ index 746e01e91a0..809832dc6f0 100644
{
data_size_t size = 1024;
NTSTATUS ret;
@@ -2009,6 +2009,7 @@ static NTSTATUS server_get_unix_name( HANDLE handle, char **unix_name )
@@ -2008,6 +2008,7 @@ static NTSTATUS server_get_unix_name( HANDLE handle, char **unix_name )
SERVER_START_REQ( get_handle_unix_name )
{
req->handle = wine_server_obj_handle( handle );
@ -31,7 +31,7 @@ index 746e01e91a0..809832dc6f0 100644
wine_server_set_reply( req, name, size );
ret = wine_server_call( req );
size = reply->name_len;
@@ -2183,7 +2184,7 @@ static NTSTATUS get_mountmgr_fs_info( HANDLE handle, int fd, struct mountmgr_uni
@@ -2182,7 +2183,7 @@ static NTSTATUS get_mountmgr_fs_info( HANDLE handle, int fd, struct mountmgr_uni
NTSTATUS status;
int letter;
@ -40,7 +40,7 @@ index 746e01e91a0..809832dc6f0 100644
letter = find_dos_device( unix_name );
free( unix_name );
@@ -4205,7 +4206,7 @@ NTSTATUS WINAPI NtQueryInformationFile( HANDLE handle, IO_STATUS_BLOCK *io,
@@ -4278,7 +4279,7 @@ NTSTATUS WINAPI NtQueryInformationFile( HANDLE handle, IO_STATUS_BLOCK *io,
if (fd_get_file_info( fd, options, &st, &attr ) == -1) io->u.Status = errno_to_status( errno );
else if (!S_ISREG(st.st_mode) && !S_ISDIR(st.st_mode))
io->u.Status = STATUS_INVALID_INFO_CLASS;
@ -49,7 +49,7 @@ index 746e01e91a0..809832dc6f0 100644
{
LONG name_len = len - FIELD_OFFSET(FILE_ALL_INFORMATION, NameInformation.FileName);
@@ -4266,7 +4267,7 @@ NTSTATUS WINAPI NtQueryInformationFile( HANDLE handle, IO_STATUS_BLOCK *io,
@@ -4339,7 +4340,7 @@ NTSTATUS WINAPI NtQueryInformationFile( HANDLE handle, IO_STATUS_BLOCK *io,
FILE_NAME_INFORMATION *info = ptr;
char *unix_name;
@ -58,7 +58,7 @@ index 746e01e91a0..809832dc6f0 100644
{
LONG name_len = len - FIELD_OFFSET(FILE_NAME_INFORMATION, FileName);
io->u.Status = fill_name_info( unix_name, info, &name_len );
@@ -4280,7 +4281,7 @@ NTSTATUS WINAPI NtQueryInformationFile( HANDLE handle, IO_STATUS_BLOCK *io,
@@ -4353,7 +4354,7 @@ NTSTATUS WINAPI NtQueryInformationFile( HANDLE handle, IO_STATUS_BLOCK *io,
FILE_NETWORK_OPEN_INFORMATION *info = ptr;
char *unix_name;
@ -67,7 +67,7 @@ index 746e01e91a0..809832dc6f0 100644
{
ULONG attributes;
struct stat st;
@@ -5874,7 +5875,7 @@ NTSTATUS FILE_CreateSymlink(HANDLE handle, REPARSE_DATA_BUFFER *buffer)
@@ -5953,7 +5954,7 @@ NTSTATUS FILE_CreateSymlink(HANDLE handle, REPARSE_DATA_BUFFER *buffer)
if ((status = server_get_unix_fd( handle, FILE_SPECIAL_ACCESS, &dest_fd, &needs_close, NULL, NULL )))
return status;
@ -76,7 +76,7 @@ index 746e01e91a0..809832dc6f0 100644
goto cleanup;
src_allocated = TRUE;
if (flags == SYMLINK_FLAG_RELATIVE)
@@ -6154,7 +6155,7 @@ NTSTATUS FILE_GetSymlink(HANDLE handle, REPARSE_DATA_BUFFER *buffer, ULONG out_s
@@ -6233,7 +6234,7 @@ NTSTATUS FILE_GetSymlink(HANDLE handle, REPARSE_DATA_BUFFER *buffer, ULONG out_s
if ((status = server_get_unix_fd( handle, FILE_ANY_ACCESS, &dest_fd, &needs_close, NULL, NULL )))
return status;
@ -85,7 +85,7 @@ index 746e01e91a0..809832dc6f0 100644
goto cleanup;
if ((status = FILE_DecodeSymlink( unix_src, unix_dest, &unix_dest_len, &buffer->ReparseTag, &flags, NULL )))
@@ -6263,7 +6264,7 @@ NTSTATUS FILE_RemoveSymlink(HANDLE handle, REPARSE_GUID_DATA_BUFFER *buffer)
@@ -6342,7 +6343,7 @@ NTSTATUS FILE_RemoveSymlink(HANDLE handle, REPARSE_GUID_DATA_BUFFER *buffer)
if ((status = server_get_unix_fd( handle, FILE_SPECIAL_ACCESS, &dest_fd, &needs_close, NULL, NULL )))
return status;
@ -94,7 +94,7 @@ index 746e01e91a0..809832dc6f0 100644
goto cleanup;
TRACE( "Deleting symlink %s\n", unix_name );
@@ -7327,7 +7328,7 @@ NTSTATUS WINAPI NtQueryObject( HANDLE handle, OBJECT_INFORMATION_CLASS info_clas
@@ -7447,7 +7448,7 @@ NTSTATUS WINAPI NtQueryObject( HANDLE handle, OBJECT_INFORMATION_CLASS info_clas
/* first try as a file object */
@ -104,10 +104,10 @@ index 746e01e91a0..809832dc6f0 100644
if (!(status = unix_to_nt_file_name( unix_name, &nt_name )))
{
diff --git a/server/fd.c b/server/fd.c
index 78b1ae97f03..69926dcfe88 100644
index da5bee3e5ec..9a06492c3bb 100644
--- a/server/fd.c
+++ b/server/fd.c
@@ -2737,11 +2737,12 @@ DECL_HANDLER(get_handle_unix_name)
@@ -2795,11 +2795,12 @@ DECL_HANDLER(get_handle_unix_name)
if ((fd = get_handle_fd_obj( current->process, req->handle, 0 )))
{
@ -124,10 +124,10 @@ index 78b1ae97f03..69926dcfe88 100644
}
else set_error( STATUS_OBJECT_TYPE_MISMATCH );
diff --git a/server/protocol.def b/server/protocol.def
index 5b506ea4475..5a11c13768d 100644
index 7f3b785df51..f37e03cbaea 100644
--- a/server/protocol.def
+++ b/server/protocol.def
@@ -1314,6 +1314,7 @@ enum event_op { PULSE_EVENT, SET_EVENT, RESET_EVENT };
@@ -1341,6 +1341,7 @@ enum event_op { PULSE_EVENT, SET_EVENT, RESET_EVENT };
/* Get the Unix name from a file handle */
@REQ(get_handle_unix_name)
obj_handle_t handle; /* file handle */
@ -136,5 +136,5 @@ index 5b506ea4475..5a11c13768d 100644
data_size_t name_len; /* unix name length */
VARARG(name,string); /* unix name */
--
2.17.1
2.20.1

View File

@ -1,7 +1,7 @@
From a82cbbe7ca0bbc59417ac32516c978c7fa6bfde0 Mon Sep 17 00:00:00 2001
From cb6f9f1cee547e88942490bd46e7d6f9a5a8f0a2 Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@wine-staging.com>
Date: Mon, 23 Nov 2020 13:08:02 -0700
Subject: ntdll: Succeed with no data for NtReadFile on reparse points.
Subject: [PATCH] ntdll: Succeed with no data for NtReadFile on reparse points.
---
dlls/ntdll/tests/file.c | 2 +-
@ -11,10 +11,10 @@ Subject: ntdll: Succeed with no data for NtReadFile on reparse points.
4 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c
index 994bfb23a5e..45254128d45 100644
index fb168549641..05f6f67c4d3 100644
--- a/dlls/ntdll/tests/file.c
+++ b/dlls/ntdll/tests/file.c
@@ -5403,7 +5403,7 @@ static void test_reparse_points(void)
@@ -5405,7 +5405,7 @@ static void test_reparse_points(void)
ok(handle != INVALID_HANDLE_VALUE, "Failed to open symlink file.\n");
todo_wine ok(GetFileSize(handle, NULL) == 0, "symlink size is not zero\n");
bret = ReadFile(handle, &buf, sizeof(buf), &dwLen, NULL);
@ -24,10 +24,10 @@ index 994bfb23a5e..45254128d45 100644
CloseHandle(handle);
diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c
index 809832dc6f0..00f479109b2 100644
index f77b8184183..6178f232db1 100644
--- a/dlls/ntdll/unix/file.c
+++ b/dlls/ntdll/unix/file.c
@@ -5245,6 +5245,11 @@ NTSTATUS WINAPI NtReadFile( HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc, vo
@@ -5324,6 +5324,11 @@ NTSTATUS WINAPI NtReadFile( HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc, vo
goto done;
}
}
@ -40,10 +40,10 @@ index 809832dc6f0..00f479109b2 100644
if (type == FD_TYPE_SERIAL && async_read && length)
{
diff --git a/server/file.c b/server/file.c
index 1012fd4888c..38fb489df4f 100644
index f9ce0106c3b..ccac535e50f 100644
--- a/server/file.c
+++ b/server/file.c
@@ -300,6 +300,7 @@ static enum server_fd_type file_get_fd_type( struct fd *fd )
@@ -296,6 +296,7 @@ static enum server_fd_type file_get_fd_type( struct fd *fd )
{
struct file *file = get_fd_user( fd );
@ -52,10 +52,10 @@ index 1012fd4888c..38fb489df4f 100644
if (S_ISDIR(file->mode)) return FD_TYPE_DIR;
return FD_TYPE_CHAR;
diff --git a/server/protocol.def b/server/protocol.def
index 5a11c13768d..73980390f4a 100644
index f37e03cbaea..8b376c613ca 100644
--- a/server/protocol.def
+++ b/server/protocol.def
@@ -1334,6 +1334,7 @@ enum server_fd_type
@@ -1361,6 +1361,7 @@ enum server_fd_type
{
FD_TYPE_INVALID, /* invalid file (no associated fd) */
FD_TYPE_FILE, /* regular file */
@ -64,5 +64,5 @@ index 5a11c13768d..73980390f4a 100644
FD_TYPE_SOCKET, /* socket */
FD_TYPE_SERIAL, /* serial port */
--
2.17.1
2.20.1

View File

@ -1,7 +1,7 @@
From ba9f8b6a479b92aec362e99ddf2b698e00b05be0 Mon Sep 17 00:00:00 2001
From f50cb288f497d40a76f345f62eb99d7d0be1f416 Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@wine-staging.com>
Date: Wed, 25 Nov 2020 09:05:51 -0700
Subject: ntdll: Support reparse point properties in fd_get_file_info.
Subject: [PATCH] ntdll: Support reparse point properties in fd_get_file_info.
---
dlls/ntdll/tests/file.c | 2 +-
@ -9,10 +9,10 @@ Subject: ntdll: Support reparse point properties in fd_get_file_info.
2 files changed, 50 insertions(+), 34 deletions(-)
diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c
index 45254128d45..09a2ab5be9f 100644
index 05f6f67c4d3..20c569c0962 100644
--- a/dlls/ntdll/tests/file.c
+++ b/dlls/ntdll/tests/file.c
@@ -5401,7 +5401,7 @@ static void test_reparse_points(void)
@@ -5403,7 +5403,7 @@ static void test_reparse_points(void)
handle = CreateFileW(reparse_path, GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING,
FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_OPEN_REPARSE_POINT, 0);
ok(handle != INVALID_HANDLE_VALUE, "Failed to open symlink file.\n");
@ -22,10 +22,10 @@ index 45254128d45..09a2ab5be9f 100644
ok(bret, "Failed to read data from the symlink.\n");
ok(dwLen == 0, "Length of symlink data is not zero.\n");
diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c
index 00f479109b2..7d833e115f3 100644
index 6178f232db1..555e2e549e7 100644
--- a/dlls/ntdll/unix/file.c
+++ b/dlls/ntdll/unix/file.c
@@ -1615,6 +1615,8 @@ static inline int get_file_xattr( char *hexattr, int attrlen )
@@ -1614,6 +1614,8 @@ static inline int get_file_xattr( char *hexattr, int attrlen )
NTSTATUS FILE_DecodeSymlink(const char *unix_src, char *unix_dest, int *unix_dest_len,
DWORD *tag, ULONG *flags, BOOL *is_dir);
@ -34,7 +34,7 @@ index 00f479109b2..7d833e115f3 100644
/* fetch the attributes of a file */
static inline ULONG get_file_attributes( const struct stat *st )
@@ -1651,6 +1653,22 @@ static int fd_get_file_info( int fd, unsigned int options, struct stat *st, ULON
@@ -1650,6 +1652,22 @@ static int fd_get_file_info( int fd, unsigned int options, struct stat *st, ULON
/* consider mount points to be reparse points (IO_REPARSE_TAG_MOUNT_POINT) */
if ((options & FILE_OPEN_REPARSE_POINT) && fd_is_mount_point( fd, st ))
*attr |= FILE_ATTRIBUTE_REPARSE_POINT;
@ -57,7 +57,7 @@ index 00f479109b2..7d833e115f3 100644
return ret;
}
@@ -6057,41 +6075,22 @@ cleanup:
@@ -6136,41 +6154,22 @@ cleanup:
}
@ -103,7 +103,7 @@ index 00f479109b2..7d833e115f3 100644
reparse_tag = 0;
for (i = 0; i < sizeof(ULONG)*8; i++)
{
@@ -6103,10 +6102,7 @@ NTSTATUS FILE_DecodeSymlink(const char *unix_src, char *unix_dest, int *unix_des
@@ -6182,10 +6181,7 @@ NTSTATUS FILE_DecodeSymlink(const char *unix_src, char *unix_dest, int *unix_des
else if (c == '.' && *p++ == '/')
val = 1;
else
@ -115,7 +115,7 @@ index 00f479109b2..7d833e115f3 100644
reparse_tag |= (val << i);
}
/* skip past the directory/file flag */
@@ -6119,19 +6115,39 @@ NTSTATUS FILE_DecodeSymlink(const char *unix_src, char *unix_dest, int *unix_des
@@ -6198,19 +6194,39 @@ NTSTATUS FILE_DecodeSymlink(const char *unix_src, char *unix_dest, int *unix_des
else if (c == '.' && *p++ == '/')
dir_flag = TRUE;
else
@ -162,5 +162,5 @@ index 00f479109b2..7d833e115f3 100644
cleanup:
if (!unix_dest) free( tmp );
--
2.17.1
2.20.1

View File

@ -1,7 +1,7 @@
From 4f74580a7cbd03cd0ee3aebab290a1997c4b9a9d Mon Sep 17 00:00:00 2001
From 216217b0759ae81c48fa8e56238a7f0b6c084576 Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@wine-staging.com>
Date: Wed, 25 Nov 2020 09:19:42 -0700
Subject: ntdll: Add support for FileAttributeTagInformation.
Subject: [PATCH] ntdll: Add support for FileAttributeTagInformation.
---
dlls/ntdll/tests/file.c | 6 ++++++
@ -9,10 +9,10 @@ Subject: ntdll: Add support for FileAttributeTagInformation.
2 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c
index 09a2ab5be9f..a27502e99bc 100644
index 20c569c0962..3f4017d2aeb 100644
--- a/dlls/ntdll/tests/file.c
+++ b/dlls/ntdll/tests/file.c
@@ -5216,6 +5216,7 @@ static void test_reparse_points(void)
@@ -5215,6 +5215,7 @@ static void test_reparse_points(void)
static WCHAR volW[] = {'c',':','\\',0};
REPARSE_GUID_DATA_BUFFER guid_buffer;
static const WCHAR dotW[] = {'.',0};
@ -20,7 +20,7 @@ index 09a2ab5be9f..a27502e99bc 100644
REPARSE_DATA_BUFFER *buffer = NULL;
DWORD dwret, dwLen, dwFlags, err;
WIN32_FILE_ATTRIBUTE_DATA fad;
@@ -5225,6 +5226,7 @@ static void test_reparse_points(void)
@@ -5224,6 +5225,7 @@ static void test_reparse_points(void)
IO_STATUS_BLOCK iosb;
UNICODE_STRING nameW;
TOKEN_PRIVILEGES tp;
@ -28,7 +28,7 @@ index 09a2ab5be9f..a27502e99bc 100644
WCHAR *dest;
LUID luid;
BOOL bret;
@@ -5405,6 +5407,10 @@ static void test_reparse_points(void)
@@ -5407,6 +5409,10 @@ static void test_reparse_points(void)
bret = ReadFile(handle, &buf, sizeof(buf), &dwLen, NULL);
ok(bret, "Failed to read data from the symlink.\n");
ok(dwLen == 0, "Length of symlink data is not zero.\n");
@ -40,10 +40,10 @@ index 09a2ab5be9f..a27502e99bc 100644
/* Check the size/data of the symlink target */
diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c
index 7d833e115f3..5ed3f3ea70d 100644
index 555e2e549e7..e16290d5903 100644
--- a/dlls/ntdll/unix/file.c
+++ b/dlls/ntdll/unix/file.c
@@ -4348,7 +4348,16 @@ NTSTATUS WINAPI NtQueryInformationFile( HANDLE handle, IO_STATUS_BLOCK *io,
@@ -4421,7 +4421,16 @@ NTSTATUS WINAPI NtQueryInformationFile( HANDLE handle, IO_STATUS_BLOCK *io,
{
FILE_ATTRIBUTE_TAG_INFORMATION *info = ptr;
info->FileAttributes = attr;
@ -62,5 +62,5 @@ index 7d833e115f3..5ed3f3ea70d 100644
info->ReparseTag = IO_REPARSE_TAG_MOUNT_POINT;
}
--
2.17.1
2.20.1

View File

@ -0,0 +1,43 @@
From 0057f977c574aebefda0c3047f8027d68391ec3f Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@wine-staging.com>
Date: Sat, 6 Feb 2021 12:17:23 -0700
Subject: [PATCH] server: Properly handle renames involving symlinks.
---
server/fd.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/server/fd.c b/server/fd.c
index 9a06492c3bb..ee58aa3c8ae 100644
--- a/server/fd.c
+++ b/server/fd.c
@@ -2628,7 +2628,7 @@ static void set_fd_name( struct fd *fd, struct fd *root, const char *nameptr, da
goto failed;
}
- if (!stat( name, &st ))
+ if (!lstat( name, &st ))
{
if (!fstat( fd->unix_fd, &st2 ) && st.st_ino == st2.st_ino && st.st_dev == st2.st_dev)
{
@@ -2644,7 +2644,7 @@ static void set_fd_name( struct fd *fd, struct fd *root, const char *nameptr, da
}
/* can't replace directories or special files */
- if (!S_ISREG( st.st_mode ))
+ if (!S_ISREG( st.st_mode ) && !S_ISLNK( st.st_mode ))
{
set_error( STATUS_ACCESS_DENIED );
goto failed;
@@ -2703,6 +2703,8 @@ static void set_fd_name( struct fd *fd, struct fd *root, const char *nameptr, da
free( fd->unlink_name );
free( fd->unix_name );
fd->closed->unix_name = fd->unix_name = realpath( name, NULL );
+ if (!fd->unix_name)
+ fd->closed->unix_name = fd->unix_name = dup_fd_name( NULL, name ); /* dangling symlink */
if (!fd->unlink_name || !fd->unix_name)
set_error( STATUS_NO_MEMORY );
return;
--
2.20.1

View File

@ -0,0 +1,26 @@
From 5dba21fa1e73037cdeabb35b464a0b70b07200c8 Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@wine-staging.com>
Date: Sat, 6 Feb 2021 12:46:30 -0700
Subject: [PATCH] kernelbase: Use FILE_OPEN_REPARSE_POINT in
MoveFileWithProgress.
---
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 2f89f78ffd4..795cdcbfaf5 100644
--- a/dlls/kernelbase/file.c
+++ b/dlls/kernelbase/file.c
@@ -2592,7 +2592,7 @@ BOOL WINAPI DECLSPEC_HOTPATCH MoveFileWithProgressW( const WCHAR *source, const
status = NtOpenFile( &source_handle, DELETE | SYNCHRONIZE, &attr, &io,
FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
- FILE_SYNCHRONOUS_IO_NONALERT );
+ FILE_SYNCHRONOUS_IO_NONALERT | FILE_OPEN_REPARSE_POINT );
RtlFreeUnicodeString( &nt_name );
if (!set_ntstatus( status )) goto error;
--
2.20.1

View File

@ -0,0 +1,26 @@
From 1ebd7e436e19c89ddd164e4b42e4aba3efd63afa Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@wine-staging.com>
Date: Sat, 6 Feb 2021 12:52:51 -0700
Subject: [PATCH] kernelbase: Use FILE_OPEN_REPARSE_POINT in DeleteFile.
---
dlls/kernelbase/file.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/dlls/kernelbase/file.c b/dlls/kernelbase/file.c
index 795cdcbfaf5..73655ca6ffa 100644
--- a/dlls/kernelbase/file.c
+++ b/dlls/kernelbase/file.c
@@ -1080,7 +1080,8 @@ BOOL WINAPI DECLSPEC_HOTPATCH DeleteFileW( LPCWSTR path )
status = NtCreateFile(&hFile, SYNCHRONIZE | DELETE, &attr, &io, NULL, 0,
FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
- FILE_OPEN, FILE_DELETE_ON_CLOSE | FILE_NON_DIRECTORY_FILE, NULL, 0);
+ FILE_OPEN, FILE_DELETE_ON_CLOSE | FILE_NON_DIRECTORY_FILE | FILE_OPEN_REPARSE_POINT,
+ NULL, 0);
if (status == STATUS_SUCCESS) status = NtClose(hFile);
RtlFreeUnicodeString( &nameW );
--
2.20.1

View File

@ -0,0 +1,114 @@
From 960250fb1a76a0777ab32d3472184309a5ba124e Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@wine-staging.com>
Date: Sat, 6 Feb 2021 16:32:44 -0700
Subject: [PATCH] ntdll: Treat undecoded unix symlinks as NT symlinks.
---
dlls/ntdll/unix/file.c | 39 ++++++++++++++++++++++++++++-----------
1 file changed, 28 insertions(+), 11 deletions(-)
diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c
index e16290d5903..dedf93c11f2 100644
--- a/dlls/ntdll/unix/file.c
+++ b/dlls/ntdll/unix/file.c
@@ -1614,8 +1614,8 @@ static inline int get_file_xattr( char *hexattr, int attrlen )
NTSTATUS FILE_DecodeSymlink(const char *unix_src, char *unix_dest, int *unix_dest_len,
DWORD *tag, ULONG *flags, BOOL *is_dir);
-NTSTATUS get_symlink_properties(const char *target, int len, char *unix_dest, int *unix_dest_len,
- DWORD *tag, ULONG *flags, BOOL *is_dir);
+void get_symlink_properties(const char *target, int len, char *unix_dest, int *unix_dest_len,
+ DWORD *tag, ULONG *flags, BOOL *is_dir);
/* fetch the attributes of a file */
static inline ULONG get_file_attributes( const struct stat *st )
@@ -1663,8 +1663,8 @@ static int fd_get_file_info( int fd, unsigned int options, struct stat *st, ULON
*attr |= FILE_ATTRIBUTE_REPARSE_POINT;
/* symbolic links always report size 0 */
st->st_size = 0;
- if (get_symlink_properties(path, len, NULL, NULL, NULL, NULL, &is_dir) == STATUS_SUCCESS)
- st->st_mode = (st->st_mode & ~S_IFMT) | (is_dir ? S_IFDIR : S_IFREG);
+ get_symlink_properties(path, len, NULL, NULL, NULL, NULL, &is_dir);
+ st->st_mode = (st->st_mode & ~S_IFMT) | (is_dir ? S_IFDIR : S_IFREG);
}
done:
@@ -6163,10 +6163,11 @@ cleanup:
}
-NTSTATUS get_symlink_properties(const char *target, int len, char *unix_dest, int *unix_dest_len,
- DWORD *tag, ULONG *flags, BOOL *is_dir)
+void get_symlink_properties(const char *target, int len, char *unix_dest, int *unix_dest_len,
+ DWORD *tag, ULONG *flags, BOOL *is_dir)
{
const char *p = target;
+ int decoded = FALSE;
DWORD reparse_tag;
BOOL dir_flag;
int i;
@@ -6178,7 +6179,7 @@ NTSTATUS get_symlink_properties(const char *target, int len, char *unix_dest, in
p++;
}
if (*p++ != '/')
- return STATUS_NOT_IMPLEMENTED;
+ goto done;
reparse_tag = 0;
for (i = 0; i < sizeof(ULONG)*8; i++)
{
@@ -6190,7 +6191,7 @@ NTSTATUS get_symlink_properties(const char *target, int len, char *unix_dest, in
else if (c == '.' && *p++ == '/')
val = 1;
else
- return STATUS_NOT_IMPLEMENTED;
+ goto done;
reparse_tag |= (val << i);
}
/* skip past the directory/file flag */
@@ -6203,16 +6204,31 @@ NTSTATUS get_symlink_properties(const char *target, int len, char *unix_dest, in
else if (c == '.' && *p++ == '/')
dir_flag = TRUE;
else
- return STATUS_NOT_IMPLEMENTED;
+ goto done;
}
else
dir_flag = TRUE;
+ decoded = TRUE;
+
+done:
+ if (!decoded)
+ {
+ /* treat undecoded unix symlinks as NT symlinks */
+ struct stat st;
+
+ p = target;
+ if (flags && *p != '/') *flags = SYMLINK_FLAG_RELATIVE;
+ reparse_tag = IO_REPARSE_TAG_SYMLINK;
+ if (!stat( target, &st ))
+ dir_flag = S_ISDIR(st.st_mode);
+ else
+ dir_flag = FALSE; /* treat dangling symlinks as files */
+ }
len -= (p - target);
if (tag) *tag = reparse_tag;
if (is_dir) *is_dir = dir_flag;
if (unix_dest) memmove(unix_dest, p, len + 1);
if (unix_dest_len) *unix_dest_len = len;
- return STATUS_SUCCESS;
}
@@ -6235,7 +6251,8 @@ NTSTATUS FILE_DecodeSymlink(const char *unix_src, char *unix_dest, int *unix_des
goto cleanup;
}
len = ret;
- status = get_symlink_properties(tmp, len, unix_dest, unix_dest_len, tag, flags, is_dir);
+ get_symlink_properties(tmp, len, unix_dest, unix_dest_len, tag, flags, is_dir);
+ status = STATUS_SUCCESS;
cleanup:
if (!unix_dest) free( tmp );
--
2.20.1

View File

@ -0,0 +1,58 @@
From 0f88dfb1dc52d5a44f81f49c67b17beb87539dca Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@wine-staging.com>
Date: Sat, 6 Feb 2021 16:15:46 -0700
Subject: [PATCH] ntdll: Strip the wine prefix from reparse point paths
external to the prefix.
---
dlls/ntdll/unix/file.c | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c
index dedf93c11f2..aeb11c57829 100644
--- a/dlls/ntdll/unix/file.c
+++ b/dlls/ntdll/unix/file.c
@@ -5942,6 +5942,31 @@ static void ignore_server_ioctl_struct_holes( ULONG code, const void *in_buffer,
}
+void strip_external_path( char *path, SIZE_T *len )
+{
+ static char *unix_root = NULL;
+ static int unix_root_len = 0;
+
+ if (unix_root == NULL)
+ {
+ UNICODE_STRING nameW;
+ WCHAR *nt_name;
+
+ if (unix_to_nt_file_name( "/", &nt_name ) != STATUS_SUCCESS) return;
+ nameW.Buffer = nt_name;
+ nameW.Length = wcslen(nt_name) * sizeof(WCHAR);
+ nt_to_unix_file_name( &nameW, &unix_root, NULL, FILE_OPEN );
+ free( nt_name );
+ if (unix_root == NULL) return;
+ unix_root_len = strlen(unix_root);
+ }
+
+ if (strncmp( unix_root, path, unix_root_len ) != 0) return;
+ *len -= unix_root_len;
+ memmove( path, &path[unix_root_len - 1], *len + 1 );
+}
+
+
/*
* Retrieve the unix name corresponding to a file handle, remove that directory, and then symlink
* the requested directory to the location of the old directory.
@@ -6074,6 +6099,8 @@ NTSTATUS FILE_CreateSymlink(HANDLE handle, REPARSE_DATA_BUFFER *buffer)
goto cleanup;
}
}
+ else
+ strip_external_path( unix_dest, &unix_dest_len );
TRACE( "Linking %s to %s\n", unix_src, &unix_dest[relative_offset] );
--
2.20.1

View File

@ -0,0 +1,55 @@
From ecbe6ee5d35378e71c9170a7197e6f41be48e70a Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@wine-staging.com>
Date: Sat, 6 Feb 2021 16:16:17 -0700
Subject: [PATCH] ntdll: Add a marker to reparse point paths to indicate the
prefix location.
---
dlls/ntdll/unix/file.c | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c
index aeb11c57829..25ac1911720 100644
--- a/dlls/ntdll/unix/file.c
+++ b/dlls/ntdll/unix/file.c
@@ -5967,6 +5967,26 @@ void strip_external_path( char *path, SIZE_T *len )
}
+char *mark_prefix_end( char *path, SIZE_T *len )
+{
+ static char marker[] = "////.//.//"; /* "P" (0x50) encoded as a path (0=/ 1=./) */
+ int new_path_len = *len + sizeof(marker) - 1;
+ static int config_dir_len = 0;
+ char *new_path;
+
+ if (!config_dir_len) config_dir_len = strlen(config_dir);
+ if (path[config_dir_len] != '/') return path;
+ if (strncmp( config_dir, path, config_dir_len ) != 0) return path;
+ if (!(new_path = malloc( new_path_len ))) return path;
+ *len = new_path_len;
+ strcpy( new_path, config_dir );
+ strcat( new_path, marker );
+ strcat( new_path, &path[config_dir_len] );
+ free( path );
+ return new_path;
+}
+
+
/*
* Retrieve the unix name corresponding to a file handle, remove that directory, and then symlink
* the requested directory to the location of the old directory.
@@ -6100,7 +6120,10 @@ NTSTATUS FILE_CreateSymlink(HANDLE handle, REPARSE_DATA_BUFFER *buffer)
}
}
else
+ {
strip_external_path( unix_dest, &unix_dest_len );
+ unix_dest = mark_prefix_end( unix_dest, &unix_dest_len );
+ }
TRACE( "Linking %s to %s\n", unix_src, &unix_dest[relative_offset] );
--
2.20.1

View File

@ -0,0 +1,163 @@
From d50198b3aa971c3b1b76afb2630901466503107c Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@wine-staging.com>
Date: Sat, 6 Feb 2021 16:15:03 -0700
Subject: [PATCH] server: Rewrite absolute reparse point targets if the prefix
location changes.
---
server/fd.c | 87 +++++++++++++++++++++++++++++++++++++++++++++--------
1 file changed, 74 insertions(+), 13 deletions(-)
diff --git a/server/fd.c b/server/fd.c
index ee58aa3c8ae..43c0d36dff9 100644
--- a/server/fd.c
+++ b/server/fd.c
@@ -1902,7 +1902,7 @@ void get_nt_name( struct fd *fd, struct unicode_str *name )
name->len = fd->nt_namelen;
}
-static void decode_symlink(char *name, int *is_dir)
+static char *decode_symlink(const char *name, ULONG *tag, int *is_dir)
{
char link[MAX_PATH], *p;
ULONG reparse_tag;
@@ -1910,7 +1910,7 @@ static void decode_symlink(char *name, int *is_dir)
len = readlink( name, link, sizeof(link) );
if (len == -1)
- return;
+ return NULL;
link[len] = 0;
p = link;
/* skip past relative/absolute indication */
@@ -1918,7 +1918,7 @@ static void decode_symlink(char *name, int *is_dir)
p++;
if (*p++ != '/')
{
- return;
+ return NULL;
}
/* decode the reparse tag */
reparse_tag = 0;
@@ -1932,7 +1932,7 @@ static void decode_symlink(char *name, int *is_dir)
else if (c == '.' && *p++ == '/')
val = 1;
else
- return;
+ return NULL;
reparse_tag |= (val << i);
}
/* decode the directory/file flag */
@@ -1945,10 +1945,69 @@ static void decode_symlink(char *name, int *is_dir)
else if (c == '.' && *p++ == '/')
*is_dir = TRUE;
else
- return;
+ return NULL;
}
else
*is_dir = TRUE;
+ if (tag) *tag = reparse_tag;
+ return p;
+}
+
+static void rewrite_symlink( const char *path )
+{
+ static char marker[] = "////.//.//"; /* "P" (0x50) encoded as a path (0=/ 1=./) */
+ char *link, *prefix_end, *local_link;
+ static char config_dir[MAX_PATH];
+ static int config_dir_len = 0;
+ char new_target[PATH_MAX];
+ int len, is_dir, i;
+ ULONG tag;
+
+ /* obtain the wine prefix path */
+ if (!config_dir_len)
+ {
+ char tmp_dir[MAX_PATH];
+
+ if (getcwd( tmp_dir, sizeof(tmp_dir) ) == NULL) return;
+ if (fchdir( config_dir_fd ) == -1) return;
+ if (getcwd( config_dir, sizeof(config_dir) ) == NULL) return;
+ if (chdir( tmp_dir ) == -1) return;
+ config_dir_len = strlen( config_dir );
+ }
+
+ /* grab the current link contents */
+ link = decode_symlink( path, &tag, &is_dir );
+ if (link == NULL) return;
+
+ /* find out if the prefix matches, if it does then do not modify the link */
+ prefix_end = strstr( link, marker );
+ if (prefix_end == NULL) return;
+ local_link = prefix_end + strlen( marker );
+ len = prefix_end - link;
+ if (len == config_dir_len && strncmp( config_dir, link, len ) == 0) return;
+ /* if the prefix does not match then re-encode the link with the new prefix */
+
+ /* Encode the reparse tag into the symlink */
+ strcpy( new_target, "/" );
+ for (i = 0; i < sizeof(ULONG)*8; i++)
+ {
+ if ((tag >> i) & 1)
+ strcat( new_target, "." );
+ strcat( new_target, "/" );
+ }
+ /* Encode the type (file or directory) if NT symlink */
+ if (tag == IO_REPARSE_TAG_SYMLINK)
+ {
+ if (is_dir)
+ strcat( new_target, "." );
+ strcat( new_target, "/" );
+ }
+ strcat( new_target, config_dir );
+ strcat( new_target, marker );
+ strcat( new_target, local_link );
+ /* replace the symlink */
+ unlink( path );
+ symlink( new_target, path );
}
/* open() wrapper that returns a struct fd with no fd user set */
@@ -2016,6 +2075,15 @@ struct fd *open_fd( struct fd *root, const char *name, struct unicode_str nt_nam
flags |= O_SYMLINK;
#endif
+ fd->unix_name = NULL;
+ if ((path = dup_fd_name( root, name )))
+ {
+ rewrite_symlink( path );
+ fd->unlink_name = path;
+ fd->unix_name = realpath( path, NULL );
+ if (!fd->unix_name) fd->unix_name = dup_fd_name( root, name ); /* dangling symlink */
+ }
+
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 */
@@ -2033,13 +2101,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 );
- fd->unix_name = NULL;
- if ((path = dup_fd_name( root, name )))
- {
- fd->unlink_name = path;
- fd->unix_name = realpath( path, NULL );
- if (!fd->unix_name) fd->unix_name = dup_fd_name( root, name ); /* dangling symlink */
- }
closed_fd->unix_fd = fd->unix_fd;
closed_fd->unlink = 0;
@@ -2073,7 +2134,7 @@ struct fd *open_fd( struct fd *root, const char *name, struct unicode_str nt_nam
*mode = st.st_mode;
is_dir = S_ISDIR(st.st_mode);
if (is_link)
- decode_symlink(fd->unlink_name, &is_dir);
+ decode_symlink(fd->unlink_name, NULL, &is_dir);
/* check directory options */
if ((options & FILE_DIRECTORY_FILE) && !is_dir)
--
2.20.1

View File

@ -1,5 +1,4 @@
Fixes: [12401] NET Framework 2.0, 3.0, 4.0 installers and other apps that make use of GAC API for managed assembly installation on NTFS filesystems need reparse point/junction API support (FSCTL_SET_REPARSE_POINT/FSCTL_GET_REPARSE_POINT)
Fixes: [44948] Multiple apps (Spine (Mod starter for Gothic), MS Office 365 installer) need CreateSymbolicLinkW implementation
# FIXME: patch 0006 was broken by e36a9c459d. We really want to get that information from ntdll instead, but the how is not trivial...
Depends: ntdll-DOS_Attributes
Depends: ntdll-NtQueryEaFile

View File

@ -1,106 +0,0 @@
From a796dda4d4b7676ef758245f712ed4891902043c Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
Date: Thu, 16 Jan 2014 21:03:47 -0700
Subject: kernel32: Advertise junction point support.
TODO: this patch requires an update that is dependent upon obtaining
volume information through mountmgr.
Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
---
dlls/kernelbase/volume.c | 72 +++++++++++++++++++++++++++++++++++++++-
1 file changed, 71 insertions(+), 1 deletion(-)
diff --git a/dlls/kernelbase/volume.c b/dlls/kernelbase/volume.c
index 53cc0d49b65..f58909d321d 100644
--- a/dlls/kernelbase/volume.c
+++ b/dlls/kernelbase/volume.c
@@ -646,6 +646,75 @@ static DWORD get_audiocd_serial( const CDROM_TOC *toc )
}
+static DWORD WINAPI get_fs_flags( UNICODE_STRING *nt_name )
+{
+#if defined(__NR_renameat2) || defined(RENAME_SWAP)
+ ANSI_STRING unix_name;
+#if defined(HAVE_FSTATFS)
+ struct statfs stfs;
+#elif defined(HAVE_FSTATVFS)
+ struct statvfs stfs;
+#endif
+ NTSTATUS status;
+ DWORD flags = 0;
+
+ status = wine_nt_to_unix_file_name( nt_name, &unix_name, FILE_OPEN, FALSE );
+ if (status != STATUS_SUCCESS)
+ return flags;
+#if defined(HAVE_FSTATFS)
+ if (statfs(unix_name.Buffer, &stfs))
+ return flags;
+#elif defined(HAVE_FSTATVFS)
+ if (statvfs(unix_name.Buffer, &stfs))
+ return flags;
+#endif
+#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 */
+ flags |= FILE_SUPPORTS_REPARSE_POINTS;
+ break;
+ 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))
+ {
+ flags |= FILE_SUPPORTS_REPARSE_POINTS;
+ }
+#endif
+ RtlFreeAnsiString( &unix_name );
+ return flags;
+#else
+ return 0;
+#endif
+}
+
+
/***********************************************************************
* GetVolumeInformationW (kernelbase.@)
*/
@@ -781,7 +850,8 @@ fill_fs_info: /* now fill in the information that depends on the file system ty
default:
if (fsname) lstrcpynW( fsname, L"NTFS", fsname_len );
if (filename_len) *filename_len = 255;
- if (flags) *flags = FILE_CASE_PRESERVED_NAMES | FILE_PERSISTENT_ACLS;
+ if (flags) *flags = FILE_CASE_PRESERVED_NAMES | FILE_PERSISTENT_ACLS
+ | get_fs_flags( &nt_name );
break;
}
ret = TRUE;
--
2.17.1

View File

@ -2386,9 +2386,10 @@ fi
# | * [#44948] Multiple apps (Spine (Mod starter for Gothic), MS Office 365 installer) need CreateSymbolicLinkW implementation
# |
# | Modified files:
# | * configure.ac, dlls/kernel32/path.c, dlls/kernel32/tests/path.c, dlls/kernelbase/file.c, dlls/msvcp120/tests/msvcp120.c,
# | dlls/msvcp140/tests/msvcp140.c, dlls/ntdll/tests/file.c, dlls/ntdll/unix/file.c, include/Makefile.in, include/ntifs.h,
# | include/winternl.h, programs/cmd/builtins.c, programs/cmd/directory.c, server/fd.c, server/file.c, server/protocol.def
# | * configure.ac, dlls/kernel32/path.c, dlls/kernel32/tests/path.c, dlls/kernelbase/file.c, dlls/mountmgr.sys/device.c,
# | dlls/msvcp120/tests/msvcp120.c, dlls/msvcp140/tests/msvcp140.c, dlls/ntdll/tests/file.c, dlls/ntdll/unix/file.c,
# | include/Makefile.in, include/ntifs.h, include/winternl.h, programs/cmd/builtins.c, programs/cmd/directory.c,
# | server/fd.c, server/file.c, server/protocol.def
# |
if test "$enable_ntdll_Junction_Points" -eq 1; then
patch_apply ntdll-Junction_Points/0001-ntdll-Add-support-for-junction-point-creation.patch
@ -2396,6 +2397,7 @@ if test "$enable_ntdll_Junction_Points" -eq 1; then
patch_apply ntdll-Junction_Points/0003-ntdll-Add-support-for-deleting-junction-points.patch
patch_apply ntdll-Junction_Points/0004-ntdll-Add-a-test-for-junction-point-advertisement.patch
patch_apply ntdll-Junction_Points/0005-server-Add-support-for-deleting-junction-points-with.patch
patch_apply ntdll-Junction_Points/0006-kernel32-Advertise-junction-point-support.patch
patch_apply ntdll-Junction_Points/0007-ntdll-Add-support-for-absolute-symlink-creation.patch
patch_apply ntdll-Junction_Points/0008-ntdll-Add-support-for-reading-absolute-symlinks.patch
patch_apply ntdll-Junction_Points/0009-ntdll-Add-support-for-deleting-symlinks.patch
@ -2421,6 +2423,13 @@ if test "$enable_ntdll_Junction_Points" -eq 1; then
patch_apply ntdll-Junction_Points/0029-ntdll-Succeed-with-no-data-for-NtReadFile-on-reparse.patch
patch_apply ntdll-Junction_Points/0030-ntdll-Support-reparse-point-properties-in-fd_get_fil.patch
patch_apply ntdll-Junction_Points/0031-ntdll-Add-support-for-FileAttributeTagInformation.patch
patch_apply ntdll-Junction_Points/0032-server-Properly-handle-renames-involving-symlinks.patch
patch_apply ntdll-Junction_Points/0033-kernelbase-Use-FILE_OPEN_REPARSE_POINT-in-MoveFileWi.patch
patch_apply ntdll-Junction_Points/0034-kernelbase-Use-FILE_OPEN_REPARSE_POINT-in-DeleteFile.patch
patch_apply ntdll-Junction_Points/0035-ntdll-Treat-undecoded-unix-symlinks-as-NT-symlinks.patch
patch_apply ntdll-Junction_Points/0036-ntdll-Strip-the-wine-prefix-from-reparse-point-paths.patch
patch_apply ntdll-Junction_Points/0037-ntdll-Add-a-marker-to-reparse-point-paths-to-indicat.patch
patch_apply ntdll-Junction_Points/0038-server-Rewrite-absolute-reparse-point-targets-if-the.patch
fi
# Patchset server-PeekMessage