mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2024-09-13 09:17:20 -07:00
Rebase against 3b5107d06305972beaa9c5ff147ecbcd99949a75.
This commit is contained in:
parent
f28931a026
commit
428f65dd68
@ -39,12 +39,11 @@ Wine. All those differences are also documented on the
|
||||
Included bug fixes and improvements
|
||||
-----------------------------------
|
||||
|
||||
**Bug fixes and features included in the next upcoming release [11]:**
|
||||
**Bug fixes and features included in the next upcoming release [10]:**
|
||||
|
||||
* Add IDragSourceHelper stub interface ([Wine Bug #24699](https://bugs.winehq.org/show_bug.cgi?id=24699))
|
||||
* Catch invalid memory accesses in imagehlp.CheckSumMappedFile
|
||||
* Fix detection of case-insensitive systems in MSYS2
|
||||
* Fix implementation of krnl386.exe16.GetTempDrive ([Wine Bug #39104](https://bugs.winehq.org/show_bug.cgi?id=39104))
|
||||
* Implement enumeration of sound devices and basic properties to dxdiagn ([Wine Bug #32613](https://bugs.winehq.org/show_bug.cgi?id=32613))
|
||||
* Implement shell32 NewMenu class with new folder item ([Wine Bug #24812](https://bugs.winehq.org/show_bug.cgi?id=24812))
|
||||
* Implement special handling for calling GetChildContainer with an empty string ([Wine Bug #38014](https://bugs.winehq.org/show_bug.cgi?id=38014))
|
||||
@ -158,7 +157,7 @@ for more details.*
|
||||
* Fix issues with dragging layers between images in Adobe Photoshop 7.0 ([Wine Bug #12007](https://bugs.winehq.org/show_bug.cgi?id=12007))
|
||||
* Fix missing video introduced by pixelformat changes. ([Wine Bug #36900](https://bugs.winehq.org/show_bug.cgi?id=36900))
|
||||
* Fix multithreading issues with fullscreen clipping ([Wine Bug #38087](https://bugs.winehq.org/show_bug.cgi?id=38087))
|
||||
* Fix possible integer overflow in VarR4FromDec ([Wine Bug #38988](https://bugs.winehq.org/show_bug.cgi?id=38988))
|
||||
* ~~Fix possible integer overflow in VarR4FromDec~~ ([Wine Bug #38988](https://bugs.winehq.org/show_bug.cgi?id=38988))
|
||||
* Fix possible segfault in pulse_rd_loop of PulseAudio backend
|
||||
* Fix race-condition when threads are killed during shutdown
|
||||
* Fix regression caused by blacklisting supported OpenGL extensions ([Wine Bug #38480](https://bugs.winehq.org/show_bug.cgi?id=38480))
|
||||
|
@ -1,29 +0,0 @@
|
||||
From 97e522d70d8f94fe8af1baa4a1c49f5956df3caf Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Tue, 18 Aug 2015 21:33:58 +0200
|
||||
Subject: krnl386.exe16: Increase buffer size in GetTempDrive.
|
||||
|
||||
---
|
||||
dlls/krnl386.exe16/file.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/dlls/krnl386.exe16/file.c b/dlls/krnl386.exe16/file.c
|
||||
index 6c3cef3..77908c2 100644
|
||||
--- a/dlls/krnl386.exe16/file.c
|
||||
+++ b/dlls/krnl386.exe16/file.c
|
||||
@@ -461,10 +461,10 @@ LONG WINAPI _hwrite16( HFILE16 hFile, LPCSTR buffer, LONG count )
|
||||
*/
|
||||
UINT WINAPI GetTempDrive( BYTE ignored )
|
||||
{
|
||||
- WCHAR buffer[8];
|
||||
+ WCHAR buffer[MAX_PATH];
|
||||
BYTE ret;
|
||||
|
||||
- if (GetTempPathW( 8, buffer )) ret = (BYTE)toupperW(buffer[0]);
|
||||
+ if (GetTempPathW( MAX_PATH, buffer )) ret = (BYTE)toupperW(buffer[0]);
|
||||
else ret = 'C';
|
||||
return MAKELONG( ret | (':' << 8), 1 );
|
||||
}
|
||||
--
|
||||
2.5.0
|
||||
|
@ -1 +0,0 @@
|
||||
Fixes: [39104] Fix implementation of krnl386.exe16.GetTempDrive
|
@ -1,168 +0,0 @@
|
||||
From 47f1bcd94dab7f58cda802dd89233ee21274c9fa Mon Sep 17 00:00:00 2001
|
||||
From: Dmitry Timoshkov <dmitry@baikal.ru>
|
||||
Date: Thu, 7 Aug 2014 18:31:33 -0600
|
||||
Subject: server: Keep a pointer to parent's fd unix_name in the closed_fd
|
||||
structure.
|
||||
|
||||
---
|
||||
server/fd.c | 38 +++++++++++++++++++++-----------------
|
||||
1 file changed, 21 insertions(+), 17 deletions(-)
|
||||
|
||||
diff --git a/server/fd.c b/server/fd.c
|
||||
index 14e98ac..7c2d717 100644
|
||||
--- a/server/fd.c
|
||||
+++ b/server/fd.c
|
||||
@@ -164,7 +164,8 @@ struct closed_fd
|
||||
{
|
||||
struct list entry; /* entry in inode closed list */
|
||||
int unix_fd; /* the unix file descriptor */
|
||||
- char unlink[1]; /* name to unlink on close (if any) */
|
||||
+ int unlink; /* whether to unlink on close */
|
||||
+ char *unix_name; /* name to unlink on close, points to parent fd unix_name */
|
||||
};
|
||||
|
||||
struct fd
|
||||
@@ -1016,9 +1017,10 @@ static void inode_close_pending( struct inode *inode, int keep_unlinks )
|
||||
close( fd->unix_fd );
|
||||
fd->unix_fd = -1;
|
||||
}
|
||||
- if (!keep_unlinks || !fd->unlink[0]) /* get rid of it unless there's an unlink pending on that file */
|
||||
+ if (!keep_unlinks || !fd->unlink) /* get rid of it unless there's an unlink pending on that file */
|
||||
{
|
||||
list_remove( ptr );
|
||||
+ free( fd->unix_name );
|
||||
free( fd );
|
||||
}
|
||||
ptr = next;
|
||||
@@ -1048,16 +1050,17 @@ static void inode_destroy( struct object *obj )
|
||||
struct closed_fd *fd = LIST_ENTRY( ptr, struct closed_fd, entry );
|
||||
list_remove( ptr );
|
||||
if (fd->unix_fd != -1) close( fd->unix_fd );
|
||||
- if (fd->unlink[0])
|
||||
+ if (fd->unlink)
|
||||
{
|
||||
/* make sure it is still the same file */
|
||||
struct stat st;
|
||||
- if (!stat( fd->unlink, &st ) && st.st_dev == inode->device->dev && st.st_ino == inode->ino)
|
||||
+ if (!stat( fd->unix_name, &st ) && st.st_dev == inode->device->dev && st.st_ino == inode->ino)
|
||||
{
|
||||
- if (S_ISDIR(st.st_mode)) rmdir( fd->unlink );
|
||||
- else unlink( fd->unlink );
|
||||
+ if (S_ISDIR(st.st_mode)) rmdir( fd->unix_name );
|
||||
+ else unlink( fd->unix_name );
|
||||
}
|
||||
}
|
||||
+ free( fd->unix_name );
|
||||
free( fd );
|
||||
}
|
||||
release_object( inode->device );
|
||||
@@ -1103,7 +1106,7 @@ static void inode_add_closed_fd( struct inode *inode, struct closed_fd *fd )
|
||||
{
|
||||
list_add_head( &inode->closed, &fd->entry );
|
||||
}
|
||||
- else if (fd->unlink[0]) /* close the fd but keep the structure around for unlink */
|
||||
+ else if (fd->unlink) /* close the fd but keep the structure around for unlink */
|
||||
{
|
||||
if (fd->unix_fd != -1) close( fd->unix_fd );
|
||||
fd->unix_fd = -1;
|
||||
@@ -1112,6 +1115,7 @@ static void inode_add_closed_fd( struct inode *inode, struct closed_fd *fd )
|
||||
else /* no locks on this inode and no unlink, get rid of the fd */
|
||||
{
|
||||
if (fd->unix_fd != -1) close( fd->unix_fd );
|
||||
+ free( fd->unix_name );
|
||||
free( fd );
|
||||
}
|
||||
}
|
||||
@@ -1451,7 +1455,7 @@ static void fd_dump( struct object *obj, int verbose )
|
||||
{
|
||||
struct fd *fd = (struct fd *)obj;
|
||||
fprintf( stderr, "Fd unix_fd=%d user=%p options=%08x", fd->unix_fd, fd->user, fd->options );
|
||||
- if (fd->inode) fprintf( stderr, " inode=%p unlink='%s'", fd->inode, fd->closed->unlink );
|
||||
+ if (fd->inode) fprintf( stderr, " inode=%p unlink=%d", fd->inode, fd->closed->unlink );
|
||||
fprintf( stderr, "\n" );
|
||||
}
|
||||
|
||||
@@ -1465,7 +1469,6 @@ static void fd_destroy( struct object *obj )
|
||||
|
||||
if (fd->completion) release_object( fd->completion );
|
||||
remove_fd_locks( fd );
|
||||
- free( fd->unix_name );
|
||||
list_remove( &fd->inode_entry );
|
||||
if (fd->poll_index != -1) remove_poll_user( fd, fd->poll_index );
|
||||
if (fd->inode)
|
||||
@@ -1476,6 +1479,7 @@ static void fd_destroy( struct object *obj )
|
||||
else /* no inode, close it right away */
|
||||
{
|
||||
if (fd->unix_fd != -1) close( fd->unix_fd );
|
||||
+ free( fd->unix_name );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1563,7 +1567,7 @@ static inline void unmount_fd( struct fd *fd )
|
||||
fd->unix_fd = -1;
|
||||
fd->no_fd_status = STATUS_VOLUME_DISMOUNTED;
|
||||
fd->closed->unix_fd = -1;
|
||||
- fd->closed->unlink[0] = 0;
|
||||
+ fd->closed->unlink = 0;
|
||||
|
||||
/* stop using Unix locks on this fd (existing locks have been removed by close) */
|
||||
fd->fs_locks = 0;
|
||||
@@ -1662,7 +1666,8 @@ struct fd *dup_fd_object( struct fd *orig, unsigned int access, unsigned int sha
|
||||
goto failed;
|
||||
}
|
||||
closed->unix_fd = fd->unix_fd;
|
||||
- closed->unlink[0] = 0;
|
||||
+ closed->unlink = 0;
|
||||
+ closed->unix_name = fd->unix_name;
|
||||
fd->closed = closed;
|
||||
fd->inode = (struct inode *)grab_object( orig->inode );
|
||||
list_add_head( &fd->inode->open, &fd->inode_entry );
|
||||
@@ -1738,7 +1743,6 @@ struct fd *open_fd( struct fd *root, const char *name, int flags, mode_t *mode,
|
||||
struct stat st;
|
||||
struct closed_fd *closed_fd;
|
||||
struct fd *fd;
|
||||
- const char *unlink_name = "";
|
||||
int root_fd = -1;
|
||||
int rw_mode;
|
||||
int do_chmod = 0;
|
||||
@@ -1753,8 +1757,7 @@ struct fd *open_fd( struct fd *root, const char *name, int flags, mode_t *mode,
|
||||
if (!(fd = alloc_fd_object())) return NULL;
|
||||
|
||||
fd->options = options;
|
||||
- if (options & FILE_DELETE_ON_CLOSE) unlink_name = name;
|
||||
- if (!(closed_fd = mem_alloc( sizeof(*closed_fd) + strlen(unlink_name) )))
|
||||
+ if (!(closed_fd = mem_alloc( sizeof(*closed_fd) )))
|
||||
{
|
||||
release_object( fd );
|
||||
return NULL;
|
||||
@@ -1834,7 +1837,8 @@ 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] = 0;
|
||||
+ closed_fd->unlink = 0;
|
||||
+ closed_fd->unix_name = fd->unix_name;
|
||||
|
||||
if (do_chmod) fchmod( fd->unix_fd, *mode );
|
||||
fstat( fd->unix_fd, &st );
|
||||
@@ -1877,7 +1881,7 @@ struct fd *open_fd( struct fd *root, const char *name, int flags, mode_t *mode,
|
||||
set_error( err );
|
||||
return NULL;
|
||||
}
|
||||
- strcpy( closed_fd->unlink, unlink_name );
|
||||
+ closed_fd->unlink = (options & FILE_DELETE_ON_CLOSE) != 0;
|
||||
if (flags & O_TRUNC)
|
||||
{
|
||||
if (S_ISDIR(st.st_mode))
|
||||
@@ -1891,7 +1895,7 @@ struct fd *open_fd( struct fd *root, const char *name, int flags, mode_t *mode,
|
||||
}
|
||||
else /* special file */
|
||||
{
|
||||
- if (unlink_name[0]) /* we can't unlink special files */
|
||||
+ if (options & FILE_DELETE_ON_CLOSE) /* we can't unlink special files */
|
||||
{
|
||||
set_error( STATUS_INVALID_PARAMETER );
|
||||
goto error;
|
||||
--
|
||||
2.4.2
|
||||
|
@ -1,229 +0,0 @@
|
||||
From 2009dee9faca0fb2ac2b1422a62445a523c4fe56 Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Thu, 7 Aug 2014 20:32:19 -0600
|
||||
Subject: server: Add support for setting file disposition information.
|
||||
|
||||
Based on a patch by Dmitry Timoshkov.
|
||||
---
|
||||
dlls/kernel32/tests/file.c | 1 -
|
||||
dlls/ntdll/file.c | 16 ++++++++++++++++
|
||||
dlls/ntdll/tests/file.c | 13 ++-----------
|
||||
server/fd.c | 44 ++++++++++++++++++++++++++++++++++++++++++++
|
||||
server/protocol.def | 7 +++++++
|
||||
5 files changed, 69 insertions(+), 12 deletions(-)
|
||||
|
||||
diff --git a/dlls/kernel32/tests/file.c b/dlls/kernel32/tests/file.c
|
||||
index 53d225c..dd64c91 100644
|
||||
--- a/dlls/kernel32/tests/file.c
|
||||
+++ b/dlls/kernel32/tests/file.c
|
||||
@@ -4645,7 +4645,6 @@ todo_wine
|
||||
|
||||
dispinfo.DeleteFile = TRUE;
|
||||
ret = pSetFileInformationByHandle(file, FileDispositionInfo, &dispinfo, sizeof(dispinfo));
|
||||
-todo_wine
|
||||
ok(ret, "setting FileDispositionInfo failed, error %d\n", GetLastError());
|
||||
|
||||
CloseHandle(file);
|
||||
diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c
|
||||
index d081750..314c233 100644
|
||||
--- a/dlls/ntdll/file.c
|
||||
+++ b/dlls/ntdll/file.c
|
||||
@@ -2765,6 +2765,22 @@ NTSTATUS WINAPI NtSetInformationFile(HANDLE handle, PIO_STATUS_BLOCK io,
|
||||
else io->u.Status = STATUS_INVALID_PARAMETER_3;
|
||||
break;
|
||||
|
||||
+ case FileDispositionInformation:
|
||||
+ if (len >= sizeof(FILE_DISPOSITION_INFORMATION))
|
||||
+ {
|
||||
+ FILE_DISPOSITION_INFORMATION *info = ptr;
|
||||
+
|
||||
+ SERVER_START_REQ( set_fd_info )
|
||||
+ {
|
||||
+ req->handle = wine_server_obj_handle( handle );
|
||||
+ req->unlink = info->DoDeleteFile;
|
||||
+ io->u.Status = wine_server_call( req );
|
||||
+ }
|
||||
+ SERVER_END_REQ;
|
||||
+ } else
|
||||
+ io->u.Status = STATUS_INVALID_PARAMETER_3;
|
||||
+ break;
|
||||
+
|
||||
default:
|
||||
FIXME("Unsupported class (%d)\n", class);
|
||||
io->u.Status = STATUS_NOT_IMPLEMENTED;
|
||||
diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c
|
||||
index 86a4516..57ae15c 100644
|
||||
--- a/dlls/ntdll/tests/file.c
|
||||
+++ b/dlls/ntdll/tests/file.c
|
||||
@@ -1473,7 +1473,6 @@ static void test_file_disposition_information(void)
|
||||
ok( res == STATUS_INFO_LENGTH_MISMATCH, "expected STATUS_INFO_LENGTH_MISMATCH, got %x\n", res );
|
||||
fdi2 = 0x100;
|
||||
res = pNtSetInformationFile( handle, &io, &fdi2, sizeof(fdi2), FileDispositionInformation );
|
||||
- todo_wine
|
||||
ok( res == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %x\n", res );
|
||||
CloseHandle( handle );
|
||||
fileDeleted = GetFileAttributesA( buffer ) == INVALID_FILE_ATTRIBUTES && GetLastError() == ERROR_FILE_NOT_FOUND;
|
||||
@@ -1488,7 +1487,6 @@ static void test_file_disposition_information(void)
|
||||
ok( res == STATUS_INVALID_INFO_CLASS || res == STATUS_NOT_IMPLEMENTED, "Unexpected NtQueryInformationFile result (expected STATUS_INVALID_INFO_CLASS, got %x)\n", res );
|
||||
fdi.DoDeleteFile = TRUE;
|
||||
res = pNtSetInformationFile( handle, &io, &fdi, sizeof fdi, FileDispositionInformation );
|
||||
- todo_wine
|
||||
ok( res == STATUS_ACCESS_DENIED, "unexpected FileDispositionInformation result (expected STATUS_ACCESS_DENIED, got %x)\n", res );
|
||||
CloseHandle( handle );
|
||||
fileDeleted = GetFileAttributesA( buffer ) == INVALID_FILE_ATTRIBUTES && GetLastError() == ERROR_FILE_NOT_FOUND;
|
||||
@@ -1501,11 +1499,9 @@ static void test_file_disposition_information(void)
|
||||
ok( handle != INVALID_HANDLE_VALUE, "failed to create temp file\n" );
|
||||
fdi.DoDeleteFile = TRUE;
|
||||
res = pNtSetInformationFile( handle, &io, &fdi, sizeof fdi, FileDispositionInformation );
|
||||
- todo_wine
|
||||
ok( res == STATUS_SUCCESS, "unexpected FileDispositionInformation result (expected STATUS_SUCCESS, got %x)\n", res );
|
||||
CloseHandle( handle );
|
||||
fileDeleted = GetFileAttributesA( buffer ) == INVALID_FILE_ATTRIBUTES && GetLastError() == ERROR_FILE_NOT_FOUND;
|
||||
- todo_wine
|
||||
ok( fileDeleted, "File should have been deleted\n" );
|
||||
DeleteFileA( buffer );
|
||||
|
||||
@@ -1519,6 +1515,7 @@ static void test_file_disposition_information(void)
|
||||
ok( res == STATUS_CANNOT_DELETE, "unexpected FileDispositionInformation result (expected STATUS_CANNOT_DELETE, got %x)\n", res );
|
||||
CloseHandle( handle );
|
||||
fileDeleted = GetFileAttributesA( buffer ) == INVALID_FILE_ATTRIBUTES && GetLastError() == ERROR_FILE_NOT_FOUND;
|
||||
+ todo_wine
|
||||
ok( !fileDeleted, "File shouldn't have been deleted\n" );
|
||||
SetFileAttributesA( buffer, FILE_ATTRIBUTE_NORMAL );
|
||||
DeleteFileA( buffer );
|
||||
@@ -1529,11 +1526,9 @@ static void test_file_disposition_information(void)
|
||||
ok( handle != INVALID_HANDLE_VALUE, "failed to create temp file\n" );
|
||||
fdi.DoDeleteFile = TRUE;
|
||||
res = pNtSetInformationFile( handle, &io, &fdi, sizeof fdi, FileDispositionInformation );
|
||||
- todo_wine
|
||||
ok( res == STATUS_SUCCESS, "unexpected FileDispositionInformation result (expected STATUS_SUCCESS, got %x)\n", res );
|
||||
fdi.DoDeleteFile = FALSE;
|
||||
res = pNtSetInformationFile( handle, &io, &fdi, sizeof fdi, FileDispositionInformation );
|
||||
- todo_wine
|
||||
ok( res == STATUS_SUCCESS, "unexpected FileDispositionInformation result (expected STATUS_SUCCESS, got %x)\n", res );
|
||||
CloseHandle( handle );
|
||||
fileDeleted = GetFileAttributesA( buffer ) == INVALID_FILE_ATTRIBUTES && GetLastError() == ERROR_FILE_NOT_FOUND;
|
||||
@@ -1546,7 +1541,6 @@ static void test_file_disposition_information(void)
|
||||
ok( handle != INVALID_HANDLE_VALUE, "failed to create temp file\n" );
|
||||
fdi.DoDeleteFile = FALSE;
|
||||
res = pNtSetInformationFile( handle, &io, &fdi, sizeof fdi, FileDispositionInformation );
|
||||
- todo_wine
|
||||
ok( res == STATUS_SUCCESS, "unexpected FileDispositionInformation result (expected STATUS_SUCCESS, got %x)\n", res );
|
||||
CloseHandle( handle );
|
||||
fileDeleted = GetFileAttributesA( buffer ) == INVALID_FILE_ATTRIBUTES && GetLastError() == ERROR_FILE_NOT_FOUND;
|
||||
@@ -1561,7 +1555,6 @@ static void test_file_disposition_information(void)
|
||||
CloseHandle( handle );
|
||||
fdi.DoDeleteFile = FALSE;
|
||||
res = pNtSetInformationFile( handle2, &io, &fdi, sizeof fdi, FileDispositionInformation );
|
||||
- todo_wine
|
||||
ok( res == STATUS_SUCCESS, "unexpected FileDispositionInformation result (expected STATUS_SUCCESS, got %x)\n", res );
|
||||
CloseHandle( handle2 );
|
||||
fileDeleted = GetFileAttributesA( buffer ) == INVALID_FILE_ATTRIBUTES && GetLastError() == ERROR_FILE_NOT_FOUND;
|
||||
@@ -1576,11 +1569,9 @@ static void test_file_disposition_information(void)
|
||||
ok( handle != INVALID_HANDLE_VALUE, "failed to open a directory\n" );
|
||||
fdi.DoDeleteFile = TRUE;
|
||||
res = pNtSetInformationFile( handle, &io, &fdi, sizeof fdi, FileDispositionInformation );
|
||||
- todo_wine
|
||||
ok( res == STATUS_SUCCESS, "unexpected FileDispositionInformation result (expected STATUS_SUCCESS, got %x)\n", res );
|
||||
CloseHandle( handle );
|
||||
fileDeleted = GetFileAttributesA( buffer ) == INVALID_FILE_ATTRIBUTES && GetLastError() == ERROR_FILE_NOT_FOUND;
|
||||
- todo_wine
|
||||
ok( fileDeleted, "Directory should have been deleted\n" );
|
||||
RemoveDirectoryA( buffer );
|
||||
|
||||
@@ -1593,7 +1584,6 @@ static void test_file_disposition_information(void)
|
||||
RemoveDirectoryA( buffer );
|
||||
fdi.DoDeleteFile = FALSE;
|
||||
res = pNtSetInformationFile( handle, &io, &fdi, sizeof fdi, FileDispositionInformation );
|
||||
- todo_wine
|
||||
ok( res == STATUS_SUCCESS, "unexpected FileDispositionInformation result (expected STATUS_SUCCESS, got %x)\n", res );
|
||||
CloseHandle( handle );
|
||||
fileDeleted = GetFileAttributesA( buffer ) == INVALID_FILE_ATTRIBUTES && GetLastError() == ERROR_FILE_NOT_FOUND;
|
||||
@@ -1618,6 +1608,7 @@ static void test_file_disposition_information(void)
|
||||
buffer[dirpos] = '\0';
|
||||
CloseHandle( handle );
|
||||
fileDeleted = GetFileAttributesA( buffer ) == INVALID_FILE_ATTRIBUTES && GetLastError() == ERROR_FILE_NOT_FOUND;
|
||||
+ todo_wine
|
||||
ok( !fileDeleted, "Directory shouldn't have been deleted\n" );
|
||||
RemoveDirectoryA( buffer );
|
||||
}
|
||||
diff --git a/server/fd.c b/server/fd.c
|
||||
index 6b95d6c..f607261 100644
|
||||
--- a/server/fd.c
|
||||
+++ b/server/fd.c
|
||||
@@ -2214,6 +2214,39 @@ static struct fd *get_handle_fd_obj( struct process *process, obj_handle_t handl
|
||||
return fd;
|
||||
}
|
||||
|
||||
+/* set disposition for the fd */
|
||||
+static void set_fd_disposition( struct fd *fd, int unlink )
|
||||
+{
|
||||
+ struct stat st;
|
||||
+
|
||||
+ if (!fd->inode)
|
||||
+ {
|
||||
+ set_error( STATUS_OBJECT_TYPE_MISMATCH );
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ if (fd->unix_fd == -1)
|
||||
+ {
|
||||
+ set_error( fd->no_fd_status );
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ if (fstat( fd->unix_fd, &st ) == -1)
|
||||
+ {
|
||||
+ file_set_error();
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ /* can't unlink special files */
|
||||
+ if (unlink && !S_ISDIR(st.st_mode) && !S_ISREG(st.st_mode))
|
||||
+ {
|
||||
+ set_error( STATUS_INVALID_PARAMETER );
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ fd->closed->unlink = unlink || (fd->options & FILE_DELETE_ON_CLOSE);
|
||||
+}
|
||||
+
|
||||
struct completion *fd_get_completion( struct fd *fd, apc_param_t *p_key )
|
||||
{
|
||||
*p_key = fd->comp_key;
|
||||
@@ -2409,3 +2442,14 @@ DECL_HANDLER(add_fd_completion)
|
||||
release_object( fd );
|
||||
}
|
||||
}
|
||||
+
|
||||
+/* set fd information */
|
||||
+DECL_HANDLER(set_fd_info)
|
||||
+{
|
||||
+ struct fd *fd = get_handle_fd_obj( current->process, req->handle, DELETE );
|
||||
+ if (fd)
|
||||
+ {
|
||||
+ set_fd_disposition( fd, req->unlink );
|
||||
+ release_object( fd );
|
||||
+ }
|
||||
+}
|
||||
diff --git a/server/protocol.def b/server/protocol.def
|
||||
index ffee0c0..ea9eb12 100644
|
||||
--- a/server/protocol.def
|
||||
+++ b/server/protocol.def
|
||||
@@ -3525,6 +3525,13 @@ enum coords_relative
|
||||
@END
|
||||
|
||||
|
||||
+/* set fd information */
|
||||
+@REQ(set_fd_info)
|
||||
+ obj_handle_t handle; /* handle to a file or directory */
|
||||
+ int unlink; /* whether to unlink file on close */
|
||||
+@END
|
||||
+
|
||||
+
|
||||
/* Retrieve layered info for a window */
|
||||
@REQ(get_window_layered_info)
|
||||
user_handle_t handle; /* handle to the window */
|
||||
--
|
||||
2.5.0
|
||||
|
@ -1,57 +0,0 @@
|
||||
From ccc579e226c2061d3138da446d30b8ba68397751 Mon Sep 17 00:00:00 2001
|
||||
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
|
||||
Date: Thu, 7 Aug 2014 21:14:25 -0600
|
||||
Subject: server: Do not permit FileDispositionInformation to delete a file
|
||||
without write access.
|
||||
|
||||
---
|
||||
dlls/ntdll/tests/file.c | 14 ++++++++++++++
|
||||
server/fd.c | 7 +++++++
|
||||
2 files changed, 21 insertions(+)
|
||||
|
||||
diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c
|
||||
index 57ae15c..d215d09 100644
|
||||
--- a/dlls/ntdll/tests/file.c
|
||||
+++ b/dlls/ntdll/tests/file.c
|
||||
@@ -1507,6 +1507,20 @@ static void test_file_disposition_information(void)
|
||||
|
||||
/* cannot set disposition on readonly file */
|
||||
GetTempFileNameA( tmp_path, "dis", 0, buffer );
|
||||
+ DeleteFileA( buffer );
|
||||
+ handle = CreateFileA(buffer, GENERIC_WRITE | DELETE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_READONLY, 0);
|
||||
+ ok( handle != INVALID_HANDLE_VALUE, "failed to create temp file\n" );
|
||||
+ fdi.DoDeleteFile = TRUE;
|
||||
+ res = pNtSetInformationFile( handle, &io, &fdi, sizeof fdi, FileDispositionInformation );
|
||||
+ ok( res == STATUS_CANNOT_DELETE, "unexpected FileDispositionInformation result (expected STATUS_CANNOT_DELETE, got %x)\n", res );
|
||||
+ CloseHandle( handle );
|
||||
+ fileDeleted = GetFileAttributesA( buffer ) == INVALID_FILE_ATTRIBUTES && GetLastError() == ERROR_FILE_NOT_FOUND;
|
||||
+ ok( !fileDeleted, "File shouldn't have been deleted\n" );
|
||||
+ SetFileAttributesA( buffer, FILE_ATTRIBUTE_NORMAL );
|
||||
+ DeleteFileA( buffer );
|
||||
+
|
||||
+ /* cannot set disposition on readonly file */
|
||||
+ GetTempFileNameA( tmp_path, "dis", 0, buffer );
|
||||
handle = CreateFileA(buffer, GENERIC_WRITE | DELETE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_READONLY, 0);
|
||||
ok( handle != INVALID_HANDLE_VALUE, "failed to create temp file\n" );
|
||||
fdi.DoDeleteFile = TRUE;
|
||||
diff --git a/server/fd.c b/server/fd.c
|
||||
index f607261..0bac57d 100644
|
||||
--- a/server/fd.c
|
||||
+++ b/server/fd.c
|
||||
@@ -2244,6 +2244,13 @@ static void set_fd_disposition( struct fd *fd, int unlink )
|
||||
return;
|
||||
}
|
||||
|
||||
+ /* can't unlink files we don't have permission to access */
|
||||
+ if (unlink && !(st.st_mode & (S_IWUSR | S_IWGRP | S_IWOTH)))
|
||||
+ {
|
||||
+ set_error( STATUS_CANNOT_DELETE );
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
fd->closed->unlink = unlink || (fd->options & FILE_DELETE_ON_CLOSE);
|
||||
}
|
||||
|
||||
--
|
||||
2.5.0
|
||||
|
@ -1,64 +0,0 @@
|
||||
From eb9b31d9ea9b15d16e3e8bafa33592ae79789672 Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Sat, 8 Aug 2015 21:42:25 +0200
|
||||
Subject: oleaut32: Fix possible integer overflow in VarR4FromDec.
|
||||
|
||||
---
|
||||
dlls/oleaut32/tests/vartype.c | 3 ++-
|
||||
dlls/oleaut32/vartype.c | 8 ++++----
|
||||
2 files changed, 6 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/dlls/oleaut32/tests/vartype.c b/dlls/oleaut32/tests/vartype.c
|
||||
index 4dd77a0..7cbb059 100644
|
||||
--- a/dlls/oleaut32/tests/vartype.c
|
||||
+++ b/dlls/oleaut32/tests/vartype.c
|
||||
@@ -2890,7 +2890,8 @@ static void test_VarR4FromDec(void)
|
||||
|
||||
CONVERT_DEC(VarR4FromDec,2,0x80,0,3276800); EXPECT(-32768.0f);
|
||||
CONVERT_DEC(VarR4FromDec,2,0,0,3276700); EXPECT(32767.0f);
|
||||
-
|
||||
+ CONVERT_DEC(VarR4FromDec,10,0,0,3276700); EXPECT(0.00032767f);
|
||||
+
|
||||
CONVERT_DEC(VarR4FromDec,0,0,1,0); EXPECT(18446744073709551616.0f);
|
||||
}
|
||||
|
||||
diff --git a/dlls/oleaut32/vartype.c b/dlls/oleaut32/vartype.c
|
||||
index 607d1a2..bf7ebc6 100644
|
||||
--- a/dlls/oleaut32/vartype.c
|
||||
+++ b/dlls/oleaut32/vartype.c
|
||||
@@ -2948,28 +2948,28 @@ HRESULT WINAPI VarR4FromUI4(ULONG ulIn, float *pFltOut)
|
||||
HRESULT WINAPI VarR4FromDec(DECIMAL* pDecIn, float *pFltOut)
|
||||
{
|
||||
BYTE scale = DEC_SCALE(pDecIn);
|
||||
- int divisor = 1;
|
||||
+ double divisor = 1.0;
|
||||
double highPart;
|
||||
|
||||
if (scale > DEC_MAX_SCALE || DEC_SIGN(pDecIn) & ~DECIMAL_NEG)
|
||||
return E_INVALIDARG;
|
||||
|
||||
while (scale--)
|
||||
- divisor *= 10;
|
||||
+ divisor *= 10.0;
|
||||
|
||||
if (DEC_SIGN(pDecIn))
|
||||
divisor = -divisor;
|
||||
|
||||
if (DEC_HI32(pDecIn))
|
||||
{
|
||||
- highPart = (double)DEC_HI32(pDecIn) / (double)divisor;
|
||||
+ highPart = (double)DEC_HI32(pDecIn) / divisor;
|
||||
highPart *= 4294967296.0F;
|
||||
highPart *= 4294967296.0F;
|
||||
}
|
||||
else
|
||||
highPart = 0.0;
|
||||
|
||||
- *pFltOut = (double)DEC_LO64(pDecIn) / (double)divisor + highPart;
|
||||
+ *pFltOut = (double)DEC_LO64(pDecIn) / divisor + highPart;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
--
|
||||
2.5.0
|
||||
|
@ -1 +0,0 @@
|
||||
Fixes: [38988] Fix possible integer overflow in VarR4FromDec
|
@ -55,7 +55,7 @@ version()
|
||||
echo "Copyright (C) 2014-2015 the Wine Staging project authors."
|
||||
echo ""
|
||||
echo "Patchset to be applied on upstream Wine:"
|
||||
echo " commit cfbc37c699e3b3b27df4c566014e6dde9c7194b8"
|
||||
echo " commit 3b5107d06305972beaa9c5ff147ecbcd99949a75"
|
||||
echo ""
|
||||
}
|
||||
|
||||
@ -147,7 +147,6 @@ patch_enable_all ()
|
||||
enable_kernel32_SetFileInformationByHandle="$1"
|
||||
enable_kernel32_TimezoneInformation_Registry="$1"
|
||||
enable_kernel32_VerifyVersionInfo="$1"
|
||||
enable_krnl386_exe16_GetTempDrive="$1"
|
||||
enable_libs_Debug_Channel="$1"
|
||||
enable_libs_Unicode_Collation="$1"
|
||||
enable_makedep_PARENTSPEC="$1"
|
||||
@ -194,7 +193,6 @@ patch_enable_all ()
|
||||
enable_nvcuda_CUDA_Support="$1"
|
||||
enable_nvcuvid_CUDA_Video_Support="$1"
|
||||
enable_nvencodeapi_Video_Encoder="$1"
|
||||
enable_oleaut32_VarR4FromDec="$1"
|
||||
enable_openal32_EFX_Extension="$1"
|
||||
enable_opengl32_Revert_Disable_Ext="$1"
|
||||
enable_quartz_MediaSeeking_Positions="$1"
|
||||
@ -260,7 +258,6 @@ patch_enable_all ()
|
||||
enable_wineboot_drivers_etc_Stubs="$1"
|
||||
enable_winecfg_Libraries="$1"
|
||||
enable_winecfg_Staging="$1"
|
||||
enable_winecfg_Theme_Leak="$1"
|
||||
enable_winecfg_Unmounted_Devices="$1"
|
||||
enable_wineconsole_Forward_Exitcode="$1"
|
||||
enable_wined3d_Accounting="$1"
|
||||
@ -529,9 +526,6 @@ patch_enable ()
|
||||
kernel32-VerifyVersionInfo)
|
||||
enable_kernel32_VerifyVersionInfo="$2"
|
||||
;;
|
||||
krnl386.exe16-GetTempDrive)
|
||||
enable_krnl386_exe16_GetTempDrive="$2"
|
||||
;;
|
||||
libs-Debug_Channel)
|
||||
enable_libs_Debug_Channel="$2"
|
||||
;;
|
||||
@ -670,9 +664,6 @@ patch_enable ()
|
||||
nvencodeapi-Video_Encoder)
|
||||
enable_nvencodeapi_Video_Encoder="$2"
|
||||
;;
|
||||
oleaut32-VarR4FromDec)
|
||||
enable_oleaut32_VarR4FromDec="$2"
|
||||
;;
|
||||
openal32-EFX_Extension)
|
||||
enable_openal32_EFX_Extension="$2"
|
||||
;;
|
||||
@ -868,9 +859,6 @@ patch_enable ()
|
||||
winecfg-Staging)
|
||||
enable_winecfg_Staging="$2"
|
||||
;;
|
||||
winecfg-Theme_Leak)
|
||||
enable_winecfg_Theme_Leak="$2"
|
||||
;;
|
||||
winecfg-Unmounted_Devices)
|
||||
enable_winecfg_Unmounted_Devices="$2"
|
||||
;;
|
||||
@ -3166,27 +3154,20 @@ fi
|
||||
# | * [#30399] Support for NtSetInformationFile class FileRenameInformation
|
||||
# |
|
||||
# | Modified files:
|
||||
# | * dlls/kernel32/tests/file.c, dlls/ntdll/file.c, dlls/ntdll/tests/file.c, include/winternl.h, server/fd.c,
|
||||
# | server/protocol.def
|
||||
# | * dlls/ntdll/file.c, dlls/ntdll/tests/file.c, include/winternl.h, server/fd.c, server/protocol.def
|
||||
# |
|
||||
if test "$enable_ntdll_FileDispositionInformation" -eq 1; then
|
||||
patch_apply ntdll-FileDispositionInformation/0001-server-Keep-a-pointer-to-parent-s-fd-unix_name-in-th.patch
|
||||
patch_apply ntdll-FileDispositionInformation/0002-server-Add-support-for-setting-file-disposition-info.patch
|
||||
patch_apply ntdll-FileDispositionInformation/0003-server-Do-not-permit-FileDispositionInformation-to-d.patch
|
||||
patch_apply ntdll-FileDispositionInformation/0004-ntdll-tests-Added-tests-to-set-disposition-on-file-w.patch
|
||||
patch_apply ntdll-FileDispositionInformation/0005-server-Do-not-allow-to-set-disposition-on-file-which.patch
|
||||
patch_apply ntdll-FileDispositionInformation/0006-ntdll-tests-Add-tests-for-FileRenameInformation.patch
|
||||
patch_apply ntdll-FileDispositionInformation/0007-ntdll-tests-Add-additional-tests-for-FileRenameInfor.patch
|
||||
patch_apply ntdll-FileDispositionInformation/0008-ntdll-tests-Add-tests-for-FileRenameInformation-with.patch
|
||||
patch_apply ntdll-FileDispositionInformation/0009-ntdll-Implement-FileRenameInformation-support.patch
|
||||
patch_apply ntdll-FileDispositionInformation/0010-server-When-combining-root-and-name-make-sure-there-.patch
|
||||
patch_apply ntdll-FileDispositionInformation/0011-include-Add-declaration-for-FILE_LINK_INFORMATION.patch
|
||||
patch_apply ntdll-FileDispositionInformation/0012-ntdll-tests-Add-tests-for-FileLinkInformation-class.patch
|
||||
patch_apply ntdll-FileDispositionInformation/0013-server-Implement-support-for-FileLinkInformation-cla.patch
|
||||
patch_apply ntdll-FileDispositionInformation/0001-ntdll-tests-Added-tests-to-set-disposition-on-file-w.patch
|
||||
patch_apply ntdll-FileDispositionInformation/0002-server-Do-not-allow-to-set-disposition-on-file-which.patch
|
||||
patch_apply ntdll-FileDispositionInformation/0003-ntdll-tests-Add-tests-for-FileRenameInformation.patch
|
||||
patch_apply ntdll-FileDispositionInformation/0004-ntdll-tests-Add-additional-tests-for-FileRenameInfor.patch
|
||||
patch_apply ntdll-FileDispositionInformation/0005-ntdll-tests-Add-tests-for-FileRenameInformation-with.patch
|
||||
patch_apply ntdll-FileDispositionInformation/0006-ntdll-Implement-FileRenameInformation-support.patch
|
||||
patch_apply ntdll-FileDispositionInformation/0007-server-When-combining-root-and-name-make-sure-there-.patch
|
||||
patch_apply ntdll-FileDispositionInformation/0008-include-Add-declaration-for-FILE_LINK_INFORMATION.patch
|
||||
patch_apply ntdll-FileDispositionInformation/0009-ntdll-tests-Add-tests-for-FileLinkInformation-class.patch
|
||||
patch_apply ntdll-FileDispositionInformation/0010-server-Implement-support-for-FileLinkInformation-cla.patch
|
||||
(
|
||||
echo '+ { "Dmitry Timoshkov", "server: Keep a pointer to parent'\''s fd unix_name in the closed_fd structure.", 1 },';
|
||||
echo '+ { "Sebastian Lackner", "server: Add support for setting file disposition information.", 1 },';
|
||||
echo '+ { "Erich E. Hoover", "server: Do not permit FileDispositionInformation to delete a file without write access.", 1 },';
|
||||
echo '+ { "Qian Hong", "ntdll/tests: Added tests to set disposition on file which is mapped to memory.", 1 },';
|
||||
echo '+ { "Qian Hong", "server: Do not allow to set disposition on file which has a file mapping.", 1 },';
|
||||
echo '+ { "Jianqiu Zhang", "ntdll/tests: Add tests for FileRenameInformation.", 1 },';
|
||||
@ -3417,21 +3398,6 @@ if test "$enable_kernel32_VerifyVersionInfo" -eq 1; then
|
||||
) >> "$patchlist"
|
||||
fi
|
||||
|
||||
# Patchset krnl386.exe16-GetTempDrive
|
||||
# |
|
||||
# | This patchset fixes the following Wine bugs:
|
||||
# | * [#39104] Fix implementation of krnl386.exe16.GetTempDrive
|
||||
# |
|
||||
# | Modified files:
|
||||
# | * dlls/krnl386.exe16/file.c
|
||||
# |
|
||||
if test "$enable_krnl386_exe16_GetTempDrive" -eq 1; then
|
||||
patch_apply krnl386.exe16-GetTempDrive/0001-krnl386.exe16-Increase-buffer-size-in-GetTempDrive.patch
|
||||
(
|
||||
echo '+ { "Michael Müller", "krnl386.exe16: Increase buffer size in GetTempDrive.", 1 },';
|
||||
) >> "$patchlist"
|
||||
fi
|
||||
|
||||
# Patchset libs-Debug_Channel
|
||||
# |
|
||||
# | Modified files:
|
||||
@ -4205,21 +4171,6 @@ if test "$enable_nvencodeapi_Video_Encoder" -eq 1; then
|
||||
) >> "$patchlist"
|
||||
fi
|
||||
|
||||
# Patchset oleaut32-VarR4FromDec
|
||||
# |
|
||||
# | This patchset fixes the following Wine bugs:
|
||||
# | * [#38988] Fix possible integer overflow in VarR4FromDec
|
||||
# |
|
||||
# | Modified files:
|
||||
# | * dlls/oleaut32/tests/vartype.c, dlls/oleaut32/vartype.c
|
||||
# |
|
||||
if test "$enable_oleaut32_VarR4FromDec" -eq 1; then
|
||||
patch_apply oleaut32-VarR4FromDec/0001-oleaut32-Fix-possible-integer-overflow-in-VarR4FromD.patch
|
||||
(
|
||||
echo '+ { "Sebastian Lackner", "oleaut32: Fix possible integer overflow in VarR4FromDec.", 1 },';
|
||||
) >> "$patchlist"
|
||||
fi
|
||||
|
||||
# Patchset openal32-EFX_Extension
|
||||
# |
|
||||
# | This patchset fixes the following Wine bugs:
|
||||
@ -5173,18 +5124,6 @@ if test "$enable_winecfg_Libraries" -eq 1; then
|
||||
) >> "$patchlist"
|
||||
fi
|
||||
|
||||
# Patchset winecfg-Theme_Leak
|
||||
# |
|
||||
# | Modified files:
|
||||
# | * programs/winecfg/theme.c
|
||||
# |
|
||||
if test "$enable_winecfg_Theme_Leak" -eq 1; then
|
||||
patch_apply winecfg-Theme_Leak/0001-winecfg-Do-not-overwrite-theme-each-time-an-item-is-.patch
|
||||
(
|
||||
echo '+ { "Michael Müller", "winecfg: Do not overwrite theme each time an item is drawn.", 1 },';
|
||||
) >> "$patchlist"
|
||||
fi
|
||||
|
||||
# Patchset winecfg-Unmounted_Devices
|
||||
# |
|
||||
# | Modified files:
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 79e9440272eed16300dc4aacc96765a24841a705 Mon Sep 17 00:00:00 2001
|
||||
From 7571a6f9f7933133862d13e4ab25814b554d002e Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Fri, 3 Apr 2015 03:58:47 +0200
|
||||
Subject: server: Allow to open files without any permission bits. (try 2)
|
||||
@ -12,10 +12,10 @@ 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 466100d..329ae09 100644
|
||||
index 70aa949..799e306 100644
|
||||
--- a/dlls/advapi32/tests/security.c
|
||||
+++ b/dlls/advapi32/tests/security.c
|
||||
@@ -3319,17 +3319,13 @@ static void test_CreateDirectoryA(void)
|
||||
@@ -3326,17 +3326,13 @@ static void test_CreateDirectoryA(void)
|
||||
error = pGetNamedSecurityInfoA(tmpfile, SE_FILE_OBJECT,
|
||||
OWNER_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION,
|
||||
(PSID *)&owner, NULL, &pDacl, NULL, &pSD);
|
||||
@ -39,7 +39,7 @@ index 466100d..329ae09 100644
|
||||
CloseHandle(hTemp);
|
||||
|
||||
/* Test inheritance of ACLs in NtCreateFile without security descriptor */
|
||||
@@ -3399,17 +3395,13 @@ static void test_CreateDirectoryA(void)
|
||||
@@ -3406,17 +3402,13 @@ static void test_CreateDirectoryA(void)
|
||||
error = pGetNamedSecurityInfoA(tmpfile, SE_FILE_OBJECT,
|
||||
OWNER_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION,
|
||||
(PSID *)&owner, NULL, &pDacl, NULL, &pSD);
|
||||
@ -64,18 +64,18 @@ index 466100d..329ae09 100644
|
||||
|
||||
done:
|
||||
diff --git a/server/fd.c b/server/fd.c
|
||||
index e3b722c..3afb89a 100644
|
||||
index 0bac57d..e8839c2 100644
|
||||
--- a/server/fd.c
|
||||
+++ b/server/fd.c
|
||||
@@ -1741,6 +1741,7 @@ struct fd *open_fd( struct fd *root, const char *name, int flags, mode_t *mode,
|
||||
const char *unlink_name = "";
|
||||
@@ -1745,6 +1745,7 @@ struct fd *open_fd( struct fd *root, const char *name, int flags, mode_t *mode,
|
||||
struct fd *fd;
|
||||
int root_fd = -1;
|
||||
int rw_mode;
|
||||
+ int do_chmod = 0;
|
||||
|
||||
if (((options & FILE_DELETE_ON_CLOSE) && !(access & DELETE)) ||
|
||||
((options & FILE_DIRECTORY_FILE) && (flags & O_TRUNC)))
|
||||
@@ -1801,16 +1802,36 @@ struct fd *open_fd( struct fd *root, const char *name, int flags, mode_t *mode,
|
||||
@@ -1804,10 +1805,28 @@ struct fd *open_fd( struct fd *root, const char *name, int flags, mode_t *mode,
|
||||
if ((access & FILE_UNIX_WRITE_ACCESS) || (flags & O_CREAT))
|
||||
fd->unix_fd = open( name, O_RDONLY | (flags & ~(O_TRUNC | O_CREAT | O_EXCL)), *mode );
|
||||
}
|
||||
@ -104,14 +104,15 @@ index e3b722c..3afb89a 100644
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1815,6 +1834,8 @@ 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] = 0;
|
||||
closed_fd->unlink = 0;
|
||||
closed_fd->unix_name = fd->unix_name;
|
||||
+
|
||||
+ if (do_chmod) fchmod( fd->unix_fd, *mode );
|
||||
+ if (do_chmod) chmod( name, *mode );
|
||||
fstat( fd->unix_fd, &st );
|
||||
*mode = st.st_mode;
|
||||
|
||||
--
|
||||
2.3.3
|
||||
2.5.0
|
||||
|
||||
|
@ -1,26 +0,0 @@
|
||||
From 13a30e3966820c04e76e48182e7c2b9a979ecc17 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Sat, 8 Aug 2015 00:52:36 +0200
|
||||
Subject: winecfg: Do not overwrite theme each time an item is drawn.
|
||||
|
||||
Fixes a leak and a use-after-free.
|
||||
---
|
||||
programs/winecfg/theme.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/programs/winecfg/theme.c b/programs/winecfg/theme.c
|
||||
index 8bc3c88..1f4818b 100644
|
||||
--- a/programs/winecfg/theme.c
|
||||
+++ b/programs/winecfg/theme.c
|
||||
@@ -1094,7 +1094,7 @@ static void on_draw_item(HWND hDlg, WPARAM wParam, LPARAM lParam)
|
||||
HTHEME theme;
|
||||
RECT buttonrect;
|
||||
|
||||
- theme = OpenThemeData(draw_info->hwndItem, WC_BUTTONW);
|
||||
+ theme = OpenThemeData(NULL, WC_BUTTONW);
|
||||
|
||||
if (theme) {
|
||||
MARGINS margins;
|
||||
--
|
||||
2.5.0
|
||||
|
Loading…
Reference in New Issue
Block a user