From ef85449de2c116efdca70ba14bca215a35d2b708 Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Wed, 28 Jun 2023 08:27:58 +1000 Subject: [PATCH] Rebase against 98b73b5c32fa82218081f0e7668f9836ffe1b55d. --- ...ement-FILE_OPEN_REPARSE_POINT-option.patch | 63 ++++++++++--------- ...open-files-without-any-permission-bi.patch | 18 +++--- ...hader_extract_from_dxbc-to-wined3d_s.patch | 55 ---------------- staging/upstream-commit | 2 +- 4 files changed, 44 insertions(+), 94 deletions(-) delete mode 100644 patches/vkd3d-latest/0001-wined3d-rename-shader_extract_from_dxbc-to-wined3d_s.patch diff --git a/patches/ntdll-Junction_Points/0005-server-Implement-FILE_OPEN_REPARSE_POINT-option.patch b/patches/ntdll-Junction_Points/0005-server-Implement-FILE_OPEN_REPARSE_POINT-option.patch index 2a1b386e..ed5ebcd5 100644 --- a/patches/ntdll-Junction_Points/0005-server-Implement-FILE_OPEN_REPARSE_POINT-option.patch +++ b/patches/ntdll-Junction_Points/0005-server-Implement-FILE_OPEN_REPARSE_POINT-option.patch @@ -1,4 +1,4 @@ -From 1656f670f68ce218458fc26dc8688c78d99091cb Mon Sep 17 00:00:00 2001 +From c58ac24e08827a2b5aac12f365197d1c5174db3a Mon Sep 17 00:00:00 2001 From: "Erich E. Hoover" Date: Thu, 16 Jan 2014 21:02:11 -0700 Subject: [PATCH] server: Implement FILE_OPEN_REPARSE_POINT option. @@ -6,14 +6,14 @@ Subject: [PATCH] server: Implement FILE_OPEN_REPARSE_POINT option. Signed-off-by: Erich E. Hoover --- dlls/kernelbase/file.c | 2 + - server/fd.c | 144 +++++++++++++++++++++++++++++++++++++++-- - 2 files changed, 139 insertions(+), 7 deletions(-) + server/fd.c | 152 +++++++++++++++++++++++++++++++++++++++-- + 2 files changed, 147 insertions(+), 7 deletions(-) diff --git a/dlls/kernelbase/file.c b/dlls/kernelbase/file.c -index ac04388acde..d0da370ae88 100644 +index 7c2e132bdcb..2a8dc8df875 100644 --- a/dlls/kernelbase/file.c +++ b/dlls/kernelbase/file.c -@@ -735,6 +735,8 @@ static UINT get_nt_file_options( DWORD attributes ) +@@ -732,6 +732,8 @@ static UINT get_nt_file_options( DWORD attributes ) options |= FILE_SEQUENTIAL_ONLY; if (attributes & FILE_FLAG_WRITE_THROUGH) options |= FILE_WRITE_THROUGH; @@ -23,7 +23,7 @@ index ac04388acde..d0da370ae88 100644 } diff --git a/server/fd.c b/server/fd.c -index eaebe044f37..db645779dc6 100644 +index 0b0e91ebfbb..233c9eb94ef 100644 --- a/server/fd.c +++ b/server/fd.c @@ -31,6 +31,7 @@ @@ -45,7 +45,7 @@ index eaebe044f37..db645779dc6 100644 #if defined(HAVE_SYS_EPOLL_H) && defined(HAVE_EPOLL_CREATE) # include # define USE_EPOLL -@@ -1140,6 +1145,59 @@ static void inode_dump( struct object *obj, int verbose ) +@@ -1152,6 +1157,59 @@ static void inode_dump( struct object *obj, int verbose ) fprintf( stderr, "\n" ); } @@ -105,16 +105,19 @@ index eaebe044f37..db645779dc6 100644 static void inode_destroy( struct object *obj ) { struct inode *inode = (struct inode *)obj; -@@ -1159,10 +1217,29 @@ static void inode_destroy( struct object *obj ) - { - /* make sure it is still the same file */ - struct stat st; -- if (!stat( fd->unix_name, &st ) && st.st_dev == inode->device->dev && st.st_ino == inode->ino) +@@ -1168,7 +1226,34 @@ static void inode_destroy( struct object *obj ) + list_remove( ptr ); + if (fd->unix_fd != -1) close( fd->unix_fd ); + if (fd->disp_flags & FILE_DISPOSITION_DELETE) +- unlink_closed_fd( inode, fd ); ++ { ++ /* make sure it is still the same file */ ++ struct stat st; + if (!lstat( fd->unix_name, &st ) && st.st_dev == inode->device->dev && st.st_ino == inode->ino) - { ++ { + int is_reparse_point = (is_reparse_dir( fd->unix_name, NULL ) == 0); - if (S_ISDIR(st.st_mode)) rmdir( fd->unix_name ); - else unlink( fd->unix_name ); ++ if (S_ISDIR(st.st_mode)) rmdir( fd->unix_name ); ++ else unlink_closed_fd( inode, fd ); + /* remove reparse point metadata (if applicable) */ + if (is_reparse_point) + { @@ -133,10 +136,12 @@ index eaebe044f37..db645779dc6 100644 + rmdir_recursive( AT_FDCWD, metadata_path ); + rmdir( dirname( metadata_path ) ); + } - } - } ++ } ++ } free( fd->unix_name ); -@@ -1888,6 +1965,38 @@ void get_nt_name( struct fd *fd, struct unicode_str *name ) + free( fd ); + } +@@ -1902,6 +1987,38 @@ void get_nt_name( struct fd *fd, struct unicode_str *name ) name->len = fd->nt_namelen; } @@ -175,7 +180,7 @@ index eaebe044f37..db645779dc6 100644 /* open() wrapper that returns a struct fd with no fd user set */ struct fd *open_fd( struct fd *root, const char *name, struct unicode_str nt_name, int flags, mode_t *mode, unsigned int access, -@@ -1948,6 +2057,15 @@ struct fd *open_fd( struct fd *root, const char *name, struct unicode_str nt_nam +@@ -1962,6 +2079,15 @@ struct fd *open_fd( struct fd *root, const char *name, struct unicode_str nt_nam } else rw_mode = O_RDONLY; @@ -191,7 +196,7 @@ index eaebe044f37..db645779dc6 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 */ -@@ -1972,7 +2090,7 @@ struct fd *open_fd( struct fd *root, const char *name, struct unicode_str nt_nam +@@ -1986,7 +2112,7 @@ struct fd *open_fd( struct fd *root, const char *name, struct unicode_str nt_nam fd->unix_name = NULL; if ((path = dup_fd_name( root, name ))) { @@ -200,7 +205,7 @@ index eaebe044f37..db645779dc6 100644 free( path ); } -@@ -1983,10 +2101,11 @@ struct fd *open_fd( struct fd *root, const char *name, struct unicode_str nt_nam +@@ -1997,10 +2123,11 @@ struct fd *open_fd( struct fd *root, const char *name, struct unicode_str nt_nam *mode = st.st_mode; /* only bother with an inode for normal files and directories */ @@ -213,7 +218,7 @@ index eaebe044f37..db645779dc6 100644 if (!inode) { -@@ -2001,13 +2120,17 @@ struct fd *open_fd( struct fd *root, const char *name, struct unicode_str nt_nam +@@ -2015,13 +2142,17 @@ struct fd *open_fd( struct fd *root, const char *name, struct unicode_str nt_nam list_add_head( &inode->open, &fd->inode_entry ); closed_fd = NULL; @@ -233,7 +238,7 @@ index eaebe044f37..db645779dc6 100644 { set_error( STATUS_FILE_IS_A_DIRECTORY ); goto error; -@@ -2439,6 +2562,7 @@ static struct fd *get_handle_fd_obj( struct process *process, obj_handle_t handl +@@ -2454,6 +2585,7 @@ static struct fd *get_handle_fd_obj( struct process *process, obj_handle_t handl static int is_dir_empty( int fd ) { @@ -241,7 +246,7 @@ index eaebe044f37..db645779dc6 100644 DIR *dir; int empty; struct dirent *de; -@@ -2446,8 +2570,13 @@ static int is_dir_empty( int fd ) +@@ -2461,8 +2593,13 @@ static int is_dir_empty( int fd ) if ((fd = dup( fd )) == -1) return -1; @@ -256,7 +261,7 @@ index eaebe044f37..db645779dc6 100644 close( fd ); return -1; } -@@ -2459,6 +2588,7 @@ static int is_dir_empty( int fd ) +@@ -2474,6 +2611,7 @@ static int is_dir_empty( int fd ) empty = 0; } closedir( dir ); @@ -264,15 +269,15 @@ index eaebe044f37..db645779dc6 100644 return empty; } -@@ -2497,7 +2627,7 @@ static void set_fd_disposition( struct fd *fd, int unlink ) +@@ -2512,7 +2650,7 @@ static void set_fd_disposition( struct fd *fd, unsigned int flags ) file_set_error(); return; } - if (S_ISREG( st.st_mode )) /* can't unlink files we don't have permission to write */ + if (S_ISREG( st.st_mode ) || S_ISLNK( st.st_mode )) /* can't unlink files we don't have permission to write */ { - if (!(st.st_mode & (S_IWUSR | S_IWGRP | S_IWOTH))) - { + if (!(flags & FILE_DISPOSITION_IGNORE_READONLY_ATTRIBUTE) && + !(st.st_mode & (S_IWUSR | S_IWGRP | S_IWOTH))) -- -2.39.1 +2.40.1 diff --git a/patches/server-File_Permissions/0002-server-Allow-to-open-files-without-any-permission-bi.patch b/patches/server-File_Permissions/0002-server-Allow-to-open-files-without-any-permission-bi.patch index aa3efac6..14ca5d28 100644 --- a/patches/server-File_Permissions/0002-server-Allow-to-open-files-without-any-permission-bi.patch +++ b/patches/server-File_Permissions/0002-server-Allow-to-open-files-without-any-permission-bi.patch @@ -1,4 +1,4 @@ -From bab7a4b5d00822b0a7965ac338a73538e06b5aa7 Mon Sep 17 00:00:00 2001 +From e23cd96f76a62e983730d43e5d9ed401fdc09721 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Fri, 3 Apr 2015 03:58:47 +0200 Subject: [PATCH] server: Allow to open files without any permission bits. (try @@ -13,7 +13,7 @@ Changes in v2: 2 files changed, 33 insertions(+), 20 deletions(-) diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c -index 51bf60d0f36..ed8db358ab8 100644 +index 5e5000cfcb5..abb1b070f7d 100644 --- a/dlls/advapi32/tests/security.c +++ b/dlls/advapi32/tests/security.c @@ -3782,17 +3782,13 @@ static void test_CreateDirectoryA(void) @@ -65,10 +65,10 @@ index 51bf60d0f36..ed8db358ab8 100644 done: diff --git a/server/fd.c b/server/fd.c -index db265a9b1b8..f025d51a1e0 100644 +index 3edfca018d1..fe6318b2e0e 100644 --- a/server/fd.c +++ b/server/fd.c -@@ -2006,6 +2006,7 @@ struct fd *open_fd( struct fd *root, const char *name, struct unicode_str nt_nam +@@ -2047,6 +2047,7 @@ struct fd *open_fd( struct fd *root, const char *name, struct unicode_str nt_nam int root_fd = -1; int rw_mode; char *path; @@ -76,7 +76,7 @@ index db265a9b1b8..f025d51a1e0 100644 int created = (flags & O_CREAT); if (((options & FILE_DELETE_ON_CLOSE) && !(access & DELETE)) || -@@ -2074,6 +2075,23 @@ struct fd *open_fd( struct fd *root, const char *name, struct unicode_str nt_nam +@@ -2115,6 +2116,23 @@ struct fd *open_fd( struct fd *root, const char *name, struct unicode_str nt_nam if ((access & FILE_UNIX_WRITE_ACCESS) || (flags & O_CREAT)) fd->unix_fd = open( name, O_RDONLY | (flags & ~(O_TRUNC | O_CREAT | O_EXCL)), *mode ); } @@ -100,7 +100,7 @@ index db265a9b1b8..f025d51a1e0 100644 if (fd->unix_fd == -1) { -@@ -2082,6 +2100,8 @@ struct fd *open_fd( struct fd *root, const char *name, struct unicode_str nt_nam +@@ -2123,6 +2141,8 @@ struct fd *open_fd( struct fd *root, const char *name, struct unicode_str nt_nam set_error( STATUS_OBJECT_NAME_INVALID ); else file_set_error(); @@ -109,14 +109,14 @@ index db265a9b1b8..f025d51a1e0 100644 goto error; } } -@@ -2097,6 +2117,7 @@ struct fd *open_fd( struct fd *root, const char *name, struct unicode_str nt_nam +@@ -2138,6 +2158,7 @@ struct fd *open_fd( struct fd *root, const char *name, struct unicode_str nt_nam closed_fd->unix_fd = fd->unix_fd; - closed_fd->unlink = 0; + closed_fd->disp_flags = 0; closed_fd->unix_name = fd->unix_name; + if (do_chmod) chmod( name, *mode ); fstat( fd->unix_fd, &st ); *mode = st.st_mode; -- -2.35.1 +2.40.1 diff --git a/patches/vkd3d-latest/0001-wined3d-rename-shader_extract_from_dxbc-to-wined3d_s.patch b/patches/vkd3d-latest/0001-wined3d-rename-shader_extract_from_dxbc-to-wined3d_s.patch deleted file mode 100644 index dc24c167..00000000 --- a/patches/vkd3d-latest/0001-wined3d-rename-shader_extract_from_dxbc-to-wined3d_s.patch +++ /dev/null @@ -1,55 +0,0 @@ -From 494b9575bff5b2f6a2225847752899af0860768f Mon Sep 17 00:00:00 2001 -From: Alistair Leslie-Hughes -Date: Wed, 17 May 2023 08:13:47 +1000 -Subject: [PATCH 1/2] wined3d: rename shader_extract_from_dxbc to - wined3d_shader_extract_from_dxbc - -Stops a linker error of duplicate name when using upstream vk3d3. ---- - dlls/wined3d/shader.c | 2 +- - dlls/wined3d/shader_sm4.c | 2 +- - dlls/wined3d/wined3d_private.h | 2 +- - 3 files changed, 3 insertions(+), 3 deletions(-) - -diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c -index b4df79508ec..2728929045f 100644 ---- a/dlls/wined3d/shader.c -+++ b/dlls/wined3d/shader.c -@@ -2481,7 +2481,7 @@ static HRESULT shader_init(struct wined3d_shader *shader, struct wined3d_device - shader->byte_code_size = desc->byte_code_size; - - max_version = shader_max_version_from_feature_level(device->cs->c.state->feature_level); -- if (FAILED(hr = shader_extract_from_dxbc(shader, max_version, &source_type))) -+ if (FAILED(hr = wined3d_shader_extract_from_dxbc(shader, max_version, &source_type))) - goto fail; - - if (!(shader->frontend = shader_select_frontend(source_type))) -diff --git a/dlls/wined3d/shader_sm4.c b/dlls/wined3d/shader_sm4.c -index 78abdbe81ac..74391cc1be8 100644 ---- a/dlls/wined3d/shader_sm4.c -+++ b/dlls/wined3d/shader_sm4.c -@@ -2077,7 +2077,7 @@ static HRESULT shader_dxbc_process_section(struct wined3d_shader *shader, unsign - return S_OK; - } - --HRESULT shader_extract_from_dxbc(struct wined3d_shader *shader, -+HRESULT wined3d_shader_extract_from_dxbc(struct wined3d_shader *shader, - unsigned int max_shader_version, enum vkd3d_shader_source_type *source_type) - { - const struct vkd3d_shader_code dxbc = {.code = shader->byte_code, .size = shader->byte_code_size}; -diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index a586d6847bf..001534e8c38 100644 ---- a/dlls/wined3d/wined3d_private.h -+++ b/dlls/wined3d/wined3d_private.h -@@ -1466,7 +1466,7 @@ struct wined3d_shader_frontend - extern const struct wined3d_shader_frontend sm1_shader_frontend DECLSPEC_HIDDEN; - extern const struct wined3d_shader_frontend sm4_shader_frontend DECLSPEC_HIDDEN; - --HRESULT shader_extract_from_dxbc(struct wined3d_shader *shader, -+HRESULT wined3d_shader_extract_from_dxbc(struct wined3d_shader *shader, - unsigned int max_shader_version, enum vkd3d_shader_source_type *source_type) DECLSPEC_HIDDEN; - BOOL shader_get_stream_output_register_info(const struct wined3d_shader *shader, - const struct wined3d_stream_output_element *so_element, unsigned int *register_idx, --- -2.40.1 - diff --git a/staging/upstream-commit b/staging/upstream-commit index 0d21d7c1..46baad49 100644 --- a/staging/upstream-commit +++ b/staging/upstream-commit @@ -1 +1 @@ -1d281c620d3062c2f30cdf533fe4ac06905a07b8 +98b73b5c32fa82218081f0e7668f9836ffe1b55d