Skip to content

Commit

Permalink
Merge branch 'stable'
Browse files Browse the repository at this point in the history
* stable:
  (doc) update release notes
  (GH-1529) Fix: install of choco exit code 1
  (GH-1532) Fix: proxy bypass with "*" causes regex error
  (GH-1531) Hold exclusive locks on non-essential logs
  (maint) formatting
  (maint) update copyright for assemblies
  (GH-1527) Fix: NuGet cache removal fixes
  (GH-1527) Use machine temp with systemprofile
  • Loading branch information
ferventcoder committed Apr 9, 2018
2 parents 3c81cf8 + 92bcf90 commit 3fa08ca
Show file tree
Hide file tree
Showing 10 changed files with 67 additions and 88 deletions.
2 changes: 1 addition & 1 deletion .uppercut
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<property name="version.nuget.prerelease" value="" overwrite="false" />
<property name="version.use.build_date" value="false" overwrite="false" />
<property name="assembly.description" value="${project.name} is a product of ${company.name} - All Rights Reserved." overwrite="false" />
<property name="assembly.copyright" value="Copyright © 2017 ${company.name} Copyright © 2011 - 2017, RealDimensions Software, LLC - All Rights Reserved." overwrite="false" />
<property name="assembly.copyright" value="Copyright © 2017 - 2018 ${company.name} Copyright © 2011 - 2017, RealDimensions Software, LLC - All Rights Reserved." overwrite="false" />
<property name="sign.project_with_key" value="true" overwrite="false" />

<!-- Build Features Overrides -->
Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@ This covers changes for the "chocolatey" and "chocolatey.lib" packages, which ar

**NOTE**: If you have a licensed edition of Chocolatey ("chocolatey.extension"), refer to this in tandem with [Chocolatey Licensed CHANGELOG](https://github.com/chocolatey/choco/blob/master/CHANGELOG_LICENSED.md).

## [0.10.10](https://github.com/chocolatey/choco/issues?q=milestone%3A0.10.10+is%3Aclosed) (April 9, 2018)
### BUG FIXES
* Installing chocolatey 0.10.9 results in an exit code of 1 - see [#1529](https://github.com/chocolatey/choco/issues/1529)
* Proxy bypass list with "*" will return regex quantifier parsing errors - see [#1532](https://github.com/chocolatey/choco/issues/1532)
* NuGet cache folders - choco should always attempt to remove and should find in the cacheLocation when set - see [#1527](https://github.com/chocolatey/choco/issues/1527)

### IMPROVEMENTS
* Logging - Exclusive File Lock on Non-Essential Logs - see [#1531](https://github.com/chocolatey/choco/issues/1531)


## [0.10.9](https://github.com/chocolatey/choco/issues?q=milestone%3A0.10.9+is%3Aclosed) (March 25, 2018)
The vendored 7Zip had a couple of security findings that necessitated a release. There is also a lot of goodness going into this release as well. We've fixed XDT transforms not to keep extra data around (requiring manual fixes). We've resolved some issues surrounding compatibility with Get-PackageParameters in the chocolatey-core.extension package and what's now built into Chocolatey. That should now work appropriately, and the built-in method should be preferred, so if you are using `--package-parameters-sensitive`, those will be added as well when you do have the chocolatey-core.extension package also installed.

Expand Down
36 changes: 5 additions & 31 deletions nuget/chocolatey.lib/chocolatey.lib.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -33,40 +33,14 @@ This is the Chocolatey Library (API / DLL) package which allows Chocolatey to be
</description>
<releaseNotes>See all - https://github.com/chocolatey/choco/blob/stable/CHANGELOG.md

## 0.10.9
The vendored 7Zip had a couple of security findings that necessitated a release. There is also a lot of goodness going into this release as well. We've fixed XDT transforms not to keep extra data around (requiring manual fixes). We've resolved some issues surrounding compatibility with Get-PackageParameters in the chocolatey-core.extension package and what's now built into Chocolatey. That should now work appropriately, and the built-in method should be preferred, so if you are using `--package-parameters-sensitive`, those will be added as well when you do have the chocolatey-core.extension package also installed.

We've also brought in the long desired logging with no colorization. You can set that as a switch or globally with a feature flipper. With outdated/upgrade, you can now ignore unfound packages along with already skipping pinned packages. That will help you reduce your output to only the things it finds upgrades for that can be upgraded.

## 0.10.10
### BUG FIXES
* [Security] Fix - Pro/Business - Logging - Get-PackageParameters should not log sensitive params - see [#1460](https://github.com/chocolatey/choco/issues/1460)
* Fix - XDT transform causes xml file to have extra data in it (unusable until manually fixed) - see [#1482](https://github.com/chocolatey/choco/issues/1482)
* Fix - Escape package registry information to reduce unreadable files - see [#1505](https://github.com/chocolatey/choco/issues/1505)
* Fix - Uninstall-ChocolateyZipPackage is unable to find zip contents file - see [#1415](https://github.com/chocolatey/choco/issues/1415)
* Fix - Get-PackageParameters - Resolve differences between chocolatey.core-extension and built-in method - see [#1490](https://github.com/chocolatey/choco/issues/1490)
* Fix - Get-PackageParameters - force built-in method to be preferred over chocolatey-core.extension method - see [#1476](https://github.com/chocolatey/choco/issues/1476)
* Fix - Get-PackageParameters should handle urls - see [#1459](https://github.com/chocolatey/choco/issues/1459)
* Fix - Setting output directory with proper quoting can result in "The given path's format is not supported." - see [#1517](https://github.com/chocolatey/choco/issues/1517)
* Fix - Logging - PowerShell script contents logging should not error if they have contents mistaken for log formatting - see [#1489](https://github.com/chocolatey/choco/issues/1489)
* Fix - Incorrect documentation for Install-ChocolateyInstallPackage - see [#1416](https://github.com/chocolatey/choco/issues/1416)
* [API] Fix - Logging - Loggers should always be checked for initialization - see [#1447](https://github.com/chocolatey/choco/issues/1447)
* Fix - Pro/Business - Expired licenses should not cause Chocolatey errors - see [#1500](https://github.com/chocolatey/choco/issues/1500)
* Installing chocolatey 0.10.9 results in an exit code of 1 - see [#1529](https://github.com/chocolatey/choco/issues/1529)
* Proxy bypass list with "*" will return regex quantifier parsing errors - see [#1532](https://github.com/chocolatey/choco/issues/1532)
* NuGet cache folders - choco should always attempt to remove and should find in the cacheLocation when set - see [#1527](https://github.com/chocolatey/choco/issues/1527)

### IMPROVEMENTS
* [Security] RAR extraction with older 7zip can cause memory corruption (CVE-2018-5996) / ZIP Shrink vulnerability (CVE-2017-17969) - see [#1478](https://github.com/chocolatey/choco/issues/1478)
* Provide friendly error messages on well-known exit codes - see [#1526](https://github.com/chocolatey/choco/issues/1526)
* Capture password securely during validation when only the user name has been provided - see [#1524](https://github.com/chocolatey/choco/issues/1524)
* Outdated/Upgrade - Option/feature to ignore unfound packages - see [#1398](https://github.com/chocolatey/choco/issues/1398)
* Installation/Setup: run choco once to initialize the config file - see [#1401](https://github.com/chocolatey/choco/issues/1401)
* Logging - Log access denied for config file to log file only - see [#1445](https://github.com/chocolatey/choco/issues/1445)
* Ability to pick x64/x86 runtime binaries for shimming by architecture without needing PowerShell scripts - see [#1365](https://github.com/chocolatey/choco/issues/1365)
* Logging - Add '--no-color' as a global option and 'logWithoutColor' feature - see [#100](https://github.com/chocolatey/choco/issues/100)
* Reset colors after abnormal exit - see [#474](https://github.com/chocolatey/choco/issues/474)
* [API] Logging - Set logging levels debug/verbose/trace - see [#1448](https://github.com/chocolatey/choco/issues/1448)
* [API] Logging - Sync already logged items when setting custom logging - see [#1446](https://github.com/chocolatey/choco/issues/1446)
* [API] Fix - Ensure one instantiation of GetChocolatey at a time - see [#1400](https://github.com/chocolatey/choco/issues/1400)
* Pro/Business - Uninstall - Keep stored package information by default - see [#1399](https://github.com/chocolatey/choco/issues/1399)
* Pro/Business - Logging - See licensing logging output - see [#1488](https://github.com/chocolatey/choco/issues/1488)
* Logging - Exclusive File Lock on Non-Essential Logs - see [#1531](https://github.com/chocolatey/choco/issues/1531)
</releaseNotes>
<dependencies>
<dependency id="log4net" version="2.0.3" />
Expand Down
36 changes: 5 additions & 31 deletions nuget/chocolatey/chocolatey.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -63,40 +63,14 @@ In that mess there is a link to the [PowerShell Chocolatey module reference](htt
<releaseNotes>
See all - https://github.com/chocolatey/choco/blob/stable/CHANGELOG.md

## 0.10.9
The vendored 7Zip had a couple of security findings that necessitated a release. There is also a lot of goodness going into this release as well. We've fixed XDT transforms not to keep extra data around (requiring manual fixes). We've resolved some issues surrounding compatibility with Get-PackageParameters in the chocolatey-core.extension package and what's now built into Chocolatey. That should now work appropriately, and the built-in method should be preferred, so if you are using `--package-parameters-sensitive`, those will be added as well when you do have the chocolatey-core.extension package also installed.

We've also brought in the long desired logging with no colorization. You can set that as a switch or globally with a feature flipper. With outdated/upgrade, you can now ignore unfound packages along with already skipping pinned packages. That will help you reduce your output to only the things it finds upgrades for that can be upgraded.

## 0.10.10
### BUG FIXES
* [Security] Fix - Pro/Business - Logging - Get-PackageParameters should not log sensitive params - see [#1460](https://github.com/chocolatey/choco/issues/1460)
* Fix - XDT transform causes xml file to have extra data in it (unusable until manually fixed) - see [#1482](https://github.com/chocolatey/choco/issues/1482)
* Fix - Escape package registry information to reduce unreadable files - see [#1505](https://github.com/chocolatey/choco/issues/1505)
* Fix - Uninstall-ChocolateyZipPackage is unable to find zip contents file - see [#1415](https://github.com/chocolatey/choco/issues/1415)
* Fix - Get-PackageParameters - Resolve differences between chocolatey.core-extension and built-in method - see [#1490](https://github.com/chocolatey/choco/issues/1490)
* Fix - Get-PackageParameters - force built-in method to be preferred over chocolatey-core.extension method - see [#1476](https://github.com/chocolatey/choco/issues/1476)
* Fix - Get-PackageParameters should handle urls - see [#1459](https://github.com/chocolatey/choco/issues/1459)
* Fix - Setting output directory with proper quoting can result in "The given path's format is not supported." - see [#1517](https://github.com/chocolatey/choco/issues/1517)
* Fix - Logging - PowerShell script contents logging should not error if they have contents mistaken for log formatting - see [#1489](https://github.com/chocolatey/choco/issues/1489)
* Fix - Incorrect documentation for Install-ChocolateyInstallPackage - see [#1416](https://github.com/chocolatey/choco/issues/1416)
* [API] Fix - Logging - Loggers should always be checked for initialization - see [#1447](https://github.com/chocolatey/choco/issues/1447)
* Fix - Pro/Business - Expired licenses should not cause Chocolatey errors - see [#1500](https://github.com/chocolatey/choco/issues/1500)
* Installing chocolatey 0.10.9 results in an exit code of 1 - see [#1529](https://github.com/chocolatey/choco/issues/1529)
* Proxy bypass list with "*" will return regex quantifier parsing errors - see [#1532](https://github.com/chocolatey/choco/issues/1532)
* NuGet cache folders - choco should always attempt to remove and should find in the cacheLocation when set - see [#1527](https://github.com/chocolatey/choco/issues/1527)

### IMPROVEMENTS
* [Security] RAR extraction with older 7zip can cause memory corruption (CVE-2018-5996) / ZIP Shrink vulnerability (CVE-2017-17969) - see [#1478](https://github.com/chocolatey/choco/issues/1478)
* Provide friendly error messages on well-known exit codes - see [#1526](https://github.com/chocolatey/choco/issues/1526)
* Capture password securely during validation when only the user name has been provided - see [#1524](https://github.com/chocolatey/choco/issues/1524)
* Outdated/Upgrade - Option/feature to ignore unfound packages - see [#1398](https://github.com/chocolatey/choco/issues/1398)
* Installation/Setup: run choco once to initialize the config file - see [#1401](https://github.com/chocolatey/choco/issues/1401)
* Logging - Log access denied for config file to log file only - see [#1445](https://github.com/chocolatey/choco/issues/1445)
* Ability to pick x64/x86 runtime binaries for shimming by architecture without needing PowerShell scripts - see [#1365](https://github.com/chocolatey/choco/issues/1365)
* Logging - Add '--no-color' as a global option and 'logWithoutColor' feature - see [#100](https://github.com/chocolatey/choco/issues/100)
* Reset colors after abnormal exit - see [#474](https://github.com/chocolatey/choco/issues/474)
* [API] Logging - Set logging levels debug/verbose/trace - see [#1448](https://github.com/chocolatey/choco/issues/1448)
* [API] Logging - Sync already logged items when setting custom logging - see [#1446](https://github.com/chocolatey/choco/issues/1446)
* [API] Fix - Ensure one instantiation of GetChocolatey at a time - see [#1400](https://github.com/chocolatey/choco/issues/1400)
* Pro/Business - Uninstall - Keep stored package information by default - see [#1399](https://github.com/chocolatey/choco/issues/1399)
* Pro/Business - Logging - See licensing logging output - see [#1488](https://github.com/chocolatey/choco/issues/1488)
* Logging - Exclusive File Lock on Non-Essential Logs - see [#1531](https://github.com/chocolatey/choco/issues/1531)
</releaseNotes>
</metadata>
</package>
2 changes: 1 addition & 1 deletion nuget/chocolatey/tools/chocolateysetup.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ function Invoke-Chocolatey-Initial {
try {
$chocoInstallationFolder = Get-ChocolateyInstallFolder
$chocoExe = Join-Path -Path $chocoInstallationFolder -ChildPath "choco.exe"
& $chocoExe | Out-Null
& $chocoExe -v | Out-Null
Write-Debug "Chocolatey execution completed successfully."
} catch {
Write-ChocolateyWarning "Unable to run Chocolately at this time. It is likely that .Net Framework installation requires a system reboot"
Expand Down
2 changes: 1 addition & 1 deletion src/chocolatey/infrastructure.app/nuget/NugetCommon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public static IPackageRepository GetRemoteRepository(ChocolateyConfiguration con
if (!string.IsNullOrWhiteSpace(configuration.Proxy.BypassList))
{
"chocolatey".Log().Debug("Proxy has a bypass list of '{0}'.".format_with(configuration.Proxy.BypassList.escape_curly_braces()));
proxy.BypassList = configuration.Proxy.BypassList.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
proxy.BypassList = configuration.Proxy.BypassList.Replace("*",".*").Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
}

proxy.BypassProxyOnLocal = configuration.Proxy.BypassOnLocal;
Expand Down
60 changes: 41 additions & 19 deletions src/chocolatey/infrastructure.app/runners/GenericRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -142,40 +142,55 @@ public void run(ChocolateyConfiguration config, Container container, bool isCons
SecurityProtocol.set_protocol(config, provideWarning:true);
EventManager.publish(new PreRunMessage(config));

var command = find_command(config, container, isConsole, parseArgs);
if (command != null)
try
{
if (config.Noop)
var command = find_command(config, container, isConsole, parseArgs);
if (command != null)
{
if (config.RegularOutput)
if (config.Noop)
{
this.Log().Info("_ {0}:{1} - Noop Mode _".format_with(ApplicationParameters.Name, command.GetType().Name));
}
if (config.RegularOutput)
{
this.Log().Info("_ {0}:{1} - Noop Mode _".format_with(ApplicationParameters.Name, command.GetType().Name));
}

command.noop(config);
}
else
{
this.Log().Debug("_ {0}:{1} - Normal Run Mode _".format_with(ApplicationParameters.Name, command.GetType().Name));
command.run(config);
command.noop(config);
}
else
{
this.Log().Debug("_ {0}:{1} - Normal Run Mode _".format_with(ApplicationParameters.Name, command.GetType().Name));
command.run(config);
}
}
}
finally
{
EventManager.publish(new PostRunMessage(config));

EventManager.publish(new PostRunMessage(config));
foreach (var task in tasks.or_empty_list_if_null())
{
task.shutdown();
}

foreach (var task in tasks.or_empty_list_if_null())
{
task.shutdown();
remove_nuget_cache(container, config);
}

remove_nuget_cache(container);
}

/// <summary>
/// if there is a NuGetScratch cache found, kill it with fire
/// </summary>
/// <param name="container">The container.</param>
private void remove_nuget_cache(Container container)
{
remove_nuget_cache(container, null);
}

/// <summary>
/// if there is a NuGetScratch cache found, kill it with fire
/// </summary>
/// <param name="container">The container.</param>
/// <param name="config">optional Chocolatey configuration to look at cacheLocation</param>
private void remove_nuget_cache(Container container, ChocolateyConfiguration config)
{
try
{
Expand All @@ -184,6 +199,13 @@ private void remove_nuget_cache(Container container)
fileSystem.delete_directory_if_exists(scratch, recursive: true, overrideAttributes: true, isSilent: true);
var nugetX = fileSystem.combine_paths(fileSystem.get_temp_path(), "x", "nuget");
fileSystem.delete_directory_if_exists(nugetX, recursive: true, overrideAttributes: true, isSilent: true);

if (config != null && !string.IsNullOrWhiteSpace(config.CacheLocation)) {
scratch = fileSystem.combine_paths(config.CacheLocation, "NuGetScratch");
fileSystem.delete_directory_if_exists(scratch, recursive: true, overrideAttributes: true, isSilent: true);
nugetX = fileSystem.combine_paths(config.CacheLocation, "x", "nuget");
fileSystem.delete_directory_if_exists(nugetX, recursive: true, overrideAttributes: true, isSilent: true);
}
}
catch (Exception ex)
{
Expand Down Expand Up @@ -229,7 +251,7 @@ public IEnumerable<T> list<T>(ChocolateyConfiguration config, Container containe
task.shutdown();
}

remove_nuget_cache(container);
remove_nuget_cache(container, config);
}
}

Expand Down
1 change: 0 additions & 1 deletion src/chocolatey/infrastructure.app/services/NugetService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1105,7 +1105,6 @@ private void remove_nuget_cache_for_package(IPackage installedPackage)
}
},
"Unable to removed cached NuGet package file");

}

public void uninstall_noop(ChocolateyConfiguration config, Action<PackageResult> continueAction)
Expand Down
Loading

0 comments on commit 3fa08ca

Please sign in to comment.