From nobody Mon Apr 29 11:49:44 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+47450+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+47450+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1568776892; cv=none; d=zoho.com; s=zohoarc; b=Pl9Xz9wqhka0xwxLindlxWZ6/yrlh+XZBCperQrxXsAQF4a+dOrecXk77bKFObivMnlJ3VtuqjIDpwTdJp7xGOlmgh57dBdcRtt0+c+giiQXj6LEt3NvxfxR0x6UF/ccwlRCKMEh/zY26dHOVrK1Yox6kNaWT9s4vzVAGz/FtXM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568776892; h=Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To:ARC-Authentication-Results; bh=QvkwV3BMq0TeFTV8ZEODMtxu21LYP4ZCpRf5iAyAE6Q=; b=aAoaBv7gF8mLjlEaRWJTm2cqlQlW0d6Xe25wYiA1pXpvkkwCCLH9l9ZknYx1hN1ulDhWnwMHZ6AqpzdamDyPrjnf1Gfkr+ScLvBTpH1BZBOdEhoKBmUUSNEZ7hHUGhmZifDhTTELx3Oaw0XVfB33ilKTThYgYrrvWJ2/AhcNz4s= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+47450+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1568776892634217.87239848981642; Tue, 17 Sep 2019 20:21:32 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id GE37YY1788612xkTXVB9kQt6; Tue, 17 Sep 2019 20:21:32 -0700 X-Received: from mga09.intel.com (mga09.intel.com []) by groups.io with SMTP; Tue, 17 Sep 2019 20:21:31 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Sep 2019 20:21:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,519,1559545200"; d="scan'208";a="216797323" X-Received: from jshi19-mobl.ccr.corp.intel.com ([10.254.215.71]) by fmsmga002.fm.intel.com with ESMTP; 17 Sep 2019 20:21:30 -0700 From: "Steven Shi" To: devel@edk2.groups.io Cc: liming.gao@intel.com, bob.c.feng@intel.com Subject: [edk2-devel] [PATCH v2 1/1] BaseTools: Add more parameter checking for CopyFileOnChange() Date: Wed, 18 Sep 2019 11:21:09 +0800 Message-Id: <20190918032109.3844-2-steven.shi@intel.com> In-Reply-To: <20190918032109.3844-1-steven.shi@intel.com> References: <20190918032109.3844-1-steven.shi@intel.com> Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,steven.shi@intel.com X-Gm-Message-State: 3VT7MoGtIyyEiLi2tp68ANg8x1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1568776892; bh=9KCMHpFAY9PNvmPxxgl0u98pQppyQfOJHn1cpYYbHh8=; h=Cc:Date:From:Reply-To:Subject:To; b=M/ruP9mRLH/P9tUZg7slV22cqj8X3uqPWaMxDC83AJeDIoAtEc1nBHS4jCXU3QNqHEg PELkwEM/jfRs1rrBau/SlfjBUpqlOdiGpBjcIc2/WvUlYfe1smcIKMXaYGuUUSF6dtiaZ JS68sBFNi64YgchafZOr9TvxUKskbNSxgcE= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2193 The current CopyFileOnChange() method in Misc.py does not accept the input SrcFile parameter as a dir, but the method does not check the SrcFile is dir or not. This patch is to add more input parameter type checking and error message output for method CopyFileOnChange. Cc: Liming Gao Cc: Bob Feng Signed-off-by: Steven Shi Reviewed-by: Bob Feng =20 --- BaseTools/Source/Python/Common/Misc.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/BaseTools/Source/Python/Common/Misc.py b/BaseTools/Source/Pyth= on/Common/Misc.py index 714eb840ea..a488536cb4 100755 --- a/BaseTools/Source/Python/Common/Misc.py +++ b/BaseTools/Source/Python/Common/Misc.py @@ -536,7 +536,8 @@ def CopyFileOnChange(SrcFile, Dst, FileLock=3DNone): SrcFile =3D LongFilePath(SrcFile) Dst =3D LongFilePath(Dst) =20 - if not os.path.exists(SrcFile): + if os.path.isdir(SrcFile): + EdkLogger.error(None, FILE_COPY_FAILURE, ExtraData=3D'CopyFileOnCh= ange SrcFile is a dir, not a file: %s' % SrcFile) return False =20 if os.path.isdir(Dst): --=20 2.17.1.windows.2 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#47450): https://edk2.groups.io/g/devel/message/47450 Mute This Topic: https://groups.io/mt/34184105/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-