From: Simon Rozman Date: Mon, 9 Mar 2020 13:17:18 +0000 (+0100) Subject: openvpnmsica: Fix TAPInterface.DisplayName field interpretation X-Git-Tag: v2.5_beta1~193 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=36493bf6383767fe4e20f1dfda6be2a7ee0dc1f2;p=thirdparty%2Fopenvpn.git openvpnmsica: Fix TAPInterface.DisplayName field interpretation The DisplayName field type is Filename in the MSI database. This means it must be authored as "8.3" filename, or "8.3|long filename". This issue does not appear until interface names grow longer than 8 characters, or contain characters invalid in 8.3 filename notation. Signed-off-by: Simon Rozman Acked-by: Gert Doering Message-Id: <20200309131728.380-2-simon@rozman.si> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg19520.html Signed-off-by: Gert Doering --- diff --git a/src/openvpnmsica/openvpnmsica.c b/src/openvpnmsica/openvpnmsica.c index 4236330a7..e1f0b77d0 100644 --- a/src/openvpnmsica/openvpnmsica.c +++ b/src/openvpnmsica/openvpnmsica.c @@ -2,7 +2,7 @@ * openvpnmsica -- Custom Action DLL to provide OpenVPN-specific support to MSI packages * https://community.openvpn.net/openvpn/wiki/OpenVPNMSICA * - * Copyright (C) 2018 Simon Rozman + * Copyright (C) 2018-2020 Simon Rozman * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 @@ -752,6 +752,9 @@ EvaluateTAPInterfaces(_In_ MSIHANDLE hInstall) { goto cleanup_hRecord; } + /* `DisplayName` field type is [Filename](https://docs.microsoft.com/en-us/windows/win32/msi/filename), which is either "8.3|long name" or "8.3". */ + LPTSTR szDisplayNameEx = _tcschr(szDisplayName, TEXT('|')); + szDisplayNameEx = szDisplayNameEx != NULL ? szDisplayNameEx + 1 : szDisplayName; if (iAction > INSTALLSTATE_BROKEN) { @@ -796,7 +799,7 @@ EvaluateTAPInterfaces(_In_ MSIHANDLE hInstall) msica_op_tap_interface_create, MSICA_INTERFACE_TICK_SIZE, NULL, - szDisplayName)); + szDisplayNameEx)); } else { @@ -807,7 +810,7 @@ EvaluateTAPInterfaces(_In_ MSIHANDLE hInstall) msica_op_tap_interface_delete_by_name, MSICA_INTERFACE_TICK_SIZE, NULL, - szDisplayName)); + szDisplayNameEx)); } /* The amount of tick space to add for each interface to progress indicator. */