mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2025-04-13 14:42:51 -07:00
Updated ntdll-Junction_Points patchset
Changed dependencies to allow ntdll-Junction_Points to be applied on top of wine.
This commit is contained in:
parent
9e53a45319
commit
a0708adf42
@ -9,3 +9,4 @@ Depends: server-Realtime_Priority
|
||||
Depends: ntdll-User_Shared_Data
|
||||
Depends: server-Misc_ACL
|
||||
Depends: advapi32-Token_Integrity_Level
|
||||
Depends: ntdll-Junction_Points
|
||||
|
@ -1,4 +1,4 @@
|
||||
From da5af62afac8508b3323098bb004b87ffde77701 Mon Sep 17 00:00:00 2001
|
||||
From 935694ac40ed4b264ef0ede519bd8b9b2f1f28de Mon Sep 17 00:00:00 2001
|
||||
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
|
||||
Date: Tue, 19 Aug 2014 22:10:49 -0600
|
||||
Subject: [PATCH] ntdll: Implement retrieving DOS attributes in
|
||||
@ -14,10 +14,10 @@ Subject: [PATCH] ntdll: Implement retrieving DOS attributes in
|
||||
create mode 100644 libs/port/xattr.c
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index c80d9b1..745bf2b 100644
|
||||
index 1905733..6f0429e 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -84,6 +84,7 @@ AC_ARG_WITH(udev, AS_HELP_STRING([--without-udev],[do not use udev (plug an
|
||||
@@ -85,6 +85,7 @@ AC_ARG_WITH(udev, AS_HELP_STRING([--without-udev],[do not use udev (plug an
|
||||
AC_ARG_WITH(v4l2, AS_HELP_STRING([--without-v4l2],[do not use v4l2 (video capture)]))
|
||||
AC_ARG_WITH(vkd3d, AS_HELP_STRING([--without-vkd3d],[do not use vkd3d (Direct3D 12 support)]))
|
||||
AC_ARG_WITH(vulkan, AS_HELP_STRING([--without-vulkan],[do not use Vulkan]))
|
||||
@ -25,7 +25,7 @@ index c80d9b1..745bf2b 100644
|
||||
AC_ARG_WITH(xcomposite,AS_HELP_STRING([--without-xcomposite],[do not use the Xcomposite extension]),
|
||||
[if test "x$withval" = "xno"; then ac_cv_header_X11_extensions_Xcomposite_h=no; fi])
|
||||
AC_ARG_WITH(xcursor, AS_HELP_STRING([--without-xcursor],[do not use the Xcursor extension]),
|
||||
@@ -703,6 +704,17 @@ AC_CHECK_HEADERS([libprocstat.h],,,
|
||||
@@ -698,6 +699,17 @@ AC_CHECK_HEADERS([libprocstat.h],,,
|
||||
#include <sys/socket.h>
|
||||
#endif])
|
||||
|
||||
@ -44,12 +44,12 @@ index c80d9b1..745bf2b 100644
|
||||
|
||||
AC_SUBST(DLLFLAGS,"-D_REENTRANT")
|
||||
diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c
|
||||
index 4960e91..5957c44 100644
|
||||
index 919eaea..1ffa675 100644
|
||||
--- a/dlls/ntdll/file.c
|
||||
+++ b/dlls/ntdll/file.c
|
||||
@@ -122,6 +122,22 @@ mode_t FILE_umask = 0;
|
||||
|
||||
static const WCHAR ntfsW[] = {'N','T','F','S'};
|
||||
@@ -127,6 +127,22 @@ static const WCHAR ntfsW[] = {'N','T','F','S'};
|
||||
NTSTATUS FILE_DecodeSymlink(const char *unix_src, char *unix_dest, USHORT *unix_dest_len,
|
||||
DWORD *tag, ULONG *flags, BOOL *is_dir);
|
||||
|
||||
+/* Match the Samba conventions for storing DOS file attributes */
|
||||
+#define SAMBA_XATTR_DOS_ATTRIB XATTR_USER_PREFIX "DOSATTRIB"
|
||||
@ -70,7 +70,7 @@ index 4960e91..5957c44 100644
|
||||
/* fetch the attributes of a file */
|
||||
static inline ULONG get_file_attributes( const struct stat *st )
|
||||
{
|
||||
@@ -139,12 +155,16 @@ static inline ULONG get_file_attributes( const struct stat *st )
|
||||
@@ -144,12 +160,16 @@ static inline ULONG get_file_attributes( const struct stat *st )
|
||||
/* get the stat info and file attributes for a file (by file descriptor) */
|
||||
int fd_get_file_info( int fd, struct stat *st, ULONG *attr )
|
||||
{
|
||||
@ -89,10 +89,10 @@ index 4960e91..5957c44 100644
|
||||
}
|
||||
|
||||
diff --git a/include/wine/port.h b/include/wine/port.h
|
||||
index 2f6e9eb..b21d045 100644
|
||||
index 19c8682..eaa23bc 100644
|
||||
--- a/include/wine/port.h
|
||||
+++ b/include/wine/port.h
|
||||
@@ -335,6 +335,14 @@ int usleep (unsigned int useconds);
|
||||
@@ -344,6 +344,14 @@ int usleep (unsigned int useconds);
|
||||
|
||||
extern int mkstemps(char *template, int suffix_len);
|
||||
|
||||
@ -108,10 +108,10 @@ index 2f6e9eb..b21d045 100644
|
||||
|
||||
#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
|
||||
diff --git a/libs/port/Makefile.in b/libs/port/Makefile.in
|
||||
index a2e96d1..b975418 100644
|
||||
index db27249..790fd96 100644
|
||||
--- a/libs/port/Makefile.in
|
||||
+++ b/libs/port/Makefile.in
|
||||
@@ -108,4 +108,6 @@ C_SRCS = \
|
||||
@@ -109,4 +109,6 @@ C_SRCS = \
|
||||
usleep.c \
|
||||
utf8.c \
|
||||
wctomb.c \
|
||||
|
@ -1,7 +1,7 @@
|
||||
From f6b156b5bccac55814eeee4fd10013ea3a76f384 Mon Sep 17 00:00:00 2001
|
||||
From 938f92470a25e590523f78912301177580c61955 Mon Sep 17 00:00:00 2001
|
||||
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
|
||||
Date: Wed, 20 Aug 2014 16:04:34 -0600
|
||||
Subject: ntdll: Implement retrieving DOS attributes in
|
||||
Subject: [PATCH] ntdll: Implement retrieving DOS attributes in
|
||||
NtQuery[Full]AttributesFile and NtQueryDirectoryFile.
|
||||
|
||||
---
|
||||
@ -11,10 +11,10 @@ Subject: ntdll: Implement retrieving DOS attributes in
|
||||
3 files changed, 16 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c
|
||||
index 83d07e2..b977e45 100644
|
||||
index 1ffa675..78ab0ec 100644
|
||||
--- a/dlls/ntdll/file.c
|
||||
+++ b/dlls/ntdll/file.c
|
||||
@@ -152,7 +152,8 @@ int fd_get_file_info( int fd, struct stat *st, ULONG *attr )
|
||||
@@ -176,7 +176,8 @@ int fd_get_file_info( int fd, struct stat *st, ULONG *attr )
|
||||
/* get the stat info and file attributes for a file (by name) */
|
||||
int get_file_info( const char *path, struct stat *st, ULONG *attr )
|
||||
{
|
||||
@ -24,8 +24,8 @@ index 83d07e2..b977e45 100644
|
||||
|
||||
*attr = 0;
|
||||
ret = lstat( path, st );
|
||||
@@ -165,6 +166,9 @@ int get_file_info( const char *path, struct stat *st, ULONG *attr )
|
||||
if (S_ISDIR( st->st_mode )) *attr |= FILE_ATTRIBUTE_REPARSE_POINT;
|
||||
@@ -193,6 +194,9 @@ int get_file_info( const char *path, struct stat *st, ULONG *attr )
|
||||
st->st_mode = (st->st_mode & ~S_IFMT) | (is_dir ? S_IFDIR : S_IFREG);
|
||||
}
|
||||
*attr |= get_file_attributes( st );
|
||||
+ len = xattr_get( path, SAMBA_XATTR_DOS_ATTRIB, hexattr, sizeof(hexattr)-1 );
|
||||
@ -35,10 +35,10 @@ index 83d07e2..b977e45 100644
|
||||
}
|
||||
|
||||
diff --git a/include/wine/port.h b/include/wine/port.h
|
||||
index 521246b..7977eb9 100644
|
||||
index eaa23bc..de6b995 100644
|
||||
--- a/include/wine/port.h
|
||||
+++ b/include/wine/port.h
|
||||
@@ -370,6 +370,7 @@ extern int _spawnvp(int mode, const char *cmdname, const char * const argv[]);
|
||||
@@ -351,6 +351,7 @@ extern int mkstemps(char *template, int suffix_len);
|
||||
#endif
|
||||
|
||||
extern int xattr_fget( int filedes, const char *name, void *value, size_t size );
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 92eada413d3bc9e95d1d00478daf9a06fd3e587e Mon Sep 17 00:00:00 2001
|
||||
From a0b58c6366226c2079da60a4b5d757da4bd728b6 Mon Sep 17 00:00:00 2001
|
||||
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
|
||||
Date: Wed, 20 Aug 2014 11:26:48 -0600
|
||||
Subject: [PATCH] ntdll: Perform the Unix-style hidden file check within the
|
||||
@ -11,7 +11,7 @@ Subject: [PATCH] ntdll: Perform the Unix-style hidden file check within the
|
||||
3 files changed, 10 insertions(+), 17 deletions(-)
|
||||
|
||||
diff --git a/dlls/ntdll/directory.c b/dlls/ntdll/directory.c
|
||||
index 4655a634..511a345 100644
|
||||
index c853470..56737b8 100644
|
||||
--- a/dlls/ntdll/directory.c
|
||||
+++ b/dlls/ntdll/directory.c
|
||||
@@ -1267,17 +1267,17 @@ static DWORD WINAPI init_options( RTL_RUN_ONCE *once, void *param, void **contex
|
||||
@ -50,11 +50,11 @@ index 4655a634..511a345 100644
|
||||
}
|
||||
|
||||
diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c
|
||||
index 3a96d3b..b2b88d6 100644
|
||||
index 0dbf612..5926c99 100644
|
||||
--- a/dlls/ntdll/file.c
|
||||
+++ b/dlls/ntdll/file.c
|
||||
@@ -218,6 +218,10 @@ int get_file_info( const char *path, struct stat *st, ULONG *attr )
|
||||
if (S_ISDIR( st->st_mode )) *attr |= FILE_ATTRIBUTE_REPARSE_POINT;
|
||||
@@ -227,6 +227,10 @@ int get_file_info( const char *path, struct stat *st, ULONG *attr )
|
||||
st->st_mode = (st->st_mode & ~S_IFMT) | (is_dir ? S_IFDIR : S_IFREG);
|
||||
}
|
||||
*attr |= get_file_attributes( st );
|
||||
+ /* convert Unix-style hidden files to a DOS hidden file attribute */
|
||||
@ -64,7 +64,7 @@ index 3a96d3b..b2b88d6 100644
|
||||
len = xattr_get( path, SAMBA_XATTR_DOS_ATTRIB, hexattr, sizeof(hexattr)-1 );
|
||||
if (len == -1) return ret;
|
||||
*attr |= get_file_xattr( hexattr, len );
|
||||
@@ -3023,8 +3027,6 @@ NTSTATUS WINAPI NtQueryFullAttributesFile( const OBJECT_ATTRIBUTES *attr,
|
||||
@@ -3447,8 +3451,6 @@ NTSTATUS WINAPI NtQueryFullAttributesFile( const OBJECT_ATTRIBUTES *attr,
|
||||
info->AllocationSize = std.AllocationSize;
|
||||
info->EndOfFile = std.EndOfFile;
|
||||
info->FileAttributes = basic.FileAttributes;
|
||||
@ -73,7 +73,7 @@ index 3a96d3b..b2b88d6 100644
|
||||
}
|
||||
RtlFreeAnsiString( &unix_name );
|
||||
}
|
||||
@@ -3052,11 +3054,7 @@ NTSTATUS WINAPI NtQueryAttributesFile( const OBJECT_ATTRIBUTES *attr, FILE_BASIC
|
||||
@@ -3476,11 +3478,7 @@ NTSTATUS WINAPI NtQueryAttributesFile( const OBJECT_ATTRIBUTES *attr, FILE_BASIC
|
||||
else if (!S_ISREG(st.st_mode) && !S_ISDIR(st.st_mode))
|
||||
status = STATUS_INVALID_INFO_CLASS;
|
||||
else
|
||||
@ -86,10 +86,10 @@ index 3a96d3b..b2b88d6 100644
|
||||
}
|
||||
else WARN("%s not found (%x)\n", debugstr_us(attr->ObjectName), status );
|
||||
diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h
|
||||
index 01a7636..2a8c67b 100644
|
||||
index b762ceb..32db62e 100644
|
||||
--- a/dlls/ntdll/ntdll_misc.h
|
||||
+++ b/dlls/ntdll/ntdll_misc.h
|
||||
@@ -160,7 +160,7 @@ extern NTSTATUS fill_file_info( const struct stat *st, ULONG attr, void *ptr,
|
||||
@@ -164,7 +164,7 @@ extern NTSTATUS fill_file_info( const struct stat *st, ULONG attr, void *ptr,
|
||||
FILE_INFORMATION_CLASS class ) DECLSPEC_HIDDEN;
|
||||
extern NTSTATUS server_get_unix_name( HANDLE handle, ANSI_STRING *unix_name ) DECLSPEC_HIDDEN;
|
||||
extern void init_directories(void) DECLSPEC_HIDDEN;
|
||||
|
@ -1,7 +1,7 @@
|
||||
From 5a419298c1871c0d71a2892d6ac4b517288b3563 Mon Sep 17 00:00:00 2001
|
||||
From 1fe0fcb904363d5ac59b8d30a918f62f622b78b7 Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Thu, 14 Jan 2016 23:09:19 +0100
|
||||
Subject: ntdll: Always store SAMBA_XATTR_DOS_ATTRIB when path could be
|
||||
Subject: [PATCH] ntdll: Always store SAMBA_XATTR_DOS_ATTRIB when path could be
|
||||
interpreted as hidden.
|
||||
|
||||
---
|
||||
@ -9,11 +9,11 @@ Subject: ntdll: Always store SAMBA_XATTR_DOS_ATTRIB when path could be
|
||||
1 file changed, 8 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c
|
||||
index 50b0042..b38698f 100644
|
||||
index 5926c99..cbd2531 100644
|
||||
--- a/dlls/ntdll/file.c
|
||||
+++ b/dlls/ntdll/file.c
|
||||
@@ -213,12 +213,15 @@ int get_file_info( const char *path, struct stat *st, ULONG *attr )
|
||||
if (S_ISDIR( st->st_mode )) *attr |= FILE_ATTRIBUTE_REPARSE_POINT;
|
||||
@@ -227,12 +227,15 @@ int get_file_info( const char *path, struct stat *st, ULONG *attr )
|
||||
st->st_mode = (st->st_mode & ~S_IFMT) | (is_dir ? S_IFDIR : S_IFREG);
|
||||
}
|
||||
*attr |= get_file_attributes( st );
|
||||
- /* convert Unix-style hidden files to a DOS hidden file attribute */
|
||||
@ -32,7 +32,7 @@ index 50b0042..b38698f 100644
|
||||
*attr |= get_file_xattr( hexattr, len );
|
||||
return ret;
|
||||
}
|
||||
@@ -231,7 +234,7 @@ NTSTATUS set_file_info( const char *path, ULONG attr )
|
||||
@@ -245,7 +248,7 @@ NTSTATUS set_file_info( const char *path, ULONG attr )
|
||||
/* Note: unix mode already set when called this way */
|
||||
attr &= ~FILE_ATTRIBUTE_NORMAL; /* do not store everything, but keep everything Samba can use */
|
||||
len = sprintf( hexattr, "0x%x", attr );
|
||||
@ -42,5 +42,5 @@ index 50b0042..b38698f 100644
|
||||
else
|
||||
xattr_remove( path, SAMBA_XATTR_DOS_ATTRIB );
|
||||
--
|
||||
2.6.4
|
||||
1.9.1
|
||||
|
||||
|
@ -1,27 +1,27 @@
|
||||
From 0d2ea784da8e7b644da39d00852b7470cc3b634e Mon Sep 17 00:00:00 2001
|
||||
From 5d45f1a04195f1b058de18586db78367e8fb94ee Mon Sep 17 00:00:00 2001
|
||||
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
|
||||
Date: Thu, 16 Jan 2014 20:56:49 -0700
|
||||
Subject: [PATCH] ntdll: Add support for junction point creation.
|
||||
Subject: ntdll: Add support for junction point creation.
|
||||
|
||||
Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
|
||||
---
|
||||
configure.ac | 1 +
|
||||
dlls/ntdll/file.c | 116 ++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
dlls/ntdll/tests/file.c | 101 +++++++++++++++++++++++++++++++++++++++++
|
||||
dlls/ntdll/file.c | 116 ++++++++++++++++++++++++++++++++++++++++
|
||||
dlls/ntdll/tests/file.c | 101 ++++++++++++++++++++++++++++++++++
|
||||
include/Makefile.in | 1 +
|
||||
include/ntifs.h | 42 ++++++++++++++++++
|
||||
include/ntifs.h | 42 +++++++++++++++
|
||||
include/wine/port.h | 9 ++++
|
||||
libs/port/Makefile.in | 1 +
|
||||
libs/port/renameat2.c | 44 ++++++++++++++++++
|
||||
libs/port/renameat2.c | 44 +++++++++++++++
|
||||
8 files changed, 315 insertions(+)
|
||||
create mode 100644 include/ntifs.h
|
||||
create mode 100644 libs/port/renameat2.c
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index cf896c1..3275061 100644
|
||||
index 611dc69c2e..c567f32d57 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -2219,6 +2219,7 @@ AC_CHECK_FUNCS(\
|
||||
@@ -2179,6 +2179,7 @@ AC_CHECK_FUNCS(\
|
||||
pwrite \
|
||||
readdir \
|
||||
readlink \
|
||||
@ -30,7 +30,7 @@ index cf896c1..3275061 100644
|
||||
select \
|
||||
setproctitle \
|
||||
diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c
|
||||
index c1de955..6337cc8 100644
|
||||
index 3dafdcfb44..5f2da14398 100644
|
||||
--- a/dlls/ntdll/file.c
|
||||
+++ b/dlls/ntdll/file.c
|
||||
@@ -21,6 +21,7 @@
|
||||
@ -49,7 +49,7 @@ index c1de955..6337cc8 100644
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(ntdll);
|
||||
WINE_DECLARE_DEBUG_CHANNEL(winediag);
|
||||
@@ -1746,6 +1748,102 @@ NTSTATUS WINAPI NtDeviceIoControlFile(HANDLE handle, HANDLE event,
|
||||
@@ -1648,6 +1650,102 @@ NTSTATUS WINAPI NtDeviceIoControlFile(HANDLE handle, HANDLE event,
|
||||
}
|
||||
|
||||
|
||||
@ -152,7 +152,7 @@ index c1de955..6337cc8 100644
|
||||
/**************************************************************************
|
||||
* NtFsControlFile [NTDLL.@]
|
||||
* ZwFsControlFile [NTDLL.@]
|
||||
@@ -1830,6 +1928,24 @@ NTSTATUS WINAPI NtFsControlFile(HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc
|
||||
@@ -1732,6 +1830,24 @@ NTSTATUS WINAPI NtFsControlFile(HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc
|
||||
io->Information = 0;
|
||||
status = STATUS_SUCCESS;
|
||||
break;
|
||||
@ -178,7 +178,7 @@ index c1de955..6337cc8 100644
|
||||
return server_ioctl_file( handle, event, apc, apc_context, io, code,
|
||||
in_buffer, in_size, out_buffer, out_size );
|
||||
diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c
|
||||
index 74adf4c..1eedfaa 100644
|
||||
index 8e54dbb541..322dadefe3 100644
|
||||
--- a/dlls/ntdll/tests/file.c
|
||||
+++ b/dlls/ntdll/tests/file.c
|
||||
@@ -38,6 +38,7 @@
|
||||
@ -189,7 +189,7 @@ index 74adf4c..1eedfaa 100644
|
||||
|
||||
#ifndef IO_COMPLETION_ALL_ACCESS
|
||||
#define IO_COMPLETION_ALL_ACCESS 0x001F0003
|
||||
@@ -5050,6 +5051,105 @@ static void test_file_readonly_access(void)
|
||||
@@ -4831,6 +4832,105 @@ static void test_file_readonly_access(void)
|
||||
DeleteFileW(path);
|
||||
}
|
||||
|
||||
@ -295,19 +295,17 @@ index 74adf4c..1eedfaa 100644
|
||||
START_TEST(file)
|
||||
{
|
||||
HMODULE hkernel32 = GetModuleHandleA("kernel32.dll");
|
||||
@@ -5120,6 +5220,7 @@ START_TEST(file)
|
||||
test_query_volume_information_file();
|
||||
@@ -4900,4 +5000,5 @@ START_TEST(file)
|
||||
test_query_attribute_information_file();
|
||||
test_ioctl();
|
||||
+ test_reparse_points();
|
||||
test_flush_buffers_file();
|
||||
test_query_ea();
|
||||
+ test_reparse_points();
|
||||
}
|
||||
diff --git a/include/Makefile.in b/include/Makefile.in
|
||||
index 31a811d..eeeff7b 100644
|
||||
index 09c84d8254..616f265900 100644
|
||||
--- a/include/Makefile.in
|
||||
+++ b/include/Makefile.in
|
||||
@@ -482,6 +482,7 @@ SOURCES = \
|
||||
@@ -479,6 +479,7 @@ SOURCES = \
|
||||
ntddvdeo.h \
|
||||
ntdef.h \
|
||||
ntdsapi.h \
|
||||
@ -317,7 +315,7 @@ index 31a811d..eeeff7b 100644
|
||||
ntsecapi.h \
|
||||
diff --git a/include/ntifs.h b/include/ntifs.h
|
||||
new file mode 100644
|
||||
index 0000000..21d42e1
|
||||
index 0000000000..21d42e1732
|
||||
--- /dev/null
|
||||
+++ b/include/ntifs.h
|
||||
@@ -0,0 +1,42 @@
|
||||
@ -364,7 +362,7 @@ index 0000000..21d42e1
|
||||
+
|
||||
+#endif /* __WINE_NTIFS_H */
|
||||
diff --git a/include/wine/port.h b/include/wine/port.h
|
||||
index 2b8a069..4bbf999 100644
|
||||
index d23e2b033f..26c5890ddb 100644
|
||||
--- a/include/wine/port.h
|
||||
+++ b/include/wine/port.h
|
||||
@@ -317,6 +317,15 @@ double rint(double x);
|
||||
@ -384,7 +382,7 @@ index 2b8a069..4bbf999 100644
|
||||
int statvfs( const char *path, struct statvfs *buf );
|
||||
#endif
|
||||
diff --git a/libs/port/Makefile.in b/libs/port/Makefile.in
|
||||
index b975418..790fd96 100644
|
||||
index a2e96d1500..db27249ac1 100644
|
||||
--- a/libs/port/Makefile.in
|
||||
+++ b/libs/port/Makefile.in
|
||||
@@ -97,6 +97,7 @@ C_SRCS = \
|
||||
@ -397,7 +395,7 @@ index b975418..790fd96 100644
|
||||
spawn.c \
|
||||
diff --git a/libs/port/renameat2.c b/libs/port/renameat2.c
|
||||
new file mode 100644
|
||||
index 0000000..39b4053
|
||||
index 0000000000..39b4053f91
|
||||
--- /dev/null
|
||||
+++ b/libs/port/renameat2.c
|
||||
@@ -0,0 +1,44 @@
|
||||
@ -446,5 +444,5 @@ index 0000000..39b4053
|
||||
+}
|
||||
+#endif /* HAVE_RENAMEAT2 */
|
||||
--
|
||||
1.9.1
|
||||
2.17.1
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 47cc80d8a94523f36a19906b8d647f3e58e346ef Mon Sep 17 00:00:00 2001
|
||||
From 7c01bde97a63851a367aa0bd76c9aee398857b4e 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.
|
||||
|
@ -1,20 +1,20 @@
|
||||
From 272ed659e67adc42778e428ac4b74d2844dc9ad5 Mon Sep 17 00:00:00 2001
|
||||
From 8e8839dfe0b2eeae7b0d124b65725257792e3813 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.
|
||||
|
||||
Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
|
||||
---
|
||||
dlls/ntdll/file.c | 51 +++++++++++++++++++++++++++++++++++++++++
|
||||
dlls/ntdll/tests/file.c | 23 ++++++++++++++++++-
|
||||
include/ntifs.h | 12 ++++++++++
|
||||
3 files changed, 85 insertions(+), 1 deletion(-)
|
||||
dlls/ntdll/file.c | 96 +++++++++++++++++++++++++++++++++++++++++
|
||||
dlls/ntdll/tests/file.c | 23 +++++++++-
|
||||
include/ntifs.h | 12 ++++++
|
||||
3 files changed, 130 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c
|
||||
index ee561d9268..2effe7efb0 100644
|
||||
index ee561d9268..1730d816d9 100644
|
||||
--- a/dlls/ntdll/file.c
|
||||
+++ b/dlls/ntdll/file.c
|
||||
@@ -1846,6 +1846,41 @@ cleanup:
|
||||
@@ -1846,6 +1846,86 @@ cleanup:
|
||||
}
|
||||
|
||||
|
||||
@ -24,9 +24,12 @@ index ee561d9268..2effe7efb0 100644
|
||||
+ */
|
||||
+NTSTATUS FILE_RemoveSymlink(HANDLE handle, REPARSE_GUID_DATA_BUFFER *buffer)
|
||||
+{
|
||||
+ char tmpdir[PATH_MAX], tmpfile[PATH_MAX];
|
||||
+ BOOL tempdir_created = FALSE;
|
||||
+ int dest_fd, needs_close;
|
||||
+ ANSI_STRING unix_name;
|
||||
+ NTSTATUS status;
|
||||
+ struct stat st;
|
||||
+
|
||||
+ if ((status = server_get_unix_fd( handle, FILE_SPECIAL_ACCESS, &dest_fd, &needs_close, NULL, NULL )))
|
||||
+ return status;
|
||||
@ -35,12 +38,53 @@ index ee561d9268..2effe7efb0 100644
|
||||
+ goto cleanup;
|
||||
+
|
||||
+ TRACE("Deleting symlink %s\n", unix_name.Buffer);
|
||||
+ if (unlink( unix_name.Buffer ) < 0)
|
||||
+
|
||||
+ /* Produce the directory in a temporary location in the same folder */
|
||||
+ if (fstat( dest_fd, &st ) == -1)
|
||||
+ {
|
||||
+ status = FILE_GetNtStatus();
|
||||
+ goto cleanup;
|
||||
+ }
|
||||
+ if (mkdir( unix_name.Buffer, 0775 ) < 0)
|
||||
+ strcpy( tmpdir, unix_name.Buffer );
|
||||
+ dirname( tmpdir) ;
|
||||
+ strcat( tmpdir, "/.winelink.XXXXXX" );
|
||||
+ if (mkdtemp( tmpdir ) == NULL)
|
||||
+ {
|
||||
+ status = FILE_GetNtStatus();
|
||||
+ goto cleanup;
|
||||
+ }
|
||||
+ tempdir_created = TRUE;
|
||||
+ strcpy( tmpfile, tmpdir );
|
||||
+ strcat( tmpfile, "/tmpfile" );
|
||||
+ if (mkdir( tmpfile, st.st_mode ))
|
||||
+ {
|
||||
+ status = FILE_GetNtStatus();
|
||||
+ goto cleanup;
|
||||
+ }
|
||||
+ /* attemp to retain the ownership (if possible) */
|
||||
+ lchown( tmpfile, st.st_uid, st.st_gid );
|
||||
+ /* Atomically move the directory into position */
|
||||
+ if (!renameat2( -1, tmpfile, -1, unix_name.Buffer, RENAME_EXCHANGE ))
|
||||
+ {
|
||||
+ /* success: link and folder have switched locations */
|
||||
+ unlink( tmpfile ); /* remove the link (at folder location) */
|
||||
+ }
|
||||
+ else if (errno == ENOSYS)
|
||||
+ {
|
||||
+ FIXME( "Atomic exchange of directory with symbolic link unsupported on this system, "
|
||||
+ "using unsafe exchange instead.\n" );
|
||||
+ if (unlink( unix_name.Buffer ))
|
||||
+ {
|
||||
+ status = FILE_GetNtStatus();
|
||||
+ goto cleanup;
|
||||
+ }
|
||||
+ if (rename( tmpfile, unix_name.Buffer ))
|
||||
+ {
|
||||
+ status = FILE_GetNtStatus();
|
||||
+ goto cleanup; /* not moved, orignal file/folder at destination is orphaned */
|
||||
+ }
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ status = FILE_GetNtStatus();
|
||||
+ goto cleanup;
|
||||
@ -48,6 +92,7 @@ index ee561d9268..2effe7efb0 100644
|
||||
+ status = STATUS_SUCCESS;
|
||||
+
|
||||
+cleanup:
|
||||
+ if (tempdir_created) rmdir( tmpdir );
|
||||
+ if (needs_close) close( dest_fd );
|
||||
+ return status;
|
||||
+}
|
||||
@ -56,7 +101,7 @@ index ee561d9268..2effe7efb0 100644
|
||||
/**************************************************************************
|
||||
* NtFsControlFile [NTDLL.@]
|
||||
* ZwFsControlFile [NTDLL.@]
|
||||
@@ -1931,6 +1966,22 @@ NTSTATUS WINAPI NtFsControlFile(HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc
|
||||
@@ -1931,6 +2011,22 @@ NTSTATUS WINAPI NtFsControlFile(HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc
|
||||
status = STATUS_SUCCESS;
|
||||
break;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 719d62a3f338279f466d12a628a9e6ec78f65b00 Mon Sep 17 00:00:00 2001
|
||||
From c94b245b19d852b13048227551641c655c591da1 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.
|
||||
|
@ -1,4 +1,4 @@
|
||||
From a8eb436342b0f261ba09c0a4bb1a87f0a85b4d85 Mon Sep 17 00:00:00 2001
|
||||
From 8b1d430506bf0127a4782594937e1ae1505d64f0 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: kernel32,ntdll: Add support for deleting junction points with
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 4fe08afd847dc6c1c89eb90f647faafe0be2f4a8 Mon Sep 17 00:00:00 2001
|
||||
From 602c311b76c08f4d06c71ee0925ea7c3329d7d73 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.
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 084864a69084f9e01e53ee289681a342d1ec0a05 Mon Sep 17 00:00:00 2001
|
||||
From 6c1d1b1d7819118d3511aaa314a8e3da05f4c7ea 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.
|
||||
@ -11,7 +11,7 @@ Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
|
||||
3 files changed, 139 insertions(+), 15 deletions(-)
|
||||
|
||||
diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c
|
||||
index 2effe7efb0..00e3d7aa31 100644
|
||||
index 1730d816d9..78ea4c5b00 100644
|
||||
--- a/dlls/ntdll/file.c
|
||||
+++ b/dlls/ntdll/file.c
|
||||
@@ -1657,17 +1657,33 @@ NTSTATUS WINAPI NtDeviceIoControlFile(HANDLE handle, HANDLE event,
|
||||
@ -70,7 +70,7 @@ index 2effe7efb0..00e3d7aa31 100644
|
||||
strcat( magic_dest, unix_dest.Buffer );
|
||||
|
||||
/* Produce the link in a temporary location in the same folder */
|
||||
@@ -1995,6 +2023,7 @@ NTSTATUS WINAPI NtFsControlFile(HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc
|
||||
@@ -2040,6 +2068,7 @@ NTSTATUS WINAPI NtFsControlFile(HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc
|
||||
switch(buffer->ReparseTag)
|
||||
{
|
||||
case IO_REPARSE_TAG_MOUNT_POINT:
|
||||
|
@ -1,4 +1,4 @@
|
||||
From a482fa218dbe1284c8a08fba84c9f36dec4d3eba Mon Sep 17 00:00:00 2001
|
||||
From 498e0feb3c25f92c9930e4007259b12c6ff4e567 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.
|
||||
@ -10,7 +10,7 @@ Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
|
||||
2 files changed, 34 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c
|
||||
index 00e3d7aa31..ee8ac6bd10 100644
|
||||
index 78ea4c5b00..812bfd0e36 100644
|
||||
--- a/dlls/ntdll/file.c
|
||||
+++ b/dlls/ntdll/file.c
|
||||
@@ -1787,6 +1787,7 @@ NTSTATUS FILE_GetSymlink(HANDLE handle, REPARSE_DATA_BUFFER *buffer, ULONG out_s
|
||||
|
@ -1,4 +1,4 @@
|
||||
From fdee240e3485e3fb993b811f2bd47142b166fd8c Mon Sep 17 00:00:00 2001
|
||||
From c32fc6d0a84e857f17c1c51af9bab5aab6a5ff1e 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.
|
||||
@ -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/file.c b/dlls/ntdll/file.c
|
||||
index ee8ac6bd10..834fd8eacc 100644
|
||||
index 812bfd0e36..262d24b9d2 100644
|
||||
--- a/dlls/ntdll/file.c
|
||||
+++ b/dlls/ntdll/file.c
|
||||
@@ -2023,6 +2023,7 @@ NTSTATUS WINAPI NtFsControlFile(HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc
|
||||
@@ -2068,6 +2068,7 @@ NTSTATUS WINAPI NtFsControlFile(HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc
|
||||
switch(buffer->ReparseTag)
|
||||
{
|
||||
case IO_REPARSE_TAG_MOUNT_POINT:
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 2251bc21739a0876f42085127d861e11df2cc953 Mon Sep 17 00:00:00 2001
|
||||
From 273149c2baf56e80063a33ebb5d143819a138436 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.
|
||||
@ -11,7 +11,7 @@ Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
|
||||
3 files changed, 76 insertions(+), 13 deletions(-)
|
||||
|
||||
diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c
|
||||
index 834fd8eacc..4b9688c594 100644
|
||||
index 262d24b9d2..186156159c 100644
|
||||
--- a/dlls/ntdll/file.c
|
||||
+++ b/dlls/ntdll/file.c
|
||||
@@ -1656,16 +1656,19 @@ NTSTATUS WINAPI NtDeviceIoControlFile(HANDLE handle, HANDLE event,
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 2a5bd75df6dcbbc28b821e0e70b022f32d6de424 Mon Sep 17 00:00:00 2001
|
||||
From 2618729bcbd286d60e0a80c3ad1ef840c58c5689 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.
|
||||
@ -10,7 +10,7 @@ Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
|
||||
2 files changed, 53 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c
|
||||
index 4b9688c594..0eb522bf1d 100644
|
||||
index 186156159c..8795eb6e9d 100644
|
||||
--- a/dlls/ntdll/file.c
|
||||
+++ b/dlls/ntdll/file.c
|
||||
@@ -1828,6 +1828,7 @@ NTSTATUS FILE_GetSymlink(HANDLE handle, REPARSE_DATA_BUFFER *buffer, ULONG out_s
|
||||
|
@ -1,16 +1,16 @@
|
||||
From 43b9fbb15b535717e2b8cb082330efd179acf321 Mon Sep 17 00:00:00 2001
|
||||
From 0cf6512a8532b065dc92d6ac16678dff180a1107 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.
|
||||
|
||||
Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
|
||||
---
|
||||
dlls/ntdll/file.c | 11 ++++++++---
|
||||
dlls/ntdll/file.c | 27 ++++++++++++++++++++++-----
|
||||
dlls/ntdll/tests/file.c | 33 +++++++++++++++++++++++++++++++++
|
||||
2 files changed, 41 insertions(+), 3 deletions(-)
|
||||
2 files changed, 55 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c
|
||||
index 0eb522bf1d..7c1a711fc3 100644
|
||||
index 8795eb6e9d..a9fe846e08 100644
|
||||
--- a/dlls/ntdll/file.c
|
||||
+++ b/dlls/ntdll/file.c
|
||||
@@ -1665,6 +1665,7 @@ NTSTATUS FILE_CreateSymlink(HANDLE handle, REPARSE_DATA_BUFFER *buffer)
|
||||
@ -45,6 +45,52 @@ index 0eb522bf1d..7c1a711fc3 100644
|
||||
}
|
||||
else if (errno == ENOSYS)
|
||||
{
|
||||
@@ -1989,6 +1994,7 @@ NTSTATUS FILE_RemoveSymlink(HANDLE handle, REPARSE_GUID_DATA_BUFFER *buffer)
|
||||
BOOL tempdir_created = FALSE;
|
||||
int dest_fd, needs_close;
|
||||
ANSI_STRING unix_name;
|
||||
+ BOOL is_dir = TRUE;
|
||||
NTSTATUS status;
|
||||
struct stat st;
|
||||
|
||||
@@ -2000,12 +2006,13 @@ NTSTATUS FILE_RemoveSymlink(HANDLE handle, REPARSE_GUID_DATA_BUFFER *buffer)
|
||||
|
||||
TRACE("Deleting symlink %s\n", unix_name.Buffer);
|
||||
|
||||
- /* Produce the directory in a temporary location in the same folder */
|
||||
+ /* Produce the file/directory in a temporary location in the same folder */
|
||||
if (fstat( dest_fd, &st ) == -1)
|
||||
{
|
||||
status = FILE_GetNtStatus();
|
||||
goto cleanup;
|
||||
}
|
||||
+ is_dir = S_ISDIR(st.st_mode);
|
||||
strcpy( tmpdir, unix_name.Buffer );
|
||||
dirname( tmpdir) ;
|
||||
strcat( tmpdir, "/.winelink.XXXXXX" );
|
||||
@@ -2017,11 +2024,21 @@ NTSTATUS FILE_RemoveSymlink(HANDLE handle, REPARSE_GUID_DATA_BUFFER *buffer)
|
||||
tempdir_created = TRUE;
|
||||
strcpy( tmpfile, tmpdir );
|
||||
strcat( tmpfile, "/tmpfile" );
|
||||
- if (mkdir( tmpfile, st.st_mode ))
|
||||
+ if (is_dir && mkdir( tmpfile, st.st_mode ))
|
||||
{
|
||||
status = FILE_GetNtStatus();
|
||||
goto cleanup;
|
||||
}
|
||||
+ else if (!is_dir)
|
||||
+ {
|
||||
+ int fd = open( tmpfile, O_CREAT|O_WRONLY|O_TRUNC, st.st_mode );
|
||||
+ if (fd < 0)
|
||||
+ {
|
||||
+ status = FILE_GetNtStatus();
|
||||
+ goto cleanup;
|
||||
+ }
|
||||
+ close( fd );
|
||||
+ }
|
||||
/* attemp to retain the ownership (if possible) */
|
||||
lchown( tmpfile, st.st_uid, st.st_gid );
|
||||
/* Atomically move the directory into position */
|
||||
diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c
|
||||
index c13ee84bf0..f40dc1f51b 100644
|
||||
--- a/dlls/ntdll/tests/file.c
|
||||
|
@ -1,21 +1,21 @@
|
||||
From 48fd8c19b8a0403c297c5bd0eade9cd5ef446305 Mon Sep 17 00:00:00 2001
|
||||
From 2ccff55de1a8e43f12fde63870b0d93ec63dd4ab Mon Sep 17 00:00:00 2001
|
||||
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
|
||||
Date: Sat, 30 Mar 2019 12:00:51 -0600
|
||||
Subject: [PATCH] ntdll: Correctly report file symbolic links as files.
|
||||
Subject: ntdll: Correctly report file symbolic links as files.
|
||||
|
||||
Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
|
||||
---
|
||||
dlls/ntdll/file.c | 110 +++++++++++++++++++++++++++++++++---------------
|
||||
dlls/ntdll/tests/file.c | 8 ++--
|
||||
dlls/ntdll/file.c | 110 +++++++++++++++++++++++++++-------------
|
||||
dlls/ntdll/tests/file.c | 8 +--
|
||||
2 files changed, 79 insertions(+), 39 deletions(-)
|
||||
|
||||
diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c
|
||||
index 4e5bf46..6cb351b 100644
|
||||
index a9fe846e08..8ffd79ccbf 100644
|
||||
--- a/dlls/ntdll/file.c
|
||||
+++ b/dlls/ntdll/file.c
|
||||
@@ -140,6 +140,9 @@ static inline int get_file_xattr( char *hexattr, int attrlen )
|
||||
return 0;
|
||||
}
|
||||
@@ -124,6 +124,9 @@ mode_t FILE_umask = 0;
|
||||
|
||||
static const WCHAR ntfsW[] = {'N','T','F','S'};
|
||||
|
||||
+NTSTATUS FILE_DecodeSymlink(const char *unix_src, char *unix_dest, USHORT *unix_dest_len,
|
||||
+ DWORD *tag, ULONG *flags, BOOL *is_dir);
|
||||
@ -23,7 +23,7 @@ index 4e5bf46..6cb351b 100644
|
||||
/* fetch the attributes of a file */
|
||||
static inline ULONG get_file_attributes( const struct stat *st )
|
||||
{
|
||||
@@ -214,10 +217,14 @@ int get_file_info( const char *path, struct stat *st, ULONG *attr )
|
||||
@@ -160,10 +163,14 @@ int get_file_info( const char *path, struct stat *st, ULONG *attr )
|
||||
if (ret == -1) return ret;
|
||||
if (S_ISLNK( st->st_mode ))
|
||||
{
|
||||
@ -37,8 +37,8 @@ index 4e5bf46..6cb351b 100644
|
||||
+ st->st_mode = (st->st_mode & ~S_IFMT) | (is_dir ? S_IFDIR : S_IFREG);
|
||||
}
|
||||
*attr |= get_file_attributes( st );
|
||||
/* retrieve any stored DOS attributes */
|
||||
@@ -1920,48 +1927,34 @@ cleanup:
|
||||
return ret;
|
||||
@@ -1822,48 +1829,34 @@ cleanup:
|
||||
}
|
||||
|
||||
|
||||
@ -102,7 +102,7 @@ index 4e5bf46..6cb351b 100644
|
||||
p++;
|
||||
}
|
||||
if (*p++ != '/')
|
||||
@@ -1969,7 +1962,7 @@ NTSTATUS FILE_GetSymlink(HANDLE handle, REPARSE_DATA_BUFFER *buffer, ULONG out_s
|
||||
@@ -1871,7 +1864,7 @@ NTSTATUS FILE_GetSymlink(HANDLE handle, REPARSE_DATA_BUFFER *buffer, ULONG out_s
|
||||
status = STATUS_NOT_IMPLEMENTED;
|
||||
goto cleanup;
|
||||
}
|
||||
@ -111,7 +111,7 @@ index 4e5bf46..6cb351b 100644
|
||||
for (i = 0; i < sizeof(ULONG)*8; i++)
|
||||
{
|
||||
char c = *p++;
|
||||
@@ -1984,21 +1977,68 @@ NTSTATUS FILE_GetSymlink(HANDLE handle, REPARSE_DATA_BUFFER *buffer, ULONG out_s
|
||||
@@ -1886,21 +1879,68 @@ NTSTATUS FILE_GetSymlink(HANDLE handle, REPARSE_DATA_BUFFER *buffer, ULONG out_s
|
||||
status = STATUS_NOT_IMPLEMENTED;
|
||||
goto cleanup;
|
||||
}
|
||||
@ -186,10 +186,10 @@ index 4e5bf46..6cb351b 100644
|
||||
/* convert the relative path into an absolute path */
|
||||
if (flags == SYMLINK_FLAG_RELATIVE)
|
||||
diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c
|
||||
index 3f47c69..cecce37 100644
|
||||
index f40dc1f51b..f23bf8644c 100644
|
||||
--- a/dlls/ntdll/tests/file.c
|
||||
+++ b/dlls/ntdll/tests/file.c
|
||||
@@ -5288,13 +5288,13 @@ static void test_reparse_points(void)
|
||||
@@ -5069,13 +5069,13 @@ static void test_reparse_points(void)
|
||||
|
||||
/* Check deleting a file symlink as if it were a directory */
|
||||
bret = RemoveDirectoryW(reparse_path);
|
||||
@ -205,7 +205,7 @@ index 3f47c69..cecce37 100644
|
||||
ok(dwret & FILE_ATTRIBUTE_REPARSE_POINT, "File is not a symlink! (attributes: 0x%x)\n", dwret);
|
||||
|
||||
/* Delete the symlink as a file */
|
||||
@@ -5303,10 +5303,10 @@ static void test_reparse_points(void)
|
||||
@@ -5084,10 +5084,10 @@ static void test_reparse_points(void)
|
||||
|
||||
/* Create a blank slate for directory symlink tests */
|
||||
bret = CreateDirectoryW(reparse_path, NULL);
|
||||
@ -219,5 +219,5 @@ index 3f47c69..cecce37 100644
|
||||
/* Create the directory symlink */
|
||||
HeapFree(GetProcessHeap(), 0, buffer);
|
||||
--
|
||||
1.9.1
|
||||
2.17.1
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
From e57c2a438bf63fcab5686c8c7dbd4379dda1a49b Mon Sep 17 00:00:00 2001
|
||||
From 447ceb46b34604f8c72014b8516851e81850b4de Mon Sep 17 00:00:00 2001
|
||||
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
|
||||
Date: Sat, 30 Mar 2019 12:01:50 -0600
|
||||
Subject: kernel32: Set error code when attempting to delete file symlinks as
|
||||
|
@ -1,19 +1,19 @@
|
||||
From 108acd429c44d9a06bab68ad66890ee6756264cc Mon Sep 17 00:00:00 2001
|
||||
From d6f127ccdc6bb2a2c74551bfae669a6eee55c312 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.
|
||||
Subject: server: Properly handle file symlink deletion.
|
||||
|
||||
Signed-off-by: Erich E. Hoover <erich.e.hoover@gmail.com>
|
||||
---
|
||||
dlls/ntdll/tests/file.c | 6 ++---
|
||||
server/fd.c | 64 +++++++++++++++++++++++++++++++++++++++++++++----
|
||||
dlls/ntdll/tests/file.c | 6 ++--
|
||||
server/fd.c | 64 +++++++++++++++++++++++++++++++++++++----
|
||||
2 files changed, 62 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c
|
||||
index 8800ab0..92ac697 100644
|
||||
index a1323ab4f6..8ab8a5da53 100644
|
||||
--- a/dlls/ntdll/tests/file.c
|
||||
+++ b/dlls/ntdll/tests/file.c
|
||||
@@ -5299,14 +5299,14 @@ static void test_reparse_points(void)
|
||||
@@ -5080,14 +5080,14 @@ static void test_reparse_points(void)
|
||||
|
||||
/* Delete the symlink as a file */
|
||||
bret = DeleteFileW(reparse_path);
|
||||
@ -32,10 +32,10 @@ index 8800ab0..92ac697 100644
|
||||
/* Create the directory symlink */
|
||||
HeapFree(GetProcessHeap(), 0, buffer);
|
||||
diff --git a/server/fd.c b/server/fd.c
|
||||
index 6c4cf61..58843d7 100644
|
||||
index 5d80e218b9..71347e4318 100644
|
||||
--- a/server/fd.c
|
||||
+++ b/server/fd.c
|
||||
@@ -1075,7 +1075,7 @@ static void inode_destroy( struct object *obj )
|
||||
@@ -1069,7 +1069,7 @@ static void inode_destroy( struct object *obj )
|
||||
{
|
||||
/* make sure it is still the same file */
|
||||
struct stat st;
|
||||
@ -44,7 +44,7 @@ index 6c4cf61..58843d7 100644
|
||||
{
|
||||
if (S_ISDIR(st.st_mode)) rmdir( fd->unix_name );
|
||||
else unlink( fd->unix_name );
|
||||
@@ -1769,6 +1769,53 @@ char *dup_fd_name( struct fd *root, const char *name )
|
||||
@@ -1747,6 +1747,53 @@ char *dup_fd_name( struct fd *root, const char *name )
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -98,12 +98,12 @@ index 6c4cf61..58843d7 100644
|
||||
/* open() wrapper that returns a struct fd with no fd user set */
|
||||
struct fd *open_fd( struct fd *root, const char *name, int flags, mode_t *mode, unsigned int access,
|
||||
unsigned int sharing, unsigned int options )
|
||||
@@ -1876,14 +1923,15 @@ struct fd *open_fd( struct fd *root, const char *name, int flags, mode_t *mode,
|
||||
@@ -1826,14 +1873,15 @@ struct fd *open_fd( struct fd *root, const char *name, int flags, mode_t *mode,
|
||||
closed_fd->unix_fd = fd->unix_fd;
|
||||
closed_fd->unlink = 0;
|
||||
closed_fd->unix_name = fd->unix_name;
|
||||
|
||||
if (do_chmod) chmod( name, *mode );
|
||||
- fstat( fd->unix_fd, &st );
|
||||
+ fstatat( -1, fd->unix_name, &st, AT_SYMLINK_NOFOLLOW );
|
||||
+ lstat( fd->unix_name, &st );
|
||||
*mode = st.st_mode;
|
||||
|
||||
/* only bother with an inode for normal files and directories */
|
||||
@ -116,7 +116,7 @@ index 6c4cf61..58843d7 100644
|
||||
|
||||
if (!inode)
|
||||
{
|
||||
@@ -1898,13 +1946,19 @@ struct fd *open_fd( struct fd *root, const char *name, int flags, mode_t *mode,
|
||||
@@ -1848,13 +1896,19 @@ struct fd *open_fd( struct fd *root, const char *name, int flags, mode_t *mode,
|
||||
list_add_head( &inode->open, &fd->inode_entry );
|
||||
closed_fd = NULL;
|
||||
|
||||
@ -139,5 +139,5 @@ index 6c4cf61..58843d7 100644
|
||||
set_error( STATUS_FILE_IS_A_DIRECTORY );
|
||||
goto error;
|
||||
--
|
||||
1.9.1
|
||||
2.17.1
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user