Skip to content

fix(UNC): backup device type#122

Merged
Miguel Arana (mja9) merged 3 commits intomasterfrom
fix/backup/device-type
Apr 1, 2026
Merged

fix(UNC): backup device type#122
Miguel Arana (mja9) merged 3 commits intomasterfrom
fix/backup/device-type

Conversation

@mja9
Copy link
Copy Markdown
Collaborator

@mja9 Miguel Arana (mja9) commented Feb 25, 2026

Experienced an issue where backup device type was being misidentified as URL because of UNC format.
Added test cases to confirm correct device type identification for UNC paths.

@mja9 Miguel Arana (mja9) self-assigned this Feb 25, 2026
@RicoFactset
Copy link
Copy Markdown

Rico (RicoFactset) commented Feb 25, 2026

Logo
Checkmarx One – Scan Summary & Details1dfd7010-6ad5-4b68-83ef-ae2e84809438


Fixed Issues (2) Great job! The following issues were fixed in this Pull Request
Severity Issue Source File / Package
MEDIUM Insufficiently_Protected_Credentials /src/SmoFacade/Login.cs: 67
LOW Heap_Inspection /tests/AgDatabaseMove.Integration/Fixtures/TestAgDatabaseFixture.cs: 35

Communicate with Checkmarx by submitting a PR comment with Checkmarx (@Checkmarx) followed by one of the supported commands. Learn about the supported commands here.

@mja9 Miguel Arana (mja9) changed the title fix(backup): device type fix(UNC): backup device type Feb 26, 2026
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall glance, looks good to me
But it's been some time 😅

Just a couple things I thought worth highlighting

public static bool IsValidFileUrl(string path)
{
return Uri.TryCreate(path, UriKind.Absolute, out var uriResult)
&& (uriResult.Scheme == Uri.UriSchemeHttp || uriResult.Scheme == Uri.UriSchemeHttps || uriResult.IsUnc)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any upstream dependency breaking cause it was relying on UNC urls to succeed here which it won't now do?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To my knowledge no, but I'll see if I can't confirm that through unit tests.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ya, that should be good enough, the lib version upgrade can always be backed out and fixed during server integration

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually can't find an example of this. From what I gather, a network file represented through a UNC path should always be a FILE device type.

As far as I can tell, URL device types should only be used when backing up to Azure Blob Storage or S3-compatible object storage. I think the current test cases for URLs effectively cover these cases.

In other words, I don't think we should ever have a case where a UNC path should be identified as a URL device type.

@mja9 Miguel Arana (mja9) merged commit 5c4e14b into master Apr 1, 2026
1 check passed
@mja9 Miguel Arana (mja9) deleted the fix/backup/device-type branch April 1, 2026 20:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants