Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added check for maximum size of downloaded file names #1842

Merged
merged 2 commits into from Jan 12, 2022

Conversation

jedieaston
Copy link
Contributor

@jedieaston jedieaston commented Jan 11, 2022


Resolves #1808.

This PR adds a check to GetInstallerPostHashValidationFileName that ensures that the filename in the URL does not exceed 260 characters (the maximum path size file name size in Windows). If it does, then the "older" naming style (manifest.version.ext) is used for the downloaded file. Technically this could still fail if the full length of the path is 260 instead of just the file name, but I thought that was fairly unlikely. If it isn't I can adjust for that too.

Tested: manually via the manifest given in the issue. As always, I'm happy to add tests if needed.

Edit: corrected explanation, thanks.

Microsoft Reviewers: Open in CodeFlow

@jedieaston jedieaston requested a review from a team as a code owner January 11, 2022 17:00
@ghost ghost added the Issue-Bug It either shouldn't be doing this or needs an investigation. label Jan 11, 2022
@JohnMcPMS
Copy link
Member

JohnMcPMS commented Jan 11, 2022

Is this something you are seeing in practice?

Edit: Doh, just look at the linked issue dummy 😄

@ghost
Copy link

ghost commented Jan 11, 2022

the maximum path size in Windows

Nope. The Maximum "FIle Name String" can be 260 char long. In windows, from v1607 onwards the Maximum "Path Length" is UTF-16 32K char provided that the executable use longPathAware embedded manifest. (i.e MAX_PATH no longer becomes effective for that executable.)

@JohnMcPMS
Copy link
Member

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@jedieaston
Copy link
Contributor Author

It looks like the component governance checker is down:

[INFO] Submitting 65 registrations. 

[ERROR] There was an unexpected error:  
[ERROR] SafelyExecute logged TimeoutException: The HTTP request timed out after 00:01:40.
[INFO] For more information about configuring the build task please visit: https://aka.ms/cgbuildtaskdocs 
Execution finished, status: -1
Process terminating.
##[error]The Component Detection tool experienced a failure. See the logs for more information
Finishing: Component Governance

@JohnMcPMS
Copy link
Member

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@JohnMcPMS JohnMcPMS merged commit 7481c14 into microsoft:master Jan 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Package does not install due to the file name exceeding the maximum amount of characters
2 participants