From 2ad04cae39b1e298ae722c99851b245902fc5b6f Mon Sep 17 00:00:00 2001 From: Andrey Turkin Date: Sun, 25 Jun 2006 16:05:20 +0400 Subject: [PATCH] msi: Disable some path validity checks in MsiSetTargetPath. --- dlls/msi/install.c | 14 ++------------ dlls/msi/tests/package.c | 6 ------ 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/dlls/msi/install.c b/dlls/msi/install.c index 01ce696c0b2..5eaf10b06dd 100644 --- a/dlls/msi/install.c +++ b/dlls/msi/install.c @@ -336,24 +336,14 @@ UINT MSI_SetTargetPathW(MSIPACKAGE *package, LPCWSTR szFolder, attrib = GetFileAttributesW(szFolderPath); if ( attrib != INVALID_FILE_ATTRIBUTES && - (!(attrib & FILE_ATTRIBUTE_DIRECTORY) || - attrib & FILE_ATTRIBUTE_OFFLINE || - attrib & FILE_ATTRIBUTE_READONLY)) + (attrib & FILE_ATTRIBUTE_OFFLINE || + attrib & FILE_ATTRIBUTE_READONLY)) /* actually native MSI tests writeability by making temporary files at each drive */ return ERROR_FUNCTION_FAILED; path = resolve_folder(package,szFolder,FALSE,FALSE,&folder); if (!path) return ERROR_DIRECTORY; - if (attrib == INVALID_FILE_ATTRIBUTES) - { - if (!CreateDirectoryW(szFolderPath,NULL)) - { - msi_free( path ); - return ERROR_FUNCTION_FAILED; - } - RemoveDirectoryW(szFolderPath); - } msi_free(folder->Property); folder->Property = build_directory_name(2, szFolderPath, NULL); diff --git a/dlls/msi/tests/package.c b/dlls/msi/tests/package.c index fae0405194d..f020408f5a9 100644 --- a/dlls/msi/tests/package.c +++ b/dlls/msi/tests/package.c @@ -404,14 +404,10 @@ static void test_settargetpath(void) { sprintf( tempdir, "%s\\subdir", buffer ); r = MsiSetTargetPath( hpkg, "TARGETDIR", buffer ); - todo_wine { ok( r == ERROR_SUCCESS, "MsiSetTargetPath on file returned %d\n", r ); - } r = MsiSetTargetPath( hpkg, "TARGETDIR", tempdir ); - todo_wine { ok( r == ERROR_SUCCESS, "MsiSetTargetPath on 'subdir' of file returned %d\n", r ); - } DeleteFile( buffer ); @@ -422,9 +418,7 @@ static void test_settargetpath(void) ok ( r == INVALID_FILE_ATTRIBUTES, "file/directory exists after MsiSetTargetPath. Attributes: %08X\n", r ); r = MsiSetTargetPath( hpkg, "TARGETDIR", tempdir ); - todo_wine { ok( r == ERROR_SUCCESS, "MsiSetTargetPath on subsubdir returned %d\n", r ); - } } else { trace("GetTempFileName failed, cannot do some tests\n"); } -- 2.11.4.GIT