Skip to content

Perform more security cleanup#801

Merged
danmoseley merged 4 commits intodotnet:masterfrom
hughbe:more-security-cleanup
Apr 28, 2019
Merged

Perform more security cleanup#801
danmoseley merged 4 commits intodotnet:masterfrom
hughbe:more-security-cleanup

Conversation

@hughbe
Copy link
Copy Markdown
Contributor

@hughbe hughbe commented Apr 16, 2019

No description provided.

@hughbe hughbe requested a review from a team as a code owner April 16, 2019 15:37
@zsd4yr
Copy link
Copy Markdown
Contributor

zsd4yr commented Apr 16, 2019

@hughbe you're going to have to break this down more into multiple commits; also the deleted code is concerning

@hughbe hughbe force-pushed the more-security-cleanup branch from 3c70ad2 to 8d793a5 Compare April 16, 2019 17:20
@hughbe
Copy link
Copy Markdown
Contributor Author

hughbe commented Apr 16, 2019

@zsd4yr hopefully this helps!

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 16, 2019

Codecov Report

Merging #801 into master will increase coverage by 0.19622%.
The diff coverage is 25.37313%.

@@                Coverage Diff                @@
##            master        #801         +/-   ##
=================================================
+ Coverage   28.642%   28.83822%   +0.19622%     
=================================================
  Files         1075        1078          +3     
  Lines       293506      293919        +413     
  Branches     38399       38408          +9     
=================================================
+ Hits         84066       84761        +695     
+ Misses      205407      205124        -283     
- Partials      4033        4034          +1
Flag Coverage Δ
#Debug 28.83822% <25.37313%> (+0.19622%) ⬆️
#production 18.75241% <23.31288%> (+0.07146%) ⬆️
#test 98.68151% <100%> (+0.00849%) ⬆️

@hughbe hughbe force-pushed the more-security-cleanup branch from 8d793a5 to 599c2c5 Compare April 16, 2019 21:35
@zsd4yr
Copy link
Copy Markdown
Contributor

zsd4yr commented Apr 19, 2019

@zsd4yr hopefully this helps!

That is helpful. Would you mind doing me another favor and breaking these down the first commit even more into:

  1. changes to using statements
  2. comment changes; and
  3. changes inside methods

@zsd4yr
Copy link
Copy Markdown
Contributor

zsd4yr commented Apr 19, 2019

Mostly because I really only want to PR number 3 😉

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I believe registry operations throw SecurityException for regular ACL issues (not just CAS) instead of UnauthorizedAccessException - if so this line should be reverted.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What happened to UnsafeNativeMethods.ThemingScope.CreateActivationContext(assemblyFileName, nativeResourceID); ?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Previously it passed null for the final parameter, now 0. I guess one marshals to the other?

Copy link
Copy Markdown
Member

@danmoseley danmoseley left a comment

Choose a reason for hiding this comment

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

Looks OK with couple comments.

@hughe thanks for doing this. Breaking out into commits helped. However, there are still unrelated changes, even within commits. What would really help reviewers is smaller commits and smaller PR's. Eg., pure refactoring to eg., remove or move using statements, fix comments and brackets and braces could be all in 4 commits and one PR, the work to coalesce the "Internal" properties that weren't needed anymore really should be its own PR, the remaining CAS cleanup another PR. This would make it much quicker to review because we need less "state" in our head and can pay more attention where it's needed. As a rule of thumb, changes that shouldn't change IL (formatting, comments) ought to be reall fast to review in their own PR.

Also, this repo isn't yet tested as well as it ideally would be. Separating out commits and PR's (especially given most PR's get squashed) might help us later if we need to bisect and reverse an error.

It's great to get all these changes from you, I'm just thinking about how to get them in most easily and reliably. cc @merriemcgaw

@danmoseley
Copy link
Copy Markdown
Member

Looks like there's some rebasing required. 😸

@RussKie
Copy link
Copy Markdown
Contributor

RussKie commented Apr 21, 2019

especially given most PR's get squashed

Perhaps this practice as blanket rule should be reconsidered, precisely for the above mentioned reasons.

It is author's responsibility to present work in clear and easy to understand manner, separating functional and non functional changes.
A PR should (must) contain only a single functional change, and may contain several NF changes related to the F change.

@hughbe hughbe force-pushed the more-security-cleanup branch from 599c2c5 to 66f6688 Compare April 21, 2019 15:30
@hughbe hughbe mentioned this pull request Apr 21, 2019
@hughbe
Copy link
Copy Markdown
Contributor Author

hughbe commented Apr 21, 2019

I don't expect this PR to build... waiting on #801 to be merged :)

@zsd4yr zsd4yr changed the title Perform more security cleanup [WIP] Perform more security cleanup Apr 22, 2019
@zsd4yr
Copy link
Copy Markdown
Contributor

zsd4yr commented Apr 22, 2019

I don't expect this PR to build... waiting on #801 to be merged :)

adding [WIP] since this depends on another PR

@weltkante
Copy link
Copy Markdown
Contributor

@hughbe this is #801, you probably meant you are waiting for something else?

@hughbe
Copy link
Copy Markdown
Contributor Author

hughbe commented Apr 22, 2019

Oops! #843

@zsd4yr
Copy link
Copy Markdown
Contributor

zsd4yr commented Apr 24, 2019

Oops! #843

Why is this change blocked by that one?

@hughbe
Copy link
Copy Markdown
Contributor Author

hughbe commented Apr 24, 2019

Would cause more merge conflicts.

@danmoseley
Copy link
Copy Markdown
Member

Perhaps this practice as blanket rule should be reconsidered, precisely for the above mentioned reasons. It is author's responsibility to present work in clear and easy to understand manner, separating functional and non functional changes.
A PR should (must) contain only a single functional change, and may contain several NF changes related to the F change.

In CoreFX, we avoid this by asking that significant NF changes are in a separate PR.

@danmoseley
Copy link
Copy Markdown
Member

@hughbe happy to take another look when you've done battle with the merge,

@hughbe hughbe force-pushed the more-security-cleanup branch from 6e1e4e6 to 94a1fbb Compare April 28, 2019 07:56
@RussKie
Copy link
Copy Markdown
Contributor

RussKie commented Apr 28, 2019

In CoreFX, we avoid this by asking that significant NF changes are in a separate PR.

Totally in agreement 👍
This typically works well in controlled environments (e.g. in a workplace/where contributors are incentivised to follow up on submissions) and doesn't quite work in the "wild" (afterhours hobby OSS - it may be weeks/months before reviews/feedback/merge occur).

Over the years in different projects I've experienced various styles.
Some years ago in a busy framework repo we've only accepted PRs containing a single commit - F or NF changes. When the team shrunk and amount of changes subsided - a PR with a single F + NF commits became a norm.
In https://github.com/gitextensions/gitextensions we accept PRs with a single F + additional NFs (if needed).

In the end of the day - it is all about the reviewer experience - they must be able to clearly understand what/how/why changed. And it is the author responsibility to present the work in such manner.

@@ -51,10 +51,10 @@ public sealed class Application {
static string productName;
static string productVersion;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks like we should make a pass (separately) to add visibility specifiers everywhere.

@danmoseley
Copy link
Copy Markdown
Member

@hughbe this seems fine to merge - especially before we get more conflicts - can you remove the WIP ?

@danmoseley
Copy link
Copy Markdown
Member

If you address the feedback please use new commits as usual 😸

@hughbe hughbe changed the title [WIP] Perform more security cleanup Perform more security cleanup Apr 28, 2019
@danmoseley danmoseley merged commit be88f03 into dotnet:master Apr 28, 2019
@hughbe hughbe deleted the more-security-cleanup branch April 28, 2019 19:37
@ghost ghost locked as resolved and limited conversation to collaborators Feb 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants