From 17a4e1ba06cad585cd8cd00d0c1fdf44e280772d Mon Sep 17 00:00:00 2001 From: carlossanlop Date: Tue, 14 Apr 2020 10:36:40 -0700 Subject: [PATCH] Fix name of WellKnownTypeNames.SystemIOFileFullName --- .../Security/DoNotCallDangerousMethodsInDeserialization.cs | 2 +- src/Utilities/Compiler/WellKnownTypeNames.cs | 2 +- .../Analysis/TaintedDataAnalysis/FilePathInjectionSinks.cs | 2 +- .../Analysis/TaintedDataAnalysis/HardcodedCertificateSources.cs | 2 +- .../FlowAnalysis/Analysis/TaintedDataAnalysis/ZipSlipSinks.cs | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/NetAnalyzers/Core/Microsoft.NetCore.Analyzers/Security/DoNotCallDangerousMethodsInDeserialization.cs b/src/NetAnalyzers/Core/Microsoft.NetCore.Analyzers/Security/DoNotCallDangerousMethodsInDeserialization.cs index f13e53e8fd..6976ae3441 100644 --- a/src/NetAnalyzers/Core/Microsoft.NetCore.Analyzers/Security/DoNotCallDangerousMethodsInDeserialization.cs +++ b/src/NetAnalyzers/Core/Microsoft.NetCore.Analyzers/Security/DoNotCallDangerousMethodsInDeserialization.cs @@ -33,7 +33,7 @@ public sealed class DoNotCallDangerousMethodsInDeserialization : DiagnosticAnaly private ImmutableArray<(string, string[])> DangerousCallable = ImmutableArray.Create<(string, string[])> ( - (WellKnownTypeNames.SystemIOFileFullName, new[] { "WriteAllBytes", "WriteAllLines", "WriteAllText", "Copy", "Move", "AppendAllLines", "AppendAllText", "AppendText", "Delete" }), + (WellKnownTypeNames.SystemIOFile, new[] { "WriteAllBytes", "WriteAllLines", "WriteAllText", "Copy", "Move", "AppendAllLines", "AppendAllText", "AppendText", "Delete" }), (WellKnownTypeNames.SystemIODirectory, new[] { "Delete" }), (WellKnownTypeNames.SystemIOFileInfo, new[] { "Delete" }), (WellKnownTypeNames.SystemIODirectoryInfo, new[] { "Delete" }), diff --git a/src/Utilities/Compiler/WellKnownTypeNames.cs b/src/Utilities/Compiler/WellKnownTypeNames.cs index 3cfa12669e..f9ff5c9ac6 100644 --- a/src/Utilities/Compiler/WellKnownTypeNames.cs +++ b/src/Utilities/Compiler/WellKnownTypeNames.cs @@ -144,7 +144,7 @@ internal static class WellKnownTypeNames public const string SystemIOCompressionZipFileExtensions = "System.IO.Compression.ZipFileExtensions"; public const string SystemIODirectory = "System.IO.Directory"; public const string SystemIODirectoryInfo = "System.IO.DirectoryInfo"; - public const string SystemIOFileFullName = "System.IO.File"; + public const string SystemIOFile = "System.IO.File"; public const string SystemIOFileInfo = "System.IO.FileInfo"; public const string SystemIOFileStream = "System.IO.FileStream"; public const string SystemIOLogLogStore = "System.IO.Log.LogStore"; diff --git a/src/Utilities/FlowAnalysis/FlowAnalysis/Analysis/TaintedDataAnalysis/FilePathInjectionSinks.cs b/src/Utilities/FlowAnalysis/FlowAnalysis/Analysis/TaintedDataAnalysis/FilePathInjectionSinks.cs index cb5f0cceff..73fb1536ad 100644 --- a/src/Utilities/FlowAnalysis/FlowAnalysis/Analysis/TaintedDataAnalysis/FilePathInjectionSinks.cs +++ b/src/Utilities/FlowAnalysis/FlowAnalysis/Analysis/TaintedDataAnalysis/FilePathInjectionSinks.cs @@ -26,7 +26,7 @@ static FilePathInjectionSinks() ( "Exists", new[] { "path" } ), }); builder.AddSinkInfo( - WellKnownTypeNames.SystemIOFileFullName, + WellKnownTypeNames.SystemIOFile, SinkKind.FilePathInjection, isInterface: false, isAnyStringParameterInConstructorASink: false, diff --git a/src/Utilities/FlowAnalysis/FlowAnalysis/Analysis/TaintedDataAnalysis/HardcodedCertificateSources.cs b/src/Utilities/FlowAnalysis/FlowAnalysis/Analysis/TaintedDataAnalysis/HardcodedCertificateSources.cs index 848a8c0912..a56559dfac 100644 --- a/src/Utilities/FlowAnalysis/FlowAnalysis/Analysis/TaintedDataAnalysis/HardcodedCertificateSources.cs +++ b/src/Utilities/FlowAnalysis/FlowAnalysis/Analysis/TaintedDataAnalysis/HardcodedCertificateSources.cs @@ -20,7 +20,7 @@ static HardcodedCertificateSources() var builder = PooledHashSet.GetInstance(); builder.AddSourceInfoSpecifyingTaintedTargets( - WellKnownTypeNames.SystemIOFileFullName, + WellKnownTypeNames.SystemIOFile, isInterface: false, taintedProperties: null, taintedMethodsNeedsPointsToAnalysis: null, diff --git a/src/Utilities/FlowAnalysis/FlowAnalysis/Analysis/TaintedDataAnalysis/ZipSlipSinks.cs b/src/Utilities/FlowAnalysis/FlowAnalysis/Analysis/TaintedDataAnalysis/ZipSlipSinks.cs index 74a07820f0..2be460ef92 100644 --- a/src/Utilities/FlowAnalysis/FlowAnalysis/Analysis/TaintedDataAnalysis/ZipSlipSinks.cs +++ b/src/Utilities/FlowAnalysis/FlowAnalysis/Analysis/TaintedDataAnalysis/ZipSlipSinks.cs @@ -26,7 +26,7 @@ static ZipSlipSinks() ("ExtractToFile", new[] { "destinationFileName" } ), }); builder.AddSinkInfo( - WellKnownTypeNames.SystemIOFileFullName, + WellKnownTypeNames.SystemIOFile, SinkKind.ZipSlip, isInterface: false, isAnyStringParameterInConstructorASink: false,