File locked with read and delete permissions behave differently between client and server OS
Author: AdmiringWormCreated May 2, 2023Updated Sep 2, 2026
LabelsBug0 - TriagingClickUp - QA
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.
What You Are Seeing?
On a client system with the latest code we are working against allows a backup folder to be deleted if it contains a file that has been read and delete locked, even if that file was moved from a different location. On a server it is not possible to delete this file when it is read and delete locked, it is still allowed to be moved to any new location.
What is Expected?
The expectation is that behavior is consistent, and it will be removed on both client and server or kept on both.
How Did You Get This To Happen?
- Install the package
upgradepackageversion1.0.0. - Lock a file in the directory using
$LockedFile = [System.IO.File]::Open("C:\ProgramData\chocolatey\lib\\\upgradepackage\tools\chocolateyInstall.ps1", "OpenOrCreate", "ReadWrite", "Read,Delete"). - Upgrade the package
upgradepackage(ignore any warnings). - Verify whether the directory
lib-bkp\\\upgradepackage\1.0.0exist or not (will not exist on client systems, but exist on server systems).
System Details
- Operating System: Windows 10 and Windows 2019
- Windows PowerShell version: 5.1.19041.2673 (Server: 5.1.17763.1852)
- Chocolatey CLI Version: 2.0.0-vNext
- Chocolatey Licensed Extension version: N/A
- Chocolatey License type: N/A
- Terminal/Emulator: PowerShell
Installed Packages
chocolatey 2.0.0-PROJ615bef
installpackage 1.0.0
upgradepackage 1.1.0Output Log
https://gist.github.com/AdmiringWorm/cf023056f77e45be24d19a196b4c686dAdditional Context
The included log includes the full log from upgrading 1.2.1 until the end of the v2 testing.
┆Issue is synchronized with this Clickup task by Unito
Source: chocolatey/choco