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

Unable to do non-elevated operations when cachelocation is set to a restricted directory #3291

Closed
5 tasks done
AdmiringWorm opened this issue Aug 2, 2023 · 1 comment · Fixed by #3288
Closed
5 tasks done
Assignees
Milestone

Comments

@AdmiringWorm
Copy link
Member

Checklist

  • I have verified this is the correct repository for opening this issue.
  • I have verified no other issues exist related to my problem.
  • I have verified this is not an issue for a specific package.
  • I have verified this issue is not security related.
  • I confirm I am using official, and not unofficial, or modified, Chocolatey products.

What You Are Seeing?

When running choco download, you get failures unless you are elevated - even though choco download should work as a normal user.

This also affects installations if the Chocolatey Install location is a non-restricted folder, but the cache folder is in a restricted folder.

What is Expected?

choco download should work regardless of elevation state.

How Did You Get This To Happen?

On a system with:

  • A Chocolatey for Business license
  • Chocolatey 2.2.0
  • Chocolatey.Extension 6.1.0
  • cacheLocation set to a restricted location
  1. Set cacheLocation to a restricted directory and run a command that uses the cache (e.g. choco config set cacheLocation --value $env:ChocolateyInstall\choco-cache; choco search cloudflared)
  2. Open a non-elevated terminal and change to a location you're happy to download a package to (though it doesn't really matter)
  3. Run choco download nexus-repository
  4. Observe output (included below)

image

Additionally, when running choco download with a cacheLocation that doesn't exist, there is a different bad error.

  1. Set cacheLocation to a restricted directory that doesn't exist (e.g. choco config set cacheLocation --value $env:ChocolateyInstall\choco-cache2)
  2. Open a non-elevated terminal and change to a location you're happy to download a package to (though it doesn't really matter)
  3. Run choco download nexus-repository
  4. Observe output (included below)

image

System Details

  • Operating System: Windows 10
  • Windows PowerShell Version: 5 / 7
  • Chocolatey CLI Version: 2.2.0
  • Chocolatey Licensed Extension version: 6.1.0
  • Chocolatey License type (Professional / Business / ?): Business
  • Terminal/Emulator: Windows Terminal

Installed Packages

N/A

Output Log

Available in private issue

Additional Context

While this in most cases affecting licensed customers, the fix is needed to be for Chocolatey NuGet Client and Chocolatey CLI.

@AdmiringWorm AdmiringWorm added this to the 2.2.1 milestone Aug 2, 2023
@AdmiringWorm AdmiringWorm self-assigned this Aug 2, 2023
AdmiringWorm added a commit to AdmiringWorm/choco that referenced this issue Aug 2, 2023
To fix a bug in licensed extension when downloading packages and the
cache location is set to a restricted folder, there was a need to update
Chocolatey.NuGet.Client and pull in the changes to Chocolatey CLI.
This PR makes the necessary changes for this.
gep13 pushed a commit to AdmiringWorm/choco that referenced this issue Aug 2, 2023
To fix a bug in licensed extension when downloading packages and the
cache location is set to a restricted folder, there was a need to update
Chocolatey.NuGet.Client and pull in the changes to Chocolatey CLI.
This PR makes the necessary changes for this.
corbob pushed a commit to AdmiringWorm/choco that referenced this issue Aug 2, 2023
To fix a bug in licensed extension when downloading packages and the
cache location is set to a restricted folder, there was a need to update
Chocolatey.NuGet.Client and pull in the changes to Chocolatey CLI.
This PR makes the necessary changes for this.
corbob added a commit that referenced this issue Aug 2, 2023
(#3291) Update Chocolatey.NuGet.Client libraries to 3.4.2
@corbob corbob closed this as completed Aug 3, 2023
gep13 added a commit that referenced this issue Aug 3, 2023
* hotfix/2.2.1:
  (maint) Update GitReleaseManager configuration
  (#3291) Update Chocolatey.NuGet.Client libraries to 3.4.2
  (#3286) Adjust wording of upgrade failure message
  (#3286) Prevent MSI Upgrades
  (#3286) Do not remove any files on MSI uninstall
  (#3285) Upgrade 7z to 23.01
gep13 added a commit that referenced this issue Aug 3, 2023
* master:
  (maint) Update GitReleaseManager configuration
  (#3291) Update Chocolatey.NuGet.Client libraries to 3.4.2
  (#3286) Adjust wording of upgrade failure message
  (#3286) Prevent MSI Upgrades
  (#3286) Do not remove any files on MSI uninstall
  (#3285) Upgrade 7z to 23.01
@gep13 gep13 changed the title Unable to do non-elevated operations when cache location is set to restricted directory Unable to do non-elevated operations when cachelocation is set to a restricted directory Aug 4, 2023
@choco-bot
Copy link

🎉 This issue has been resolved in version 2.2.1 🎉

The release is available on:

Your GitReleaseManager bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants