public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] ShellPkg/UefiShellLevel2CommandsLib: Support unspecified local Timezone.
@ 2018-05-05 20:23 Marvin Häuser
  2018-05-07 18:10 ` Carsey, Jaben
  2018-05-17  8:02 ` Ni, Ruiyu
  0 siblings, 2 replies; 3+ messages in thread
From: Marvin Häuser @ 2018-05-05 20:23 UTC (permalink / raw)
  To: edk2-devel@lists.01.org; +Cc: jaben.carsey@intel.com, ruiyu.ni@intel.com

EFI_RUNTIME_SERVICES.GetTime() might return an unspecified Timezone,
such as when SetTime() has not been called after the PC-AT CMOS RTC
was cut off power. Consider this case by not attempting Timezone
translations for when it is invalid.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Marvin Haeuser <Marvin.Haeuser@outlook.com>
---
 ShellPkg/Library/UefiShellLevel2CommandsLib/Ls.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/Ls.c b/ShellPkg/Library/UefiShellLevel2CommandsLib/Ls.c
index 7d2e15f5206b..73804b4516ba 100644
--- a/ShellPkg/Library/UefiShellLevel2CommandsLib/Ls.c
+++ b/ShellPkg/Library/UefiShellLevel2CommandsLib/Ls.c
@@ -2,7 +2,7 @@
   Main file for ls shell level 2 function.
 
   (C) Copyright 2013-2015 Hewlett-Packard Development Company, L.P.<BR>
-  Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
   This program and the accompanying materials
   are licensed and made available under the terms and conditions of the BSD License
   which accompanies this distribution.  The full text of the license may be found at
@@ -506,7 +506,7 @@ PrintLsOutput(
       // Change the file time to local time.
       //
       Status = gRT->GetTime(&LocalTime, NULL);
-      if (!EFI_ERROR (Status)) {
+      if (!EFI_ERROR (Status) && (LocalTime.TimeZone != EFI_UNSPECIFIED_TIMEZONE)) {
         if ((Node->Info->CreateTime.TimeZone != EFI_UNSPECIFIED_TIMEZONE) &&
             (Node->Info->CreateTime.Month >= 1 && Node->Info->CreateTime.Month <= 12)) {
           //
-- 
2.17.0.windows.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] ShellPkg/UefiShellLevel2CommandsLib: Support unspecified local Timezone.
  2018-05-05 20:23 [PATCH] ShellPkg/UefiShellLevel2CommandsLib: Support unspecified local Timezone Marvin Häuser
@ 2018-05-07 18:10 ` Carsey, Jaben
  2018-05-17  8:02 ` Ni, Ruiyu
  1 sibling, 0 replies; 3+ messages in thread
From: Carsey, Jaben @ 2018-05-07 18:10 UTC (permalink / raw)
  To: Marvin Häuser, edk2-devel@lists.01.org; +Cc: Ni, Ruiyu

Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>

> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of
> Marvin Häuser
> Sent: Saturday, May 05, 2018 1:23 PM
> To: edk2-devel@lists.01.org
> Cc: Carsey, Jaben <jaben.carsey@intel.com>; Ni, Ruiyu <ruiyu.ni@intel.com>
> Subject: [edk2] [PATCH] ShellPkg/UefiShellLevel2CommandsLib: Support
> unspecified local Timezone.
> Importance: High
> 
> EFI_RUNTIME_SERVICES.GetTime() might return an unspecified Timezone,
> such as when SetTime() has not been called after the PC-AT CMOS RTC
> was cut off power. Consider this case by not attempting Timezone
> translations for when it is invalid.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Marvin Haeuser <Marvin.Haeuser@outlook.com>
> ---
>  ShellPkg/Library/UefiShellLevel2CommandsLib/Ls.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/Ls.c
> b/ShellPkg/Library/UefiShellLevel2CommandsLib/Ls.c
> index 7d2e15f5206b..73804b4516ba 100644
> --- a/ShellPkg/Library/UefiShellLevel2CommandsLib/Ls.c
> +++ b/ShellPkg/Library/UefiShellLevel2CommandsLib/Ls.c
> @@ -2,7 +2,7 @@
>    Main file for ls shell level 2 function.
> 
>    (C) Copyright 2013-2015 Hewlett-Packard Development Company, L.P.<BR>
> -  Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR>
> +  Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
>    This program and the accompanying materials
>    are licensed and made available under the terms and conditions of the BSD
> License
>    which accompanies this distribution.  The full text of the license may be
> found at
> @@ -506,7 +506,7 @@ PrintLsOutput(
>        // Change the file time to local time.
>        //
>        Status = gRT->GetTime(&LocalTime, NULL);
> -      if (!EFI_ERROR (Status)) {
> +      if (!EFI_ERROR (Status) && (LocalTime.TimeZone !=
> EFI_UNSPECIFIED_TIMEZONE)) {
>          if ((Node->Info->CreateTime.TimeZone !=
> EFI_UNSPECIFIED_TIMEZONE) &&
>              (Node->Info->CreateTime.Month >= 1 && Node->Info-
> >CreateTime.Month <= 12)) {
>            //
> --
> 2.17.0.windows.1
> 
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ShellPkg/UefiShellLevel2CommandsLib: Support unspecified local Timezone.
  2018-05-05 20:23 [PATCH] ShellPkg/UefiShellLevel2CommandsLib: Support unspecified local Timezone Marvin Häuser
  2018-05-07 18:10 ` Carsey, Jaben
@ 2018-05-17  8:02 ` Ni, Ruiyu
  1 sibling, 0 replies; 3+ messages in thread
From: Ni, Ruiyu @ 2018-05-17  8:02 UTC (permalink / raw)
  To: Marvin Häuser, edk2-devel@lists.01.org; +Cc: Carsey, Jaben

Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>

Thanks/Ray

> -----Original Message-----
> From: edk2-devel <edk2-devel-bounces@lists.01.org> On Behalf Of Marvin
> Häuser
> Sent: Sunday, May 6, 2018 4:23 AM
> To: edk2-devel@lists.01.org
> Cc: Carsey, Jaben <jaben.carsey@intel.com>; Ni, Ruiyu <ruiyu.ni@intel.com>
> Subject: [edk2] [PATCH] ShellPkg/UefiShellLevel2CommandsLib: Support
> unspecified local Timezone.
> 
> EFI_RUNTIME_SERVICES.GetTime() might return an unspecified Timezone,
> such as when SetTime() has not been called after the PC-AT CMOS RTC
> was cut off power. Consider this case by not attempting Timezone
> translations for when it is invalid.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Marvin Haeuser <Marvin.Haeuser@outlook.com>
> ---
>  ShellPkg/Library/UefiShellLevel2CommandsLib/Ls.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/Ls.c
> b/ShellPkg/Library/UefiShellLevel2CommandsLib/Ls.c
> index 7d2e15f5206b..73804b4516ba 100644
> --- a/ShellPkg/Library/UefiShellLevel2CommandsLib/Ls.c
> +++ b/ShellPkg/Library/UefiShellLevel2CommandsLib/Ls.c
> @@ -2,7 +2,7 @@
>    Main file for ls shell level 2 function.
> 
>    (C) Copyright 2013-2015 Hewlett-Packard Development Company, L.P.<BR>
> -  Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR>
> +  Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
>    This program and the accompanying materials
>    are licensed and made available under the terms and conditions of the BSD
> License
>    which accompanies this distribution.  The full text of the license may be
> found at
> @@ -506,7 +506,7 @@ PrintLsOutput(
>        // Change the file time to local time.
>        //
>        Status = gRT->GetTime(&LocalTime, NULL);
> -      if (!EFI_ERROR (Status)) {
> +      if (!EFI_ERROR (Status) && (LocalTime.TimeZone !=
> EFI_UNSPECIFIED_TIMEZONE)) {
>          if ((Node->Info->CreateTime.TimeZone != EFI_UNSPECIFIED_TIMEZONE)
> &&
>              (Node->Info->CreateTime.Month >= 1 && Node->Info-
> >CreateTime.Month <= 12)) {
>            //
> --
> 2.17.0.windows.1
> 
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-05-17  8:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-05 20:23 [PATCH] ShellPkg/UefiShellLevel2CommandsLib: Support unspecified local Timezone Marvin Häuser
2018-05-07 18:10 ` Carsey, Jaben
2018-05-17  8:02 ` Ni, Ruiyu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox