From patchwork Thu Apr 21 08:51:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaud Charlet X-Patchwork-Id: 613021 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3qrCCj1S85z9sXR for ; Thu, 21 Apr 2016 18:51:28 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=KnLZo0JB; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:mime-version:content-type; q=dns; s=default; b=PBPGtwgUaThCqG/0mzJ4vXw1yTs7HvMO2PVJ2bgsrQbkIxLrhD b9nYW53A+dUNZla6EbT4bu4+LdyVPf8tKUEFP6PWeMRU8VKT6nkPhQWKJty3GNlH 2DMHQvb6mZthp70v8WjtHm2k4uJPNt+OCHuaAcZA6RwlXpV5Jjr+dhuD0= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:mime-version:content-type; s= default; bh=6VaZasFiJmnnbXXd8oHEGDEwfPw=; b=KnLZo0JBIXpnoN9WP6JF 5c/uoI3hLtZCZtr2R/F7SbtUArk+dIhOu68wMXlgSvmlOJGMkx9/JoI78meJhH3W clkUSCdOw8+rHyuMgrFJv+pTt1C+NqXQ/AxjXpjXVlJdPOa0FHQ2Fpbc0P3zX6OX FSxc4u8W7WZt3eXGpcoFMbU= Received: (qmail 68643 invoked by alias); 21 Apr 2016 08:51:21 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 68615 invoked by uid 89); 21 Apr 2016 08:51:20 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.6 required=5.0 tests=AWL, BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_NONE autolearn=no version=3.3.2 spammy=Soft, 235192, H*F:U*charlet, precaution X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Thu, 21 Apr 2016 08:51:10 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id A73CE116DA7; Thu, 21 Apr 2016 04:51:08 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id k0h7py74YRJq; Thu, 21 Apr 2016 04:51:08 -0400 (EDT) Received: from tron.gnat.com (tron.gnat.com [205.232.38.10]) by rock.gnat.com (Postfix) with ESMTP id 91C73116D97; Thu, 21 Apr 2016 04:51:08 -0400 (EDT) Received: by tron.gnat.com (Postfix, from userid 4192) id 8DE373F0; Thu, 21 Apr 2016 04:51:08 -0400 (EDT) Date: Thu, 21 Apr 2016 04:51:08 -0400 From: Arnaud Charlet To: gcc-patches@gcc.gnu.org Cc: Vasiliy Fofanov Subject: [Ada] Minor changes to warning message for exe filenames on Windows Message-ID: <20160421085108.GA108894@adacore.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) Change wording of the warning message on problematic filenames to be more neutral. Add a new substring "patch" introduced on Windows 10. Tested on x86_64-pc-linux-gnu, committed on trunk 2016-04-21 Vasiliy Fofanov * gnatlink.adb: Change wording of the warning message on problematic filenames to be more neutral. Add a new substring "patch" introduced on Windows 10. Index: gnatlink.adb =================================================================== --- gnatlink.adb (revision 235192) +++ gnatlink.adb (working copy) @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1996-2015, Free Software Foundation, Inc. -- +-- Copyright (C) 1996-2016, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -1680,10 +1680,10 @@ -- Special warnings for worrisome file names on windows - -- Windows-7 will not allow an executable file whose name contains any - -- of the substrings "install", "setup", or "update" to load without - -- special administration privileges. This rather incredible behavior - -- is Microsoft's idea of a useful security precaution. + -- Recent versions of Windows by default cause privilege escalation if an + -- executable file name contains substrings "install", "setup", "update" + -- or "patch". A console application will typically fail to load as a + -- result, so we should warn the user. Bad_File_Names_On_Windows : declare FN : String := Output_File_Name.all; @@ -1696,13 +1696,10 @@ for J in 1 .. FN'Length - (S'Length - 1) loop if FN (J .. J + (S'Length - 1)) = S then Error_Msg - ("warning: possible problem with executable name """ - & Output_File_Name.all & '"'); + ("warning: executable file name """ & Output_File_Name.all + & """ contains substring """ & S & '"'); Error_Msg - ("file name contains substring """ & S & '"'); - Error_Msg - ("admin privileges may be required on Windows 7 " - & "to load this file"); + ("admin privileges may be required to run this file"); end if; end loop; end Check_File_Name; @@ -1723,6 +1720,7 @@ Check_File_Name ("install"); Check_File_Name ("setup"); Check_File_Name ("update"); + Check_File_Name ("patch"); end if; end Bad_File_Names_On_Windows;