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

File locked with read and delete permissions behave differently between client and server OS #3144

Open
4 tasks done
AdmiringWorm opened this issue May 2, 2023 · 0 comments

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.

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?

  1. Install the package upgradepackage version 1.0.0.
  2. Lock a file in the directory using $LockedFile = [System.IO.File]::Open("C:\ProgramData\chocolatey\lib\upgradepackage\tools\chocolateyInstall.ps1", "OpenOrCreate", "ReadWrite", "Read,Delete").
  3. Upgrade the package upgradepackage (ignore any warnings).
  4. Verify whether the directory lib-bkp\upgradepackage\1.0.0 exist 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.0

Output Log

https://gist.github.com/AdmiringWorm/cf023056f77e45be24d19a196b4c686d

Additional Context

The included log includes the full log from upgrading 1.2.1 until the end of the v2 testing.

@github-actions github-actions bot added the Pending Closure This issue has been marked as having no response or is stale and will soon be closed. label Jun 2, 2023
@chocolatey chocolatey deleted a comment from github-actions bot Jun 2, 2023
@pauby pauby removed the Pending Closure This issue has been marked as having no response or is stale and will soon be closed. label Jun 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants