Skip to content

Determine readlink result whether should be validated or not #73812

@jozkee

Description

@jozkee

From @pedrobsaila #72258 (comment):

libraries\Common\src\System\Net\NetworkInformation\UnixCommandLinePing.cs : I validate result because ping executable should be check (ex: file exists) before it can be used as a command line

private static bool IsBusyboxPing(string? pingBinary)
{
if (pingBinary != null)
{
string? linkedName = Interop.Sys.ReadLink(pingBinary);
// If pingBinary is not link linkedName will be null
if (linkedName != null && linkedName.EndsWith("busybox", StringComparison.Ordinal))
{
return true;
}

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions