diff --git a/patches/ntdll-FileDispositionInformation/0012-server-When-combining-root-and-name-make-sure-there-.patch b/patches/ntdll-FileDispositionInformation/0012-server-When-combining-root-and-name-make-sure-there-.patch index e13328d3..d4eaced0 100644 --- a/patches/ntdll-FileDispositionInformation/0012-server-When-combining-root-and-name-make-sure-there-.patch +++ b/patches/ntdll-FileDispositionInformation/0012-server-When-combining-root-and-name-make-sure-there-.patch @@ -1,13 +1,15 @@ -From 9c41d7fd597e32552fa8ea4b9c1f754abfb719f8 Mon Sep 17 00:00:00 2001 +From 9aadb3326ac73489928af85a43ddefd07b6fefb8 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Wed, 3 Jun 2015 01:37:34 +0200 Subject: server: When combining root and name, make sure there is only one - slash. + slash. (v2) +Changes in v2: + * Resolve inter-patch conflict. --- dlls/ntdll/tests/file.c | 4 ++-- - server/fd.c | 12 ++++++++---- - 2 files changed, 10 insertions(+), 6 deletions(-) + server/fd.c | 16 ++++++++++++---- + 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c index 6710b3a..fbcee9b 100644 @@ -25,7 +27,7 @@ index 6710b3a..fbcee9b 100644 CloseHandle( handle ); diff --git a/server/fd.c b/server/fd.c -index f162346..c261397 100644 +index f162346..b46753e 100644 --- a/server/fd.c +++ b/server/fd.c @@ -1721,6 +1721,7 @@ void set_fd_user( struct fd *fd, const struct fd_ops *user_ops, struct object *u @@ -36,7 +38,7 @@ index f162346..c261397 100644 if (!root) return strdup( name ); if (!root->unix_name) return NULL; -@@ -1728,11 +1729,14 @@ static char *dup_fd_name( struct fd *root, const char *name ) +@@ -1728,11 +1729,18 @@ static char *dup_fd_name( struct fd *root, const char *name ) /* skip . prefix */ if (name[0] == '.' && (!name[1] || name[1] == '/')) name++; @@ -50,8 +52,12 @@ index f162346..c261397 100644 + memcpy( ret, root->unix_name, len ); + while (len && ret[len - 1] == '/') len--; + while (name[0] == '/') name++; -+ strcpy( ret + len + 1, name ); -+ ret[ len ] = '/'; ++ if (name[0]) ++ { ++ ret[ len ] = '/'; ++ strcpy( ret + len + 1, name ); ++ } ++ else ret[ len ] = 0; } return ret; } diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index 0a99ce26..f62a7d9b 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -3016,7 +3016,7 @@ if test "$enable_ntdll_FileDispositionInformation" -eq 1; then echo '+ { "Sebastian Lackner", "ntdll/tests: Add tests for FileRenameInformation with nonzero RootDir.", 1 },'; echo '+ { "Qian Hong", "ntdll: Implement a hacky version of FileRenameInformation support.", 1 },'; echo '+ { "Sebastian Lackner", "server: FileRenameInformation target cannot be an existing directory.", 1 },'; - echo '+ { "Sebastian Lackner", "server: When combining root and name, make sure there is only one slash.", 1 },'; + echo '+ { "Sebastian Lackner", "server: When combining root and name, make sure there is only one slash.", 2 },'; echo '+ { "Sebastian Lackner", "server: Reject rename when target has opened file handles.", 1 },'; echo '+ { "Sebastian Lackner", "server: Manually unlink dest when trying to replace a file with directory.", 1 },'; ) >> "$patchlist"