From patchwork Mon Mar 9 02:17:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Rozman X-Patchwork-Id: 1029 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director8.mail.ord1d.rsapps.net ([172.30.191.6]) by backend30.mail.ord1d.rsapps.net with LMTP id SPQaOlVCZl7BBwAAIUCqbw for ; Mon, 09 Mar 2020 09:19:17 -0400 Received: from proxy15.mail.ord1d.rsapps.net ([172.30.191.6]) by director8.mail.ord1d.rsapps.net with LMTP id eND1OVVCZl7zagAAfY0hYg ; Mon, 09 Mar 2020 09:19:17 -0400 Received: from smtp21.gate.ord1d ([172.30.191.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy15.mail.ord1d.rsapps.net with LMTP id 4P6lOVVCZl7SKQAAAY1PeQ ; Mon, 09 Mar 2020 09:19:17 -0400 X-Spam-Threshold: 95 X-Spam-Score: 0 X-Spam-Flag: NO X-Virus-Scanned: OK X-Orig-To: openvpnslackdevel@openvpn.net X-Originating-Ip: [216.105.38.7] Authentication-Results: smtp21.gate.ord1d.rsapps.net; iprev=pass policy.iprev="216.105.38.7"; spf=pass smtp.mailfrom="openvpn-devel-bounces@lists.sourceforge.net" smtp.helo="lists.sourceforge.net"; dkim=fail (signature verification failed) header.d=sourceforge.net; dkim=fail (signature verification failed) header.d=sf.net; dkim=fail (signature verification failed) header.d=rozman.si; dmarc=fail (p=none; dis=none) header.from=rozman.si X-Suspicious-Flag: YES X-Classification-ID: 939bd45a-6208-11ea-b377-525400a98691-1-1 Received: from [216.105.38.7] ([216.105.38.7:35072] helo=lists.sourceforge.net) by smtp21.gate.ord1d.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id 5C/A5-09068-452466E5; Mon, 09 Mar 2020 09:19:17 -0400 Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.90_1) (envelope-from ) id 1jBIIT-00009E-Hq; Mon, 09 Mar 2020 13:18:17 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jBIIP-00008h-E3 for openvpn-devel@lists.sourceforge.net; Mon, 09 Mar 2020 13:18:13 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=f56+O8QHGTla8sER8LZvvji7eRhlfsNwj2HTC31WNvI=; b=ioKuAFZLHd6+c/FE+SnBciUQZs vdSSZeqKzoz8ifFqZ95eQm9uPiU55k9i2iwEaLOQvGs8xp11e7uMY87SDiCIMinrSV8KmPG1ywq8V f0S9Q1a1bwjV8xvOM+CIus2e/Npw+2zWWR+Cunl9ycbG+ddb1LNImSjk5DBalQrteFSE=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=f56+O8QHGTla8sER8LZvvji7eRhlfsNwj2HTC31WNvI=; b=a7GPWgyjRZvDZUtJJ2Lb3TXRCg NYDn4zh4R7hf9nIJAXjyTjUuJ6JMTYDgRGO7zxjiWul3f2gw/owRV8T8+PI0T8Ixh6YpZXg74bUDS TqDLyk87RrZ9+nhaczxG5SBan5uUAT8S5GaEO96r44O9eZYEH9YMcDUzuuQQ68Fb2SHs=; Received: from pub5.amebis.si ([213.250.55.21]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.2) id 1jBIIL-00DVnj-5Y for openvpn-devel@lists.sourceforge.net; Mon, 09 Mar 2020 13:18:13 +0000 Received: by pub5.amebis.si (Postfix, from userid 1000) id 443831002F87; Mon, 9 Mar 2020 14:17:54 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rozman.si; s=default; t=1583759874; bh=f56+O8QHGTla8sER8LZvvji7eRhlfsNwj2HTC31WNvI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Mfo1+pxI32OGtzyG7vJW4ntNUO+ihLGO1xhPGbPuA4CwH3mY4WRAF2mDI6hTV/wGA BFmqTgNXyUezL0rniDC2AqCgGWsLZiJePa9R6OcjoUe4RSFyhNblzeMRugb+43hgZp rEqC7YeuLAttyQUBKtkcwQsm4vLxy8L/KqnclHYM= X-Spam-Checker-Version: SpamAssassin 3.4.3 (2019-12-06) on brana.amebis.doma X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=3.4.3 Received: from SR6.amebis.doma (unknown [IPv6:2a00:ee2:209:164:a5ae:e83c:b7b:725]) by pub5.amebis.si (Postfix) with ESMTP id DF3711002F94; Mon, 9 Mar 2020 14:17:48 +0100 (CET) From: Simon Rozman To: openvpn-devel@lists.sourceforge.net Date: Mon, 9 Mar 2020 14:17:18 +0100 Message-Id: <20200309131728.380-2-simon@rozman.si> X-Mailer: git-send-email 2.24.1.windows.2 In-Reply-To: <20200309131728.380-1-simon@rozman.si> References: <20200309131728.380-1-simon@rozman.si> MIME-Version: 1.0 X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-Headers-End: 1jBIIL-00DVnj-5Y Subject: [Openvpn-devel] [PATCH 02/12] openvpnmsica: Fix TAPInterface.DisplayName field interpretation X-BeenThere: openvpn-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox 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 --- src/openvpnmsica/openvpnmsica.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/openvpnmsica/openvpnmsica.c b/src/openvpnmsica/openvpnmsica.c index 4236330a..e1f0b77d 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. */