Added patch to create stub files for system32/drivers/etc/{services,hosts,networks,protocol}.

This commit is contained in:
Sebastian Lackner
2015-05-13 07:11:50 +02:00
parent 2a8300034c
commit fb7bff38de
5 changed files with 94 additions and 1 deletions

View File

@@ -249,6 +249,7 @@ patch_enable_all ()
enable_wine_inf_ProfileList_UserSID="$1"
enable_wineboot_HKEY_DYN_DATA="$1"
enable_wineboot_MachineGuid="$1"
enable_wineboot_drivers_etc_Stubs="$1"
enable_winebuild_LinkerVersion="$1"
enable_winecfg_Libraries="$1"
enable_winecfg_Staging="$1"
@@ -810,6 +811,9 @@ patch_enable ()
wineboot-MachineGuid)
enable_wineboot_MachineGuid="$2"
;;
wineboot-drivers_etc_Stubs)
enable_wineboot_drivers_etc_Stubs="$2"
;;
winebuild-LinkerVersion)
enable_winebuild_LinkerVersion="$2"
;;
@@ -5156,6 +5160,21 @@ if test "$enable_wineboot_MachineGuid" -eq 1; then
) >> "$patchlist"
fi
# Patchset wineboot-drivers_etc_Stubs
# |
# | This patchset fixes the following Wine bugs:
# | * [#12076] Create stub files for system32/drivers/etc/{services,hosts,networks,protocol}
# |
# | Modified files:
# | * programs/wineboot/wineboot.c
# |
if test "$enable_wineboot_drivers_etc_Stubs" -eq 1; then
patch_apply wineboot-drivers_etc_Stubs/0001-wineboot-Init-system32-drivers-etc-host-networks-pro.patch
(
echo '+ { "Sebastian Lackner", "wineboot: Init system32/drivers/etc/{host,networks,protocol,services}.", 1 },';
) >> "$patchlist"
fi
# Patchset winebuild-LinkerVersion
# |
# | This patchset fixes the following Wine bugs:

View File

@@ -0,0 +1,70 @@
From 6127b7897fb868a9a80cd53d2123402570662d68 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Wed, 13 May 2015 06:58:16 +0200
Subject: wineboot: Init
system32/drivers/etc/{host,networks,protocol,services}.
Based on a patch by Jactry Zeng.
---
programs/wineboot/wineboot.c | 38 ++++++++++++++++++++++++++++++++++++++
1 file changed, 38 insertions(+)
diff --git a/programs/wineboot/wineboot.c b/programs/wineboot/wineboot.c
index a20b4e1..b2cc0a9 100644
--- a/programs/wineboot/wineboot.c
+++ b/programs/wineboot/wineboot.c
@@ -417,6 +417,41 @@ static void create_volatile_environment_registry_key(void)
RegCloseKey( hkey );
}
+static void create_etc_stub_files(void)
+{
+ static const WCHAR drivers_etcW[] = {'\\','d','r','i','v','e','r','s','\\','e','t','c',0};
+ static const WCHAR hostsW[] = {'h','o','s','t','s',0};
+ static const WCHAR networksW[] = {'n','e','t','w','o','r','k','s',0};
+ static const WCHAR protocolW[] = {'p','r','o','t','o','c','o','l',0};
+ static const WCHAR servicesW[] = {'s','e','r','v','i','c','e','s',0};
+ static const WCHAR *files[] = { hostsW, networksW, protocolW, servicesW };
+ WCHAR path[MAX_PATH + sizeof(drivers_etcW)/sizeof(WCHAR) + 32];
+ DWORD i, path_len;
+ HANDLE file;
+
+ GetSystemDirectoryW( path, MAX_PATH );
+ strcatW( path, drivers_etcW );
+ path_len = strlenW( path );
+
+ if (!CreateDirectoryW( path, NULL ) && GetLastError() != ERROR_ALREADY_EXISTS)
+ return;
+
+ path[ path_len++ ] = '\\';
+ for (i = 0; i < sizeof(files) / sizeof(files[0]); i++)
+ {
+ path[ path_len ] = 0;
+ strcatW( path, files[i] );
+ if (PathFileExistsW( path )) continue;
+
+ file = CreateFileW( path, GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE,
+ NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL );
+ if (file == INVALID_HANDLE_VALUE)
+ WINE_ERR( "wine: failed to create %s.", wine_dbgstr_w(path) );
+ else
+ CloseHandle( file );
+ }
+}
+
/* Performs the rename operations dictated in %SystemRoot%\Wininit.ini.
* Returns FALSE if there was an error, or otherwise if all is ok.
*/
@@ -1023,6 +1058,9 @@ static void update_wineprefix( BOOL force )
}
DestroyWindow( hwnd );
}
+
+ create_etc_stub_files();
+
WINE_MESSAGE( "wine: configuration in '%s' has been updated.\n", config_dir );
}
--
2.4.0

View File

@@ -0,0 +1 @@
Fixes: [12076] Create stub files for system32/drivers/etc/{services,hosts,networks,protocol}