Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Fix native command execution to work from SMB share#13947

Closed
SteveL-MSFT wants to merge 2 commits into
PowerShell:masterPowerShell/PowerShell:masterfrom
SteveL-MSFT:smb-executeSteveL-MSFT/PowerShell:smb-executeCopy head branch name to clipboard
Closed

Fix native command execution to work from SMB share#13947
SteveL-MSFT wants to merge 2 commits into
PowerShell:masterPowerShell/PowerShell:masterfrom
SteveL-MSFT:smb-executeSteveL-MSFT/PowerShell:smb-executeCopy head branch name to clipboard

Conversation

@SteveL-MSFT

@SteveL-MSFT SteveL-MSFT commented Oct 30, 2020

Copy link
Copy Markdown
Member

PR Summary

Due to some changes with how reparse points are handled, you can no longer execute a native command directly from an SMB share because the new code tries to find the target of the reparse point, but that isn't a valid call for SMB so it fails with an unhandled exception. Fix is to check in the function to find the reparse target if the last error is ERROR_INVALID_FUNCTION which indicates it's not a reparse point and it will use the original file path for execution.

Validated manually against \live.sysinternals.com\tools\procdump

PR Context

PR Checklist

@SteveL-MSFT

Copy link
Copy Markdown
Member Author

CodeFactor issues are not related to this change

@iSazonov

Copy link
Copy Markdown
Collaborator

Should we fix private static string WinInternalGetLinkType(string filePath) too?

@SteveL-MSFT SteveL-MSFT changed the title Fix native command execution to work on SMB share Fix native command execution to work from SMB share Oct 31, 2020
@iSazonov

iSazonov commented Nov 1, 2020

Copy link
Copy Markdown
Collaborator

@SteveL-MSFT Sorry, I forget about #13634. Please see the discussion. It seems we find a better consensus there.

@SteveL-MSFT

Copy link
Copy Markdown
Member Author

Looks like this is dupe of #13634

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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.