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

Make Add-Type open source files with FileAccess.Read and FileShare.Read explicitly#7915

Merged
iSazonov merged 3 commits into
PowerShell:masterPowerShell/PowerShell:masterfrom
IISResetMe:patch-1IISResetMe/PowerShell:patch-1Copy head branch name to clipboard
Oct 3, 2018
Merged

Make Add-Type open source files with FileAccess.Read and FileShare.Read explicitly#7915
iSazonov merged 3 commits into
PowerShell:masterPowerShell/PowerShell:masterfrom
IISResetMe:patch-1IISResetMe/PowerShell:patch-1Copy head branch name to clipboard

Conversation

@IISResetMe

Copy link
Copy Markdown
Collaborator

Fix #7914

Omitting the FileAccess attribute when constructing a FileStream with FileMode.Open makes the constructor default to FileAccess.ReadWrite, which is completely unecessary and inappropriate for Add-Type when compiling from source

PR Summary

This PR ensures that Add-Type explicitly opens source code files with only Read access

PR Checklist

Omitting the `FileAccess` attribute when constructing a `FileStream` with `FileMode.Open` makes the constructor default to `FileAccess.ReadWrite`, which is completely unecessary and inappropriate for Add-Type when compiling from source
@IISResetMe IISResetMe changed the title Make Add-Type open source files with FileAccess.Read explicitly (#7914) #1 Make Add-Type open source files with FileAccess.Read explicitly (Fix #7914) Oct 1, 2018
@iSazonov

iSazonov commented Oct 2, 2018

Copy link
Copy Markdown
Collaborator

@IISResetMe Please update package versions. (It is not your issue but our test system requirement.)

@iSazonov iSazonov requested a review from daxian-dbw October 2, 2018 06:25
@iSazonov iSazonov self-assigned this Oct 2, 2018
@IISResetMe

Copy link
Copy Markdown
Collaborator Author

@iSazonov done, not sure why the WebListener test fails though

@TravisEz13

Copy link
Copy Markdown
Member

Restarted AppVeyor

@iSazonov iSazonov changed the title Make Add-Type open source files with FileAccess.Read explicitly (Fix #7914) Make Add-Type open source files with FileAccess.Read and FileShare.Read explicitly Oct 3, 2018
@iSazonov iSazonov merged commit 5e525de into PowerShell:master Oct 3, 2018
adityapatwardhan pushed a commit to adityapatwardhan/PowerShell that referenced this pull request Apr 9, 2019
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.

Bug: Add-Type needs write-access when compiling from source

3 participants

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