From nobody Fri Dec 27 20:55:09 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1496737752169307.98999857348736; Tue, 6 Jun 2017 01:29:12 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 2916A21AE30D2; Tue, 6 Jun 2017 01:28:04 -0700 (PDT) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id D7CD221967BD9 for ; Tue, 6 Jun 2017 01:28:02 -0700 (PDT) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Jun 2017 01:29:09 -0700 Received: from ray-dev.ccr.corp.intel.com ([10.239.9.1]) by orsmga003.jf.intel.com with ESMTP; 06 Jun 2017 01:29:08 -0700 X-Original-To: edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,305,1493708400"; d="scan'208";a="977280753" From: Ruiyu Ni To: edk2-devel@lists.01.org Date: Tue, 6 Jun 2017 16:29:04 +0800 Message-Id: <20170606082904.195040-1-ruiyu.ni@intel.com> X-Mailer: git-send-email 2.12.2.windows.2 Subject: [edk2] [PATCH] ShellPkg/alias: Return status for alias deletion X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni Cc: Tapan Shah Reviewed-by: Jaben Carsey Reviewed-by: Tapan Shah --- ShellPkg/Library/UefiShellLevel3CommandsLib/Alias.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/ShellPkg/Library/UefiShellLevel3CommandsLib/Alias.c b/ShellPkg= /Library/UefiShellLevel3CommandsLib/Alias.c index 5a3b7e5913..7277bd4b90 100644 --- a/ShellPkg/Library/UefiShellLevel3CommandsLib/Alias.c +++ b/ShellPkg/Library/UefiShellLevel3CommandsLib/Alias.c @@ -2,7 +2,7 @@ Main file for Alias shell level 3 function. =20 (C) Copyright 2015 Hewlett-Packard Development Company, L.P.
- Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BS= D License which accompanies this distribution. The full text of the license may b= e found at @@ -151,6 +151,15 @@ ShellCommandRunAlias ( // delete an alias // Status =3D gEfiShellProtocol->SetAlias(Param1, NULL, TRUE, FALSE); + if (EFI_ERROR(Status)) { + if (Status =3D=3D EFI_ACCESS_DENIED) { + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_AD), gSh= ellLevel3HiiHandle, L"alias"); =20 + ShellStatus =3D SHELL_ACCESS_DENIED; + } else { + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_UK), gSh= ellLevel3HiiHandle, L"alias", Status); =20 + ShellStatus =3D SHELL_DEVICE_ERROR; + } + } } else if (ShellCommandLineGetCount(Package) =3D=3D 3) { // // must be adding an alias --=20 2.12.2.windows.2 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel