-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Access Denied when %TEMP%\WinGet does not explicitly have the user with granted access #5276
Comments
We've found some similar issues:
If any of the above are duplicates, please consider closing this issue out and adding additional context in the original issue.
|
Can you provide the ACL for the
A log file would be helpful as well. If the process is crashing, contents of one of the events from Event Viewer > Windows Logs > Application would be good. |
ACLs
(Output is in spanish, Administradores refers to Administrators, Usuarios refers to Users) WinGet Logs:
Event ViewerThere doesn't seem to be any reports about the crash on event viewer. |
Assuming that my local repro was consistent with your repro (and the initial customer issue), then this PR should fix things. If you want to be very sure that I got the same issue, if the HANDLE handle = CreateFileW(L"C:\\Temp\\WinGet", READ_CONTROL | WRITE_OWNER | WRITE_DAC | FILE_READ_ATTRIBUTES, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, nullptr, OPEN_EXISTING, FILE_FLAG_OPEN_REPARSE_POINT | FILE_FLAG_BACKUP_SEMANTICS, nullptr);
auto lastError = GetLastError(); and this would succeed (removal of HANDLE handle = CreateFileW(L"C:\\Temp\\WinGet", READ_CONTROL | WRITE_DAC | FILE_READ_ATTRIBUTES, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, nullptr, OPEN_EXISTING, FILE_FLAG_OPEN_REPARSE_POINT | FILE_FLAG_BACKUP_SEMANTICS, nullptr);
auto lastError = GetLastError(); |
Brief description of your issue
When changing %TEMP% location to a directory where the user does not have explicit permissions (
C:\TEMP
, for example), but the user can read/write the folder (the user is in the "Administrators" group), WinGet create the new%TEMP%\WinGet
folder, but will write nothing into it and will crash withCOM API will also throw exception.
Steps to reproduce
%TMP%
and%TEMP%
toC:\TEMP
(assuming the folder exists)C:\TEMP
folder empty, so WinGet has to createC:\TEMP\WinGet
againwinget list
)Expected behavior
WinGet should be able to write into that
C:\TEMP\WinGet
folder if it was able to create it, right?Actual behavior
WinGet creates the
C:\TEMP\WinGet
folder (assuming it does not exist) and then crashes.Environment
The text was updated successfully, but these errors were encountered: