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

(#3603) Don't allow trace logging when no elevated #3605

Merged
merged 1 commit into from
Jan 22, 2025

Conversation

gep13
Copy link
Member

@gep13 gep13 commented Jan 22, 2025

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

  1. Run choco search --trace as an administrator - see the trace logging displayed
  2. Run choco search --trace as a non-administrator - see a warning about not using --trace and no trace logging
  3. Run choco 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 place

Operating Systems Testing

  • Windows 11

Change Types Made

  • Bug fix (non-breaking change).
  • Feature / Enhancement (non-breaking change).
  • Breaking change (fix or feature that could cause existing functionality to change).
  • Documentation changes.
  • PowerShell code changes.

Change Checklist

  • Requires a change to the documentation.
  • Documentation has been updated.
  • Tests to cover my changes, have been added.
  • All new and existing tests passed?
  • PowerShell code changes: PowerShell v3 compatibility checked?

Related Issue

Fixes #3603

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.

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.
@gep13 gep13 requested a review from corbob January 22, 2025 12:08
@gep13 gep13 linked an issue Jan 22, 2025 that may be closed by this pull request
6 tasks
Copy link
Member

@corbob corbob left a comment

Choose a reason for hiding this comment

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

LGTM!

@corbob corbob merged commit d658139 into chocolatey:hotfix/1.4.2 Jan 22, 2025
4 of 5 checks passed
@corbob
Copy link
Member

corbob commented Jan 22, 2025

Thanks for getting this fixed up @gep13 👍

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.

Trace logging is allowed in non-elevated session
2 participants