mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2024-09-13 09:17:20 -07:00
Add fix for unintentional leaks with ntdll internals.
This commit is contained in:
parent
5f93d74102
commit
ff169cd1b7
@ -13,9 +13,10 @@ which are not present in regular wine, and always report such issues to us
|
||||
Included bugfixes and improvements
|
||||
----------------------------------
|
||||
|
||||
**Bugfixes and features included in the next upcoming release [1]:**
|
||||
**Bugfixes and features included in the next upcoming release [2]:**
|
||||
|
||||
* Support for DOS hidden/system file attributes ([Wine Bug #9158](http://bugs.winehq.org/show_bug.cgi?id=9158 "Multiple Microsoft development tools online/web installers fail to skip \"$shtdwn$.req\" with FILE_ATTRIBUTE_HIDDEN (Visual Studio Express Editions, .NET Framework 3.0)"))
|
||||
* Unintentional leaks with ntdll internals
|
||||
|
||||
|
||||
**Bugs fixed in Wine-Compholio 1.7.25 [53]:**
|
||||
|
@ -30,6 +30,7 @@ PATCHLIST := \
|
||||
ntdll-FD_Cache.ok \
|
||||
ntdll-FileDispositionInformation.ok \
|
||||
ntdll-Fix_Alignment.ok \
|
||||
ntdll-Fix_Free.ok \
|
||||
ntdll-Junction_Points.ok \
|
||||
ntdll-Pipe_SpecialCharacters.ok \
|
||||
ntdll-loader_EntryPoint.ok \
|
||||
@ -414,7 +415,7 @@ msi-MoveFiles.ok:
|
||||
# | dlls/ntdll/tests/file.c, include/wine/port.h, libs/port/Makefile.in, libs/port/xattr.c
|
||||
# |
|
||||
.INTERMEDIATE: ntdll-DOS_Attributes.ok
|
||||
ntdll-DOS_Attributes.ok:
|
||||
ntdll-DOS_Attributes.ok: ntdll-Fix_Free.ok
|
||||
$(call APPLY_FILE,ntdll-DOS_Attributes/0001-ntdll-Unify-retrieving-the-attributes-of-a-file.patch)
|
||||
$(call APPLY_FILE,ntdll-DOS_Attributes/0002-ntdll-Implement-retrieving-DOS-attributes-in-NtQuery.patch)
|
||||
$(call APPLY_FILE,ntdll-DOS_Attributes/0003-ntdll-Implement-retrieving-DOS-attributes-in-NtQuery.patch)
|
||||
@ -499,6 +500,30 @@ ntdll-Fix_Alignment.ok:
|
||||
echo '+ { "ntdll-Fix_Alignment", "Michael Müller", "Move NtProtectVirtualMemory and NtCreateSection to separate pages in ntdll on x86." },'; \
|
||||
) > ntdll-Fix_Alignment.ok
|
||||
|
||||
# Patchset ntdll-Fix_Free
|
||||
# |
|
||||
# | Included patches:
|
||||
# | * Fix unintentional leaks with ntdll internals [by Erich E. Hoover]
|
||||
# |
|
||||
# | Modified files:
|
||||
# | * dlls/kernel32/path.c, dlls/kernel32/volume.c, dlls/ntdll/directory.c, dlls/ntdll/file.c, dlls/ntdll/loader.c
|
||||
# |
|
||||
.INTERMEDIATE: ntdll-Fix_Free.ok
|
||||
ntdll-Fix_Free.ok:
|
||||
$(call APPLY_FILE,ntdll-Fix_Free/0001-ntdll-Make-nt_to_unix_file_name_attr-return-always-s.patch)
|
||||
$(call APPLY_FILE,ntdll-Fix_Free/0002-ntdll-Make-wine_nt_to_unix_file_name-return-always-s.patch)
|
||||
$(call APPLY_FILE,ntdll-Fix_Free/0003-ntdll-Make-file_id_to_unix_file_name-return-always-s.patch)
|
||||
$(call APPLY_FILE,ntdll-Fix_Free/0004-ntdll-Fix-leak-on-STATUS_NO_SUCH_FILE-in-NtQueryFull.patch)
|
||||
$(call APPLY_FILE,ntdll-Fix_Free/0005-ntdll-Fix-leak-on-STATUS_NO_SUCH_FILE-in-NtQueryAttr.patch)
|
||||
$(call APPLY_FILE,ntdll-Fix_Free/0006-ntdll-Fix-unlikely-leak-on-STATUS_NO_SUCH_FILE-in-in.patch)
|
||||
$(call APPLY_FILE,ntdll-Fix_Free/0007-ntdll-Fix-leak-on-STATUS_NO_SUCH_FILE-in-load_builti.patch)
|
||||
$(call APPLY_FILE,ntdll-Fix_Free/0008-ntdll-Fix-leak-on-STATUS_NO_SUCH_FILE-for-certain-di.patch)
|
||||
$(call APPLY_FILE,ntdll-Fix_Free/0009-kernel32-Fix-leak-on-STATUS_NO_SUCH_FILE-in-RemoveDi.patch)
|
||||
$(call APPLY_FILE,ntdll-Fix_Free/0010-kernel32-Fix-leak-on-STATUS_NO_SUCH_FILE-in-QueryDos.patch)
|
||||
@( \
|
||||
echo '+ { "ntdll-Fix_Free", "Erich E. Hoover", "Fix unintentional leaks with ntdll internals" },'; \
|
||||
) > ntdll-Fix_Free.ok
|
||||
|
||||
# Patchset ntdll-Junction_Points
|
||||
# |
|
||||
# | Included patches:
|
||||
|
@ -1,4 +1,4 @@
|
||||
From b331ed482682444dfeb31358977a2645c5c194f4 Mon Sep 17 00:00:00 2001
|
||||
From c7e981011339b8a665f0164fabdeb8603b247f2f Mon Sep 17 00:00:00 2001
|
||||
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
|
||||
Date: Tue, 19 Aug 2014 20:31:00 -0600
|
||||
Subject: ntdll: Unify retrieving the attributes of a file.
|
||||
@ -10,7 +10,7 @@ Subject: ntdll: Unify retrieving the attributes of a file.
|
||||
3 files changed, 83 insertions(+), 40 deletions(-)
|
||||
|
||||
diff --git a/dlls/ntdll/directory.c b/dlls/ntdll/directory.c
|
||||
index a2796b2..dad2ee2 100644
|
||||
index 4fb89e3..8871700 100644
|
||||
--- a/dlls/ntdll/directory.c
|
||||
+++ b/dlls/ntdll/directory.c
|
||||
@@ -1380,7 +1380,7 @@ static union file_directory_info *append_entry( void *info_ptr, IO_STATUS_BLOCK
|
||||
@ -49,7 +49,7 @@ index a2796b2..dad2ee2 100644
|
||||
switch (class)
|
||||
{
|
||||
diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c
|
||||
index 92d9829..4ec2c34 100644
|
||||
index 218e112..7dde57d 100644
|
||||
--- a/dlls/ntdll/file.c
|
||||
+++ b/dlls/ntdll/file.c
|
||||
@@ -103,6 +103,55 @@ mode_t FILE_umask = 0;
|
||||
@ -108,7 +108,7 @@ index 92d9829..4ec2c34 100644
|
||||
/**************************************************************************
|
||||
* FILE_CreateFile (internal)
|
||||
* Open a file.
|
||||
@@ -1774,8 +1823,9 @@ static inline void get_file_times( const struct stat *st, LARGE_INTEGER *mtime,
|
||||
@@ -1776,8 +1825,9 @@ static inline void get_file_times( const struct stat *st, LARGE_INTEGER *mtime,
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -120,7 +120,7 @@ index 92d9829..4ec2c34 100644
|
||||
{
|
||||
switch (class)
|
||||
{
|
||||
@@ -1785,10 +1835,7 @@ NTSTATUS fill_stat_info( const struct stat *st, void *ptr, FILE_INFORMATION_CLAS
|
||||
@@ -1787,10 +1837,7 @@ NTSTATUS fill_stat_info( const struct stat *st, void *ptr, FILE_INFORMATION_CLAS
|
||||
|
||||
get_file_times( st, &info->LastWriteTime, &info->ChangeTime,
|
||||
&info->LastAccessTime, &info->CreationTime );
|
||||
@ -132,7 +132,7 @@ index 92d9829..4ec2c34 100644
|
||||
}
|
||||
break;
|
||||
case FileStandardInformation:
|
||||
@@ -1824,9 +1871,9 @@ NTSTATUS fill_stat_info( const struct stat *st, void *ptr, FILE_INFORMATION_CLAS
|
||||
@@ -1826,9 +1873,9 @@ NTSTATUS fill_stat_info( const struct stat *st, void *ptr, FILE_INFORMATION_CLAS
|
||||
case FileAllInformation:
|
||||
{
|
||||
FILE_ALL_INFORMATION *info = ptr;
|
||||
@ -145,7 +145,7 @@ index 92d9829..4ec2c34 100644
|
||||
}
|
||||
break;
|
||||
/* all directory structures start with the FileDirectoryInformation layout */
|
||||
@@ -1842,30 +1889,27 @@ NTSTATUS fill_stat_info( const struct stat *st, void *ptr, FILE_INFORMATION_CLAS
|
||||
@@ -1844,30 +1891,27 @@ NTSTATUS fill_stat_info( const struct stat *st, void *ptr, FILE_INFORMATION_CLAS
|
||||
{
|
||||
info->AllocationSize.QuadPart = 0;
|
||||
info->EndOfFile.QuadPart = 0;
|
||||
@ -179,7 +179,7 @@ index 92d9829..4ec2c34 100644
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -2017,6 +2061,7 @@ NTSTATUS WINAPI NtQueryInformationFile( HANDLE hFile, PIO_STATUS_BLOCK io,
|
||||
@@ -2019,6 +2063,7 @@ NTSTATUS WINAPI NtQueryInformationFile( HANDLE hFile, PIO_STATUS_BLOCK io,
|
||||
|
||||
struct stat st;
|
||||
int fd, needs_close = FALSE;
|
||||
@ -187,7 +187,7 @@ index 92d9829..4ec2c34 100644
|
||||
|
||||
TRACE("(%p,%p,%p,0x%08x,0x%08x)\n", hFile, io, ptr, len, class);
|
||||
|
||||
@@ -2041,21 +2086,21 @@ NTSTATUS WINAPI NtQueryInformationFile( HANDLE hFile, PIO_STATUS_BLOCK io,
|
||||
@@ -2043,21 +2088,21 @@ NTSTATUS WINAPI NtQueryInformationFile( HANDLE hFile, PIO_STATUS_BLOCK io,
|
||||
switch (class)
|
||||
{
|
||||
case FileBasicInformation:
|
||||
@ -213,7 +213,7 @@ index 92d9829..4ec2c34 100644
|
||||
info->DeletePending = FALSE; /* FIXME */
|
||||
}
|
||||
}
|
||||
@@ -2069,8 +2114,8 @@ NTSTATUS WINAPI NtQueryInformationFile( HANDLE hFile, PIO_STATUS_BLOCK io,
|
||||
@@ -2071,8 +2116,8 @@ NTSTATUS WINAPI NtQueryInformationFile( HANDLE hFile, PIO_STATUS_BLOCK io,
|
||||
}
|
||||
break;
|
||||
case FileInternalInformation:
|
||||
@ -224,7 +224,7 @@ index 92d9829..4ec2c34 100644
|
||||
break;
|
||||
case FileEaInformation:
|
||||
{
|
||||
@@ -2079,22 +2124,22 @@ NTSTATUS WINAPI NtQueryInformationFile( HANDLE hFile, PIO_STATUS_BLOCK io,
|
||||
@@ -2081,22 +2126,22 @@ NTSTATUS WINAPI NtQueryInformationFile( HANDLE hFile, PIO_STATUS_BLOCK io,
|
||||
}
|
||||
break;
|
||||
case FileEndOfFileInformation:
|
||||
@ -251,7 +251,7 @@ index 92d9829..4ec2c34 100644
|
||||
info->StandardInformation.DeletePending = FALSE; /* FIXME */
|
||||
info->EaInformation.EaSize = 0;
|
||||
info->AccessInformation.AccessFlags = 0; /* FIXME */
|
||||
@@ -2445,9 +2490,10 @@ NTSTATUS WINAPI NtQueryFullAttributesFile( const OBJECT_ATTRIBUTES *attr,
|
||||
@@ -2447,9 +2492,10 @@ NTSTATUS WINAPI NtQueryFullAttributesFile( const OBJECT_ATTRIBUTES *attr,
|
||||
|
||||
if (!(status = nt_to_unix_file_name_attr( attr, &unix_name, FILE_OPEN )))
|
||||
{
|
||||
@ -263,7 +263,7 @@ index 92d9829..4ec2c34 100644
|
||||
status = FILE_GetNtStatus();
|
||||
else if (!S_ISREG(st.st_mode) && !S_ISDIR(st.st_mode))
|
||||
status = STATUS_INVALID_INFO_CLASS;
|
||||
@@ -2456,8 +2502,8 @@ NTSTATUS WINAPI NtQueryFullAttributesFile( const OBJECT_ATTRIBUTES *attr,
|
||||
@@ -2458,8 +2504,8 @@ NTSTATUS WINAPI NtQueryFullAttributesFile( const OBJECT_ATTRIBUTES *attr,
|
||||
FILE_BASIC_INFORMATION basic;
|
||||
FILE_STANDARD_INFORMATION std;
|
||||
|
||||
@ -274,7 +274,7 @@ index 92d9829..4ec2c34 100644
|
||||
|
||||
info->CreationTime = basic.CreationTime;
|
||||
info->LastAccessTime = basic.LastAccessTime;
|
||||
@@ -2487,15 +2533,16 @@ NTSTATUS WINAPI NtQueryAttributesFile( const OBJECT_ATTRIBUTES *attr, FILE_BASIC
|
||||
@@ -2489,15 +2535,16 @@ NTSTATUS WINAPI NtQueryAttributesFile( const OBJECT_ATTRIBUTES *attr, FILE_BASIC
|
||||
|
||||
if (!(status = nt_to_unix_file_name_attr( attr, &unix_name, FILE_OPEN )))
|
||||
{
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 38c961e5a031c4394523843b4e85a6634e34423d Mon Sep 17 00:00:00 2001
|
||||
From dc4a48590aac24744291731e3c2596c762ede86b 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: ntdll: Implement retrieving DOS attributes in
|
||||
@ -44,7 +44,7 @@ index 7de7a87..b77c12f 100644
|
||||
|
||||
AC_SUBST(dlldir,"\${libdir}/wine")
|
||||
diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c
|
||||
index 4ec2c34..7985dcb 100644
|
||||
index 7dde57d..2b2ef15 100644
|
||||
--- a/dlls/ntdll/file.c
|
||||
+++ b/dlls/ntdll/file.c
|
||||
@@ -103,6 +103,29 @@ mode_t FILE_umask = 0;
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 89997cb9e557658b23bb4dd00273f5d2f9082fc9 Mon Sep 17 00:00:00 2001
|
||||
From ddcf9ada831ef6bff1bd57c833dc368784883ece 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
|
||||
@ -11,7 +11,7 @@ Subject: ntdll: Implement retrieving DOS attributes in
|
||||
3 files changed, 23 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c
|
||||
index 7985dcb..25815a5 100644
|
||||
index 2b2ef15..c551457 100644
|
||||
--- a/dlls/ntdll/file.c
|
||||
+++ b/dlls/ntdll/file.c
|
||||
@@ -161,7 +161,8 @@ int fd_get_file_info( int fd, struct stat *st, ULONG *attr )
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 05a50c64745b3af4e439702aade6aefb1d3c6040 Mon Sep 17 00:00:00 2001
|
||||
From f684563e7e7306bcd773d4202f184cd3c3a7c2a8 Mon Sep 17 00:00:00 2001
|
||||
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
|
||||
Date: Wed, 20 Aug 2014 00:08:52 -0600
|
||||
Subject: ntdll: Implement storing DOS attributes in NtSetInformationFile.
|
||||
@ -11,7 +11,7 @@ Subject: ntdll: Implement storing DOS attributes in NtSetInformationFile.
|
||||
4 files changed, 70 insertions(+), 24 deletions(-)
|
||||
|
||||
diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c
|
||||
index 25815a5..70f8ea3 100644
|
||||
index c551457..fd21c66 100644
|
||||
--- a/dlls/ntdll/file.c
|
||||
+++ b/dlls/ntdll/file.c
|
||||
@@ -158,6 +158,38 @@ int fd_get_file_info( int fd, struct stat *st, ULONG *attr )
|
||||
@ -53,7 +53,7 @@ index 25815a5..70f8ea3 100644
|
||||
/* get the stat info and file attributes for a file (by name) */
|
||||
int get_file_info( const char *path, struct stat *st, ULONG *attr )
|
||||
{
|
||||
@@ -2333,7 +2365,6 @@ NTSTATUS WINAPI NtSetInformationFile(HANDLE handle, PIO_STATUS_BLOCK io,
|
||||
@@ -2335,7 +2367,6 @@ NTSTATUS WINAPI NtSetInformationFile(HANDLE handle, PIO_STATUS_BLOCK io,
|
||||
case FileBasicInformation:
|
||||
if (len >= sizeof(FILE_BASIC_INFORMATION))
|
||||
{
|
||||
@ -61,7 +61,7 @@ index 25815a5..70f8ea3 100644
|
||||
const FILE_BASIC_INFORMATION *info = ptr;
|
||||
|
||||
if ((io->u.Status = server_get_unix_fd( handle, 0, &fd, &needs_close, NULL, NULL )))
|
||||
@@ -2343,25 +2374,7 @@ NTSTATUS WINAPI NtSetInformationFile(HANDLE handle, PIO_STATUS_BLOCK io,
|
||||
@@ -2345,25 +2376,7 @@ NTSTATUS WINAPI NtSetInformationFile(HANDLE handle, PIO_STATUS_BLOCK io,
|
||||
io->u.Status = set_file_times( fd, &info->LastWriteTime, &info->LastAccessTime );
|
||||
|
||||
if (io->u.Status == STATUS_SUCCESS && info->FileAttributes)
|
||||
|
@ -1,17 +1,17 @@
|
||||
From 48f69113889b2d83596fe350caf3085fa16f9bf2 Mon Sep 17 00:00:00 2001
|
||||
From 61ebf9e4c09c85daa1085521facffaf394dd8db2 Mon Sep 17 00:00:00 2001
|
||||
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
|
||||
Date: Wed, 20 Aug 2014 15:28:00 -0600
|
||||
Subject: ntdll: Implement storing DOS attributes in NtCreateFile.
|
||||
|
||||
---
|
||||
dlls/ntdll/file.c | 80 ++++++++++++++++++++++++++----------------
|
||||
dlls/ntdll/tests/directory.c | 22 +++++-------
|
||||
dlls/ntdll/file.c | 22 +++++++++++++++++++++-
|
||||
dlls/ntdll/tests/directory.c | 22 ++++++++--------------
|
||||
include/wine/port.h | 2 ++
|
||||
libs/port/xattr.c | 31 ++++++++++++++++
|
||||
4 files changed, 91 insertions(+), 44 deletions(-)
|
||||
libs/port/xattr.c | 31 +++++++++++++++++++++++++++++++
|
||||
4 files changed, 62 insertions(+), 15 deletions(-)
|
||||
|
||||
diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c
|
||||
index 70f8ea3..e8e5b28 100644
|
||||
index fd21c66..f549552 100644
|
||||
--- a/dlls/ntdll/file.c
|
||||
+++ b/dlls/ntdll/file.c
|
||||
@@ -217,6 +217,21 @@ int get_file_info( const char *path, struct stat *st, ULONG *attr )
|
||||
@ -36,84 +36,15 @@ index 70f8ea3..e8e5b28 100644
|
||||
/**************************************************************************
|
||||
* FILE_CreateFile (internal)
|
||||
* Open a file.
|
||||
@@ -228,6 +243,8 @@ static NTSTATUS FILE_CreateFile( PHANDLE handle, ACCESS_MASK access, POBJECT_ATT
|
||||
ULONG attributes, ULONG sharing, ULONG disposition,
|
||||
ULONG options, PVOID ea_buffer, ULONG ea_length )
|
||||
{
|
||||
+ struct object_attributes objattr;
|
||||
+ struct security_descriptor *sd;
|
||||
ANSI_STRING unix_name;
|
||||
BOOL created = FALSE;
|
||||
|
||||
@@ -270,40 +287,37 @@ static NTSTATUS FILE_CreateFile( PHANDLE handle, ACCESS_MASK access, POBJECT_ATT
|
||||
created = TRUE;
|
||||
io->u.Status = STATUS_SUCCESS;
|
||||
@@ -305,7 +320,6 @@ static NTSTATUS FILE_CreateFile( PHANDLE handle, ACCESS_MASK access, POBJECT_ATT
|
||||
}
|
||||
-
|
||||
- if (io->u.Status == STATUS_SUCCESS)
|
||||
+ else if (io->u.Status != STATUS_SUCCESS)
|
||||
{
|
||||
- struct security_descriptor *sd;
|
||||
- struct object_attributes objattr;
|
||||
-
|
||||
- objattr.rootdir = wine_server_obj_handle( attr->RootDirectory );
|
||||
- objattr.name_len = 0;
|
||||
- io->u.Status = NTDLL_create_struct_sd( attr->SecurityDescriptor, &sd, &objattr.sd_len );
|
||||
- if (io->u.Status != STATUS_SUCCESS)
|
||||
- {
|
||||
- RtlFreeAnsiString( &unix_name );
|
||||
- return io->u.Status;
|
||||
- }
|
||||
+ WARN("%s not found (%x)\n", debugstr_us(attr->ObjectName), io->u.Status );
|
||||
+ return io->u.Status;
|
||||
+ }
|
||||
|
||||
- SERVER_START_REQ( create_file )
|
||||
- {
|
||||
- req->access = access;
|
||||
- req->attributes = attr->Attributes;
|
||||
- req->sharing = sharing;
|
||||
- req->create = disposition;
|
||||
- req->options = options;
|
||||
- req->attrs = attributes;
|
||||
- wine_server_add_data( req, &objattr, sizeof(objattr) );
|
||||
- if (objattr.sd_len) wine_server_add_data( req, sd, objattr.sd_len );
|
||||
- wine_server_add_data( req, unix_name.Buffer, unix_name.Length );
|
||||
- io->u.Status = wine_server_call( req );
|
||||
- *handle = wine_server_ptr_handle( reply->handle );
|
||||
- }
|
||||
- SERVER_END_REQ;
|
||||
- NTDLL_free_struct_sd( sd );
|
||||
+ objattr.rootdir = wine_server_obj_handle( attr->RootDirectory );
|
||||
+ objattr.name_len = 0;
|
||||
+ io->u.Status = NTDLL_create_struct_sd( attr->SecurityDescriptor, &sd, &objattr.sd_len );
|
||||
+ if (io->u.Status != STATUS_SUCCESS)
|
||||
+ {
|
||||
RtlFreeAnsiString( &unix_name );
|
||||
+ return io->u.Status;
|
||||
}
|
||||
- else WARN("%s not found (%x)\n", debugstr_us(attr->ObjectName), io->u.Status );
|
||||
+
|
||||
+ SERVER_START_REQ( create_file )
|
||||
+ {
|
||||
+ req->access = access;
|
||||
+ req->attributes = attr->Attributes;
|
||||
+ req->sharing = sharing;
|
||||
+ req->create = disposition;
|
||||
+ req->options = options;
|
||||
+ req->attrs = attributes;
|
||||
+ wine_server_add_data( req, &objattr, sizeof(objattr) );
|
||||
+ if (objattr.sd_len) wine_server_add_data( req, sd, objattr.sd_len );
|
||||
+ wine_server_add_data( req, unix_name.Buffer, unix_name.Length );
|
||||
+ io->u.Status = wine_server_call( req );
|
||||
+ *handle = wine_server_ptr_handle( reply->handle );
|
||||
+ }
|
||||
+ SERVER_END_REQ;
|
||||
+ NTDLL_free_struct_sd( sd );
|
||||
SERVER_END_REQ;
|
||||
NTDLL_free_struct_sd( sd );
|
||||
- RtlFreeAnsiString( &unix_name );
|
||||
|
||||
if (io->u.Status == STATUS_SUCCESS)
|
||||
{
|
||||
@@ -325,6 +339,11 @@ static NTSTATUS FILE_CreateFile( PHANDLE handle, ACCESS_MASK access, POBJECT_ATT
|
||||
@@ -327,6 +341,11 @@ static NTSTATUS FILE_CreateFile( PHANDLE handle, ACCESS_MASK access, POBJECT_ATT
|
||||
io->Information = FILE_OVERWRITTEN;
|
||||
break;
|
||||
}
|
||||
@ -125,7 +56,7 @@ index 70f8ea3..e8e5b28 100644
|
||||
}
|
||||
else if (io->u.Status == STATUS_TOO_MANY_OPENED_FILES)
|
||||
{
|
||||
@@ -332,6 +351,7 @@ static NTSTATUS FILE_CreateFile( PHANDLE handle, ACCESS_MASK access, POBJECT_ATT
|
||||
@@ -334,6 +353,7 @@ static NTSTATUS FILE_CreateFile( PHANDLE handle, ACCESS_MASK access, POBJECT_ATT
|
||||
if (!once++) ERR_(winediag)( "Too many open files, ulimit -n probably needs to be increased\n" );
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
From d1baa99fa107d76bd8714774ea9e5ca1d6c1c996 Mon Sep 17 00:00:00 2001
|
||||
From d459f286062ea2560993829833d32fbf914ecd69 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: ntdll: Perform the Unix-style hidden file check within the unified
|
||||
@ -11,7 +11,7 @@ Subject: ntdll: Perform the Unix-style hidden file check within the unified
|
||||
3 files changed, 9 insertions(+), 15 deletions(-)
|
||||
|
||||
diff --git a/dlls/ntdll/directory.c b/dlls/ntdll/directory.c
|
||||
index dad2ee2..0963207 100644
|
||||
index 8871700..c10375d 100644
|
||||
--- a/dlls/ntdll/directory.c
|
||||
+++ b/dlls/ntdll/directory.c
|
||||
@@ -1198,17 +1198,17 @@ static DWORD WINAPI init_options( RTL_RUN_ONCE *once, void *param, void **contex
|
||||
@ -48,7 +48,7 @@ index dad2ee2..0963207 100644
|
||||
if (io->Information + total_len > max_length)
|
||||
{
|
||||
diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c
|
||||
index e8e5b28..7b72876 100644
|
||||
index f549552..36ebdf4 100644
|
||||
--- a/dlls/ntdll/file.c
|
||||
+++ b/dlls/ntdll/file.c
|
||||
@@ -210,6 +210,9 @@ int get_file_info( const char *path, struct stat *st, ULONG *attr )
|
||||
@ -61,16 +61,16 @@ index e8e5b28..7b72876 100644
|
||||
/* retrieve any stored DOS attributes */
|
||||
len = xattr_get( path, SAMBA_XATTR_DOS_ATTRIB, hexattr, sizeof(hexattr)-1 );
|
||||
if (len == -1) return ret;
|
||||
@@ -2578,8 +2581,6 @@ NTSTATUS WINAPI NtQueryFullAttributesFile( const OBJECT_ATTRIBUTES *attr,
|
||||
@@ -2580,8 +2583,6 @@ NTSTATUS WINAPI NtQueryFullAttributesFile( const OBJECT_ATTRIBUTES *attr,
|
||||
info->AllocationSize = std.AllocationSize;
|
||||
info->EndOfFile = std.EndOfFile;
|
||||
info->FileAttributes = basic.FileAttributes;
|
||||
- if (DIR_is_hidden_file( attr->ObjectName ))
|
||||
- info->FileAttributes |= FILE_ATTRIBUTE_HIDDEN;
|
||||
}
|
||||
RtlFreeAnsiString( &unix_name );
|
||||
}
|
||||
@@ -2607,11 +2608,7 @@ NTSTATUS WINAPI NtQueryAttributesFile( const OBJECT_ATTRIBUTES *attr, FILE_BASIC
|
||||
else WARN("%s not found (%x)\n", debugstr_us(attr->ObjectName), status );
|
||||
@@ -2609,11 +2610,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
|
||||
@ -79,9 +79,9 @@ index e8e5b28..7b72876 100644
|
||||
- if (DIR_is_hidden_file( attr->ObjectName ))
|
||||
- info->FileAttributes |= FILE_ATTRIBUTE_HIDDEN;
|
||||
- }
|
||||
RtlFreeAnsiString( &unix_name );
|
||||
}
|
||||
else WARN("%s not found (%x)\n", debugstr_us(attr->ObjectName), status );
|
||||
RtlFreeAnsiString( &unix_name );
|
||||
diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h
|
||||
index ae59552..bacadb0 100644
|
||||
--- a/dlls/ntdll/ntdll_misc.h
|
||||
|
@ -1,4 +1,5 @@
|
||||
Author: Erich E. Hoover
|
||||
Subject: Implement DOS hidden/system file attributes
|
||||
Revision: 1
|
||||
Depends: ntdll-Fix_Free
|
||||
Fixes: [9158] Support for DOS hidden/system file attributes
|
||||
|
@ -0,0 +1,24 @@
|
||||
From 1725bf5deb419b54306c70b1d3b23259236b2090 Mon Sep 17 00:00:00 2001
|
||||
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
|
||||
Date: Thu, 21 Aug 2014 22:31:53 -0600
|
||||
Subject: ntdll: Make nt_to_unix_file_name_attr return always safe to free.
|
||||
|
||||
---
|
||||
dlls/ntdll/directory.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/dlls/ntdll/directory.c b/dlls/ntdll/directory.c
|
||||
index a2796b2..aac7522 100644
|
||||
--- a/dlls/ntdll/directory.c
|
||||
+++ b/dlls/ntdll/directory.c
|
||||
@@ -2941,6 +2941,7 @@ NTSTATUS nt_to_unix_file_name_attr( const OBJECT_ATTRIBUTES *attr, ANSI_STRING *
|
||||
NTSTATUS status;
|
||||
BOOLEAN check_case = !(attr->Attributes & OBJ_CASE_INSENSITIVE);
|
||||
|
||||
+ unix_name_ret->Buffer = NULL;
|
||||
if (!attr->RootDirectory) /* without root dir fall back to normal lookup */
|
||||
return wine_nt_to_unix_file_name( attr->ObjectName, unix_name_ret, disposition, check_case );
|
||||
|
||||
--
|
||||
1.7.9.5
|
||||
|
@ -0,0 +1,24 @@
|
||||
From 8298ecb1d1eead39e9333670e79a7136ca60db50 Mon Sep 17 00:00:00 2001
|
||||
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
|
||||
Date: Thu, 21 Aug 2014 22:35:55 -0600
|
||||
Subject: ntdll: Make wine_nt_to_unix_file_name return always safe to free.
|
||||
|
||||
---
|
||||
dlls/ntdll/directory.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/dlls/ntdll/directory.c b/dlls/ntdll/directory.c
|
||||
index aac7522..01f35ab 100644
|
||||
--- a/dlls/ntdll/directory.c
|
||||
+++ b/dlls/ntdll/directory.c
|
||||
@@ -3026,6 +3026,7 @@ NTSTATUS CDECL wine_nt_to_unix_file_name( const UNICODE_STRING *nameW, ANSI_STRI
|
||||
|
||||
name = nameW->Buffer;
|
||||
name_len = nameW->Length / sizeof(WCHAR);
|
||||
+ unix_name_ret->Buffer = NULL;
|
||||
|
||||
if (!name_len || !IS_SEPARATOR(name[0])) return STATUS_OBJECT_PATH_SYNTAX_BAD;
|
||||
|
||||
--
|
||||
1.7.9.5
|
||||
|
@ -0,0 +1,33 @@
|
||||
From 2bde34705bcb0cf25affb6744df736611736a869 Mon Sep 17 00:00:00 2001
|
||||
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
|
||||
Date: Thu, 21 Aug 2014 22:28:10 -0600
|
||||
Subject: ntdll: Make file_id_to_unix_file_name return always safe to free.
|
||||
|
||||
---
|
||||
dlls/ntdll/directory.c | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/ntdll/directory.c b/dlls/ntdll/directory.c
|
||||
index 01f35ab..9e5dbae 100644
|
||||
--- a/dlls/ntdll/directory.c
|
||||
+++ b/dlls/ntdll/directory.c
|
||||
@@ -2744,6 +2744,7 @@ NTSTATUS file_id_to_unix_file_name( const OBJECT_ATTRIBUTES *attr, ANSI_STRING *
|
||||
ULONGLONG file_id;
|
||||
struct stat st, root_st;
|
||||
|
||||
+ unix_name->Buffer = NULL;
|
||||
if (attr->ObjectName->Length != sizeof(ULONGLONG)) return STATUS_OBJECT_PATH_SYNTAX_BAD;
|
||||
if (!attr->RootDirectory) return STATUS_INVALID_PARAMETER;
|
||||
memcpy( &file_id, attr->ObjectName->Buffer, sizeof(file_id) );
|
||||
@@ -2802,7 +2803,7 @@ done:
|
||||
else
|
||||
{
|
||||
TRACE( "%s not found in dir %p\n", wine_dbgstr_longlong(file_id), attr->RootDirectory );
|
||||
- RtlFreeHeap( GetProcessHeap(), 0, unix_name->Buffer );
|
||||
+ RtlFreeAnsiString( unix_name );
|
||||
}
|
||||
if (needs_close) close( root_fd );
|
||||
return status;
|
||||
--
|
||||
1.7.9.5
|
||||
|
@ -0,0 +1,27 @@
|
||||
From 01ee64a9b96003315c521704c4e8e27b0f832b82 Mon Sep 17 00:00:00 2001
|
||||
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
|
||||
Date: Thu, 21 Aug 2014 22:40:09 -0600
|
||||
Subject: ntdll: Fix leak on STATUS_NO_SUCH_FILE in NtQueryFullAttributesFile.
|
||||
|
||||
---
|
||||
dlls/ntdll/file.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c
|
||||
index 92d9829..58edc6c 100644
|
||||
--- a/dlls/ntdll/file.c
|
||||
+++ b/dlls/ntdll/file.c
|
||||
@@ -2469,9 +2469,9 @@ NTSTATUS WINAPI NtQueryFullAttributesFile( const OBJECT_ATTRIBUTES *attr,
|
||||
if (DIR_is_hidden_file( attr->ObjectName ))
|
||||
info->FileAttributes |= FILE_ATTRIBUTE_HIDDEN;
|
||||
}
|
||||
- RtlFreeAnsiString( &unix_name );
|
||||
}
|
||||
else WARN("%s not found (%x)\n", debugstr_us(attr->ObjectName), status );
|
||||
+ RtlFreeAnsiString( &unix_name );
|
||||
return status;
|
||||
}
|
||||
|
||||
--
|
||||
1.7.9.5
|
||||
|
@ -0,0 +1,27 @@
|
||||
From 7ea279c6afb68865bfb6f09233e3d0fb2915fbfd Mon Sep 17 00:00:00 2001
|
||||
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
|
||||
Date: Thu, 21 Aug 2014 22:40:44 -0600
|
||||
Subject: ntdll: Fix leak on STATUS_NO_SUCH_FILE in NtQueryAttributesFile.
|
||||
|
||||
---
|
||||
dlls/ntdll/file.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c
|
||||
index 58edc6c..03f7de8 100644
|
||||
--- a/dlls/ntdll/file.c
|
||||
+++ b/dlls/ntdll/file.c
|
||||
@@ -2499,9 +2499,9 @@ NTSTATUS WINAPI NtQueryAttributesFile( const OBJECT_ATTRIBUTES *attr, FILE_BASIC
|
||||
if (DIR_is_hidden_file( attr->ObjectName ))
|
||||
info->FileAttributes |= FILE_ATTRIBUTE_HIDDEN;
|
||||
}
|
||||
- RtlFreeAnsiString( &unix_name );
|
||||
}
|
||||
else WARN("%s not found (%x)\n", debugstr_us(attr->ObjectName), status );
|
||||
+ RtlFreeAnsiString( &unix_name );
|
||||
return status;
|
||||
}
|
||||
|
||||
--
|
||||
1.7.9.5
|
||||
|
@ -0,0 +1,24 @@
|
||||
From fa2f0ec87a3a0b7e4d176b8a334477bbb404bc07 Mon Sep 17 00:00:00 2001
|
||||
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
|
||||
Date: Thu, 21 Aug 2014 22:45:34 -0600
|
||||
Subject: ntdll: Fix unlikely leak on STATUS_NO_SUCH_FILE in init_redirects.
|
||||
|
||||
---
|
||||
dlls/ntdll/directory.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/dlls/ntdll/directory.c b/dlls/ntdll/directory.c
|
||||
index 9e5dbae..4fb89e3 100644
|
||||
--- a/dlls/ntdll/directory.c
|
||||
+++ b/dlls/ntdll/directory.c
|
||||
@@ -2466,6 +2466,7 @@ static void init_redirects(void)
|
||||
if (status)
|
||||
{
|
||||
ERR( "cannot open %s (%x)\n", debugstr_w(user_shared_data->NtSystemRoot), status );
|
||||
+ RtlFreeAnsiString( &unix_name );
|
||||
return;
|
||||
}
|
||||
if (!stat( unix_name.Buffer, &st ))
|
||||
--
|
||||
1.7.9.5
|
||||
|
@ -0,0 +1,33 @@
|
||||
From 7d32863a7f2a412b5f42d4a60ba683d92911a251 Mon Sep 17 00:00:00 2001
|
||||
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
|
||||
Date: Thu, 21 Aug 2014 22:57:06 -0600
|
||||
Subject: ntdll: Fix leak on STATUS_NO_SUCH_FILE in load_builtin_dll.
|
||||
|
||||
---
|
||||
dlls/ntdll/loader.c | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c
|
||||
index 79aa341..c9c2848 100644
|
||||
--- a/dlls/ntdll/loader.c
|
||||
+++ b/dlls/ntdll/loader.c
|
||||
@@ -1712,6 +1712,7 @@ static NTSTATUS load_builtin_dll( LPCWSTR load_path, LPCWSTR path, HANDLE file,
|
||||
if (wine_nt_to_unix_file_name( &nt_name, &unix_name, FILE_OPEN, FALSE ))
|
||||
{
|
||||
RtlFreeUnicodeString( &nt_name );
|
||||
+ RtlFreeAnsiString( &unix_name );
|
||||
return STATUS_DLL_NOT_FOUND;
|
||||
}
|
||||
prev_info = builtin_load_info;
|
||||
@@ -1720,7 +1721,7 @@ static NTSTATUS load_builtin_dll( LPCWSTR load_path, LPCWSTR path, HANDLE file,
|
||||
handle = wine_dlopen( unix_name.Buffer, RTLD_NOW, error, sizeof(error) );
|
||||
builtin_load_info = prev_info;
|
||||
RtlFreeUnicodeString( &nt_name );
|
||||
- RtlFreeHeap( GetProcessHeap(), 0, unix_name.Buffer );
|
||||
+ RtlFreeAnsiString( &unix_name );
|
||||
if (!handle)
|
||||
{
|
||||
WARN( "failed to load .so lib for builtin %s: %s\n", debugstr_w(path), error );
|
||||
--
|
||||
1.7.9.5
|
||||
|
@ -0,0 +1,95 @@
|
||||
From a7f6ef878680392871f8d2e00e06877fdb4182a5 Mon Sep 17 00:00:00 2001
|
||||
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
|
||||
Date: Thu, 21 Aug 2014 23:09:02 -0600
|
||||
Subject: ntdll: Fix leak on STATUS_NO_SUCH_FILE (for certain dispositions) in
|
||||
NtCreateFile.
|
||||
|
||||
---
|
||||
dlls/ntdll/file.c | 60 +++++++++++++++++++++++++++--------------------------
|
||||
1 file changed, 31 insertions(+), 29 deletions(-)
|
||||
|
||||
diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c
|
||||
index 03f7de8..218e112 100644
|
||||
--- a/dlls/ntdll/file.c
|
||||
+++ b/dlls/ntdll/file.c
|
||||
@@ -114,6 +114,8 @@ static NTSTATUS FILE_CreateFile( PHANDLE handle, ACCESS_MASK access, POBJECT_ATT
|
||||
ULONG attributes, ULONG sharing, ULONG disposition,
|
||||
ULONG options, PVOID ea_buffer, ULONG ea_length )
|
||||
{
|
||||
+ struct object_attributes objattr;
|
||||
+ struct security_descriptor *sd;
|
||||
ANSI_STRING unix_name;
|
||||
BOOL created = FALSE;
|
||||
|
||||
@@ -157,39 +159,39 @@ static NTSTATUS FILE_CreateFile( PHANDLE handle, ACCESS_MASK access, POBJECT_ATT
|
||||
io->u.Status = STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
- if (io->u.Status == STATUS_SUCCESS)
|
||||
+ if (io->u.Status != STATUS_SUCCESS)
|
||||
{
|
||||
- struct security_descriptor *sd;
|
||||
- struct object_attributes objattr;
|
||||
-
|
||||
- objattr.rootdir = wine_server_obj_handle( attr->RootDirectory );
|
||||
- objattr.name_len = 0;
|
||||
- io->u.Status = NTDLL_create_struct_sd( attr->SecurityDescriptor, &sd, &objattr.sd_len );
|
||||
- if (io->u.Status != STATUS_SUCCESS)
|
||||
- {
|
||||
- RtlFreeAnsiString( &unix_name );
|
||||
- return io->u.Status;
|
||||
- }
|
||||
+ WARN("%s not found (%x)\n", debugstr_us(attr->ObjectName), io->u.Status );
|
||||
+ RtlFreeAnsiString( &unix_name );
|
||||
+ return io->u.Status;
|
||||
+ }
|
||||
|
||||
- SERVER_START_REQ( create_file )
|
||||
- {
|
||||
- req->access = access;
|
||||
- req->attributes = attr->Attributes;
|
||||
- req->sharing = sharing;
|
||||
- req->create = disposition;
|
||||
- req->options = options;
|
||||
- req->attrs = attributes;
|
||||
- wine_server_add_data( req, &objattr, sizeof(objattr) );
|
||||
- if (objattr.sd_len) wine_server_add_data( req, sd, objattr.sd_len );
|
||||
- wine_server_add_data( req, unix_name.Buffer, unix_name.Length );
|
||||
- io->u.Status = wine_server_call( req );
|
||||
- *handle = wine_server_ptr_handle( reply->handle );
|
||||
- }
|
||||
- SERVER_END_REQ;
|
||||
- NTDLL_free_struct_sd( sd );
|
||||
+ objattr.rootdir = wine_server_obj_handle( attr->RootDirectory );
|
||||
+ objattr.name_len = 0;
|
||||
+ io->u.Status = NTDLL_create_struct_sd( attr->SecurityDescriptor, &sd, &objattr.sd_len );
|
||||
+ if (io->u.Status != STATUS_SUCCESS)
|
||||
+ {
|
||||
RtlFreeAnsiString( &unix_name );
|
||||
+ return io->u.Status;
|
||||
}
|
||||
- else WARN("%s not found (%x)\n", debugstr_us(attr->ObjectName), io->u.Status );
|
||||
+
|
||||
+ SERVER_START_REQ( create_file )
|
||||
+ {
|
||||
+ req->access = access;
|
||||
+ req->attributes = attr->Attributes;
|
||||
+ req->sharing = sharing;
|
||||
+ req->create = disposition;
|
||||
+ req->options = options;
|
||||
+ req->attrs = attributes;
|
||||
+ wine_server_add_data( req, &objattr, sizeof(objattr) );
|
||||
+ if (objattr.sd_len) wine_server_add_data( req, sd, objattr.sd_len );
|
||||
+ wine_server_add_data( req, unix_name.Buffer, unix_name.Length );
|
||||
+ io->u.Status = wine_server_call( req );
|
||||
+ *handle = wine_server_ptr_handle( reply->handle );
|
||||
+ }
|
||||
+ SERVER_END_REQ;
|
||||
+ NTDLL_free_struct_sd( sd );
|
||||
+ RtlFreeAnsiString( &unix_name );
|
||||
|
||||
if (io->u.Status == STATUS_SUCCESS)
|
||||
{
|
||||
--
|
||||
1.7.9.5
|
||||
|
@ -0,0 +1,24 @@
|
||||
From d52a094e2e5831a52fac98016fc71879edc8193e Mon Sep 17 00:00:00 2001
|
||||
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
|
||||
Date: Thu, 21 Aug 2014 22:50:19 -0600
|
||||
Subject: kernel32: Fix leak on STATUS_NO_SUCH_FILE in RemoveDirectoryW.
|
||||
|
||||
---
|
||||
dlls/kernel32/path.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/dlls/kernel32/path.c b/dlls/kernel32/path.c
|
||||
index 09fb04b..eeba48a 100644
|
||||
--- a/dlls/kernel32/path.c
|
||||
+++ b/dlls/kernel32/path.c
|
||||
@@ -1619,6 +1619,7 @@ BOOL WINAPI RemoveDirectoryW( LPCWSTR path )
|
||||
if (status != STATUS_SUCCESS)
|
||||
{
|
||||
SetLastError( RtlNtStatusToDosError(status) );
|
||||
+ RtlFreeAnsiString( &unix_name );
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
--
|
||||
1.7.9.5
|
||||
|
@ -0,0 +1,44 @@
|
||||
From 921d9d1c4f4a140ae8d0057079b62a0b8adb6205 Mon Sep 17 00:00:00 2001
|
||||
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
|
||||
Date: Thu, 21 Aug 2014 22:54:09 -0600
|
||||
Subject: kernel32: Fix leak on STATUS_NO_SUCH_FILE in QueryDosDeviceW.
|
||||
|
||||
---
|
||||
dlls/kernel32/volume.c | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/dlls/kernel32/volume.c b/dlls/kernel32/volume.c
|
||||
index d396764..d580f1d 100644
|
||||
--- a/dlls/kernel32/volume.c
|
||||
+++ b/dlls/kernel32/volume.c
|
||||
@@ -1354,10 +1354,8 @@ DWORD WINAPI QueryDosDeviceW( LPCWSTR devname, LPWSTR target, DWORD bufsize )
|
||||
status = wine_nt_to_unix_file_name( &nt_name, &unix_name, FILE_OPEN, TRUE );
|
||||
if (status) SetLastError( RtlNtStatusToDosError(status) );
|
||||
else
|
||||
- {
|
||||
ret = MultiByteToWideChar( CP_UNIXCP, 0, unix_name.Buffer, -1, target, bufsize );
|
||||
- RtlFreeAnsiString( &unix_name );
|
||||
- }
|
||||
+ RtlFreeAnsiString( &unix_name );
|
||||
}
|
||||
done:
|
||||
if (ret)
|
||||
@@ -1409,6 +1407,7 @@ DWORD WINAPI QueryDosDeviceW( LPCWSTR devname, LPWSTR target, DWORD bufsize )
|
||||
p[4] = 0;
|
||||
p += 5;
|
||||
}
|
||||
+ RtlFreeAnsiString( &unix_name );
|
||||
}
|
||||
strcpyW( nt_buffer + 4, lptW );
|
||||
for (i = 1; i <= 9; i++)
|
||||
@@ -1427,6 +1426,7 @@ DWORD WINAPI QueryDosDeviceW( LPCWSTR devname, LPWSTR target, DWORD bufsize )
|
||||
p[4] = 0;
|
||||
p += 5;
|
||||
}
|
||||
+ RtlFreeAnsiString( &unix_name );
|
||||
}
|
||||
|
||||
RtlInitUnicodeString( &nt_name, dosdevW );
|
||||
--
|
||||
1.7.9.5
|
||||
|
4
patches/ntdll-Fix_Free/definition
Normal file
4
patches/ntdll-Fix_Free/definition
Normal file
@ -0,0 +1,4 @@
|
||||
Author: Erich E. Hoover
|
||||
Subject: Fix unintentional leaks with ntdll internals
|
||||
Revision: 1
|
||||
Fixes: Unintentional leaks with ntdll internals
|
@ -1,4 +1,4 @@
|
||||
From 17d91743f19deb08a6fa0f36212cd8799c6c7270 Mon Sep 17 00:00:00 2001
|
||||
From d5239a5816cd53dd852dd24f40762e4cf30a46ce Mon Sep 17 00:00:00 2001
|
||||
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
|
||||
Date: Thu, 16 Jan 2014 20:56:49 -0700
|
||||
Subject: ntdll: Add support for junction point creation.
|
||||
@ -11,7 +11,7 @@ Subject: ntdll: Add support for junction point creation.
|
||||
create mode 100644 include/ntifs.h
|
||||
|
||||
diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c
|
||||
index 7b72876..14288b5 100644
|
||||
index 36ebdf4..1a7e671 100644
|
||||
--- a/dlls/ntdll/file.c
|
||||
+++ b/dlls/ntdll/file.c
|
||||
@@ -89,12 +89,14 @@
|
||||
@ -29,7 +29,7 @@ index 7b72876..14288b5 100644
|
||||
#define SECSPERDAY 86400
|
||||
#define SECS_1601_TO_1970 ((369 * 365 + 89) * (ULONGLONG)SECSPERDAY)
|
||||
|
||||
@@ -1607,6 +1609,76 @@ NTSTATUS WINAPI NtDeviceIoControlFile(HANDLE handle, HANDLE event,
|
||||
@@ -1609,6 +1611,76 @@ NTSTATUS WINAPI NtDeviceIoControlFile(HANDLE handle, HANDLE event,
|
||||
}
|
||||
|
||||
|
||||
@ -106,7 +106,7 @@ index 7b72876..14288b5 100644
|
||||
/**************************************************************************
|
||||
* NtFsControlFile [NTDLL.@]
|
||||
* ZwFsControlFile [NTDLL.@]
|
||||
@@ -1754,6 +1826,23 @@ NTSTATUS WINAPI NtFsControlFile(HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc
|
||||
@@ -1756,6 +1828,23 @@ NTSTATUS WINAPI NtFsControlFile(HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
From cb47f74a659bd5447ecbf65591962af6a753dda9 Mon Sep 17 00:00:00 2001
|
||||
From 46b4a6ba4c4e4a49b4cbe0aae42cb7717bea7ac0 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.
|
||||
@ -9,10 +9,10 @@ Subject: ntdll: Add support for reading junction points.
|
||||
2 files changed, 76 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c
|
||||
index 14288b5..b1b8f51 100644
|
||||
index 1a7e671..889d35c 100644
|
||||
--- a/dlls/ntdll/file.c
|
||||
+++ b/dlls/ntdll/file.c
|
||||
@@ -1679,6 +1679,60 @@ cleanup:
|
||||
@@ -1681,6 +1681,60 @@ cleanup:
|
||||
}
|
||||
|
||||
|
||||
@ -73,7 +73,7 @@ index 14288b5..b1b8f51 100644
|
||||
/**************************************************************************
|
||||
* NtFsControlFile [NTDLL.@]
|
||||
* ZwFsControlFile [NTDLL.@]
|
||||
@@ -1827,6 +1881,15 @@ NTSTATUS WINAPI NtFsControlFile(HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc
|
||||
@@ -1829,6 +1883,15 @@ NTSTATUS WINAPI NtFsControlFile(HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
From c0100e76f61a689e86c660a056ab30f19749a7b1 Mon Sep 17 00:00:00 2001
|
||||
From 1cc34fb8a2400c62920de15d0cf53d6e2822c631 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.
|
||||
@ -10,10 +10,10 @@ Subject: ntdll: Add support for deleting junction points.
|
||||
3 files changed, 85 insertions(+)
|
||||
|
||||
diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c
|
||||
index b1b8f51..4b76d04 100644
|
||||
index 889d35c..ca98509 100644
|
||||
--- a/dlls/ntdll/file.c
|
||||
+++ b/dlls/ntdll/file.c
|
||||
@@ -1733,6 +1733,41 @@ cleanup:
|
||||
@@ -1735,6 +1735,41 @@ cleanup:
|
||||
}
|
||||
|
||||
|
||||
@ -55,7 +55,7 @@ index b1b8f51..4b76d04 100644
|
||||
/**************************************************************************
|
||||
* NtFsControlFile [NTDLL.@]
|
||||
* ZwFsControlFile [NTDLL.@]
|
||||
@@ -1881,6 +1916,22 @@ NTSTATUS WINAPI NtFsControlFile(HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc
|
||||
@@ -1883,6 +1918,22 @@ NTSTATUS WINAPI NtFsControlFile(HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 302be7aee826e9876d79be36a596692bac5331d1 Mon Sep 17 00:00:00 2001
|
||||
From 422457e7b8d910de8ac20226355ce63a9f07b52b 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 0d309d17751b6bf821b449ba890b5c3465c495a8 Mon Sep 17 00:00:00 2001
|
||||
From 5ce6d272e3c528db75f5301c8827e38d3c8d3813 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
|
||||
@ -10,7 +10,7 @@ Subject: kernel32,ntdll: Add support for deleting junction points with
|
||||
2 files changed, 43 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/dlls/kernel32/path.c b/dlls/kernel32/path.c
|
||||
index 09fb04b..c328cc0 100644
|
||||
index eeba48a..b0b5ae9 100644
|
||||
--- a/dlls/kernel32/path.c
|
||||
+++ b/dlls/kernel32/path.c
|
||||
@@ -1587,6 +1587,7 @@ BOOL WINAPI CreateDirectoryExW( LPCWSTR template, LPCWSTR path, LPSECURITY_ATTRI
|
||||
@ -21,7 +21,7 @@ index 09fb04b..c328cc0 100644
|
||||
OBJECT_ATTRIBUTES attr;
|
||||
UNICODE_STRING nt_name;
|
||||
ANSI_STRING unix_name;
|
||||
@@ -1614,15 +1615,22 @@ BOOL WINAPI RemoveDirectoryW( LPCWSTR path )
|
||||
@@ -1614,16 +1615,23 @@ BOOL WINAPI RemoveDirectoryW( LPCWSTR path )
|
||||
FILE_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT );
|
||||
if (status == STATUS_SUCCESS)
|
||||
status = wine_nt_to_unix_file_name( &nt_name, &unix_name, FILE_OPEN, FALSE );
|
||||
@ -31,6 +31,7 @@ index 09fb04b..c328cc0 100644
|
||||
{
|
||||
+ RtlFreeUnicodeString( &nt_name );
|
||||
SetLastError( RtlNtStatusToDosError(status) );
|
||||
RtlFreeAnsiString( &unix_name );
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
From a7ca946b7bf408aeb905cb2f5dda782634566d83 Mon Sep 17 00:00:00 2001
|
||||
From dfcf45eaaba89e2ef6e662db935570d3a4b93c30 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.
|
||||
@ -9,7 +9,7 @@ Subject: kernel32: Advertise junction point support.
|
||||
2 files changed, 5 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/dlls/kernel32/volume.c b/dlls/kernel32/volume.c
|
||||
index d396764..0fb0aef 100644
|
||||
index d580f1d..d7ee8b7 100644
|
||||
--- a/dlls/kernel32/volume.c
|
||||
+++ b/dlls/kernel32/volume.c
|
||||
@@ -854,7 +854,8 @@ fill_fs_info: /* now fill in the information that depends on the file system ty
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 07e1f990c05bc2b82d2c579ce6a57ee2e24852b5 Mon Sep 17 00:00:00 2001
|
||||
From 977778bf25a3f17303c0d00e3d1cdabbacf3ffa4 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/tests: Add test for deleting junction point target.
|
||||
|
Loading…
Reference in New Issue
Block a user