(#3603) Don't allow trace logging when no elevated #3605
Merged
+33
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description Of Changes
When an attempt is made to use trace logging in a non-elevated session, a warning will be shown, and no trace logging will be shown. In addition, if the -r option is in play, the warning about no trace logging will go to the log file, but won't be displayed.
Motivation and Context
Prior to this change, trace level logging was available to everyone. However, due to the sensitive nature of some of the output, the decision has been taken to restrict trace logging to only elevated sessions.
Testing
choco search --trace
as an administrator - see the trace logging displayedchoco search --trace
as a non-administrator - see a warning about not using --trace and no trace loggingchoco search --trace -r
as a non-administrator - see that there isn't a warning and also no trace logging, check the log file, and find the warning still in placeOperating Systems Testing
Change Types Made
Change Checklist
Related Issue
Fixes #3603