Skip to content

Commit

Permalink
rem - brk - Removed 2021 NTFS mitigation
Browse files Browse the repository at this point in the history
---

See commit 5d5e886 for more info.

---

Type: rem
Breaking: True
Doc Required: False
Backport Required: False
Part: 1/1
  • Loading branch information
AptiviCEO committed Jan 28, 2025
1 parent 77788f3 commit ec245da
Show file tree
Hide file tree
Showing 13 changed files with 13 additions and 151 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
changes!
-->
<NitrocidModAPIVersionMajor>3.0.25</NitrocidModAPIVersionMajor>
<NitrocidModAPIVersionChangeset>453</NitrocidModAPIVersionChangeset>
<NitrocidModAPIVersionChangeset>454</NitrocidModAPIVersionChangeset>

<!-- The above two properties are to be installed to the file version -->
<NitrocidModAPIVersion>$(NitrocidModAPIVersionMajor).$(NitrocidModAPIVersionChangeset)</NitrocidModAPIVersion>
Expand Down
26 changes: 0 additions & 26 deletions private/Nitrocid.Tests/Files/FilesystemNeutralizationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,31 +67,5 @@ public void TestNeutralizePathsCustom()
NeutPath.ShouldBe(TargetPath + "/" + TestPath);
}
}

/// <summary>
/// Tests throwing on invalid path
/// </summary>
[TestMethod]
[DataRow(null)]
[DataRow("")]
[DataRow("/usr/lib")]
[DataRow("C:/Program Files")]
[DataRow("Music")]
[Description("Neutralization")]
public void TestThrowOnInvalidPathValid(string path) =>
Should.NotThrow(() => FilesystemTools.ThrowOnInvalidPath(path));

/// <summary>
/// Tests throwing on invalid path
/// </summary>
[TestMethod]
[DataRow("\\\\.\\globalroot\\device\\condrv\\kernelconnect")]
[DataRow("C:\\$i30")]
[Description("Neutralization")]
public void TestThrowOnInvalidPathInvalid(string path)
{
if (KernelPlatform.IsOnWindows())
Should.Throw(() => FilesystemTools.ThrowOnInvalidPath(path), typeof(KernelException));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,6 @@ public static void LoadEvents()
{
lock (EventManagerLock)
{
FilesystemTools.ThrowOnInvalidPath(EventFile);
EventFile = FilesystemTools.NeutralizePath(EventFile);
DebugWriter.WriteDebug(DebugLevel.I, "Loading event {0}...", EventFile);

Expand Down Expand Up @@ -197,7 +196,6 @@ public static void SaveEvents() =>
/// </summary>
public static void SaveEvents(string Path, bool Destructive)
{
FilesystemTools.ThrowOnInvalidPath(Path);
Path = FilesystemTools.NeutralizePath(Path);
DebugWriter.WriteDebug(DebugLevel.I, "Saving events to {0}...", Path);

Expand Down Expand Up @@ -239,7 +237,6 @@ public static void SaveEvent(EventInfo EventInstance) =>
/// </summary>
public static void SaveEvent(EventInfo EventInstance, string File)
{
FilesystemTools.ThrowOnInvalidPath(File);
File = FilesystemTools.NeutralizePath(File);
DebugWriter.WriteDebug(DebugLevel.I, "Saving event to {0}...", File);
var contents = JsonConvert.SerializeObject(EventInstance, Formatting.Indented);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@ public static void LoadReminders()
{
lock (ReminderManagerLock)
{
FilesystemTools.ThrowOnInvalidPath(ReminderFile);
ReminderFile = FilesystemTools.NeutralizePath(ReminderFile);
DebugWriter.WriteDebug(DebugLevel.I, "Loading reminder {0}...", ReminderFile);

Expand Down Expand Up @@ -206,7 +205,6 @@ public static void SaveReminders() =>
/// </summary>
public static void SaveReminders(string Path, bool Destructive)
{
FilesystemTools.ThrowOnInvalidPath(Path);
Path = FilesystemTools.NeutralizePath(Path);
DebugWriter.WriteDebug(DebugLevel.I, "Saving reminders to {0}...", Path);

Expand Down Expand Up @@ -248,7 +246,6 @@ public static void SaveReminder(ReminderInfo ReminderInstance) =>
/// </summary>
public static void SaveReminder(ReminderInfo ReminderInstance, string File)
{
FilesystemTools.ThrowOnInvalidPath(File);
File = FilesystemTools.NeutralizePath(File);
DebugWriter.WriteDebug(DebugLevel.I, "Saving reminder to {0}...", File);
var contents = JsonConvert.SerializeObject(ReminderInstance, Formatting.Indented);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,6 @@ public static bool FTPChangeLocalDir(string Directory)
{
string targetDir;
targetDir = $"{FTPShellCommon.FtpCurrentDirectory}/{Directory}";
FilesystemTools.ThrowOnInvalidPath(targetDir);

// Check if folder exists
if (Checking.FolderExists(targetDir))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ public static bool SFTPChangeLocalDir(string Directory)
{
string targetDir;
targetDir = $"{SFTPShellCommon.SFTPCurrDirect}/{Directory}";
FilesystemTools.ThrowOnInvalidPath(targetDir);

// Check if folder exists
if (Checking.FolderExists(targetDir))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ public static bool IsSql(string Path)
try
{
// Neutralize path
FilesystemTools.ThrowOnInvalidPath(Path);
Path = FilesystemTools.NeutralizePath(Path);

// Try to open an SQL connection
Expand Down
2 changes: 1 addition & 1 deletion public/Nitrocid.Templates/templates/KSMod/ModName.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public class ModName : IMod
public string Name { get; set; } = "My Mod";
public string Version { get; set; } = "1.0.0";

public Version MinimumSupportedApiVersion => new(3, 0, 25, 453);
public Version MinimumSupportedApiVersion => new(3, 0, 25, 454);

public ReadOnlyDictionary<string, Delegate> PubliclyAvailableFunctions => null;

Expand Down
Loading

0 comments on commit ec245da

Please sign in to comment.