Skip to content

Conversation

@IISResetMe
Copy link
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
Copy link
Collaborator

iSazonov commented Oct 2, 2018

@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
Collaborator Author

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

@TravisEz13
Copy link
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