Skip to content

TimeZoneInfo: Determine readlink result whether should be validated or not  #73813

@jozkee

Description

@jozkee

From @pedrobsaila #72258 (comment):

libraries\System.Private.CoreLib\src\System\TimeZoneInfo.Unix.NonAndroid.cs : seems to handle case where link is not resolved. I'm not sure whether I should validate or not.

if (File.Exists(tzFilePath))
{
try
{
rawData = File.ReadAllBytes(tzFilePath);
if (string.IsNullOrEmpty(id))
{
id = FindTimeZoneIdUsingReadLink(tzFilePath);
if (string.IsNullOrEmpty(id))
{
id = FindTimeZoneId(rawData);
}
}
return true;
}
catch (IOException) { }
catch (SecurityException) { }
catch (UnauthorizedAccessException) { }
}
return false;

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions