When you open a file for which you do not have read permission, ST will open a blank buffer under the name of the protected file rather than the contents of the file. If you try to save this over the existing file, a dialogue window appears asking for your password. The file will be saved if you have an admin account, overwriting the contents of the file without you ever seeing it.
No "permission denied" message appears in the general GUI when opening the protected file. Unable to open /path/to/file.ext will be printed in the console, however, this is not obvious, and I only discovered this because I tried opening a file using sudo.
Steps to reproduce
Save a new text file containing dummy text
Give read permission only to root
Open the file in ST using your normal user account
Enter text in the blank buffer and save
Check the result and lament
Expected behavior
When opening a read-protected file, ST should either
Open the password dialogue to get permission to read the file (maintaining the same for any subsequent writes), or
Open a dialogue denying the user read access to the file without opening a blank buffer in its name
Actual behavior
When opening a read-protected file, ST does not obviously alert the user and does not allow the user to grant permission. Instead, ST launches a blank buffer with the same name as the protected file, allowing the user to believe that the protected file is empty when it is not. ST subsequently allows the user to save the blank, or newly filled buffer, over the protected file if the user has sudo rights.
Description of the bug
When you open a file for which you do not have read permission, ST will open a blank buffer under the name of the protected file rather than the contents of the file. If you try to save this over the existing file, a dialogue window appears asking for your password. The file will be saved if you have an admin account, overwriting the contents of the file without you ever seeing it.
No "permission denied" message appears in the general GUI when opening the protected file.
Unable to open /path/to/file.ext
will be printed in the console, however, this is not obvious, and I only discovered this because I tried opening a file usingsudo
.Steps to reproduce
Expected behavior
When opening a read-protected file, ST should either
Actual behavior
When opening a read-protected file, ST does not obviously alert the user and does not allow the user to grant permission. Instead, ST launches a blank buffer with the same name as the protected file, allowing the user to believe that the protected file is empty when it is not. ST subsequently allows the user to save the blank, or newly filled buffer, over the protected file if the user has sudo rights.
Sublime Text build number
4143
Operating system & version
Linux Mint 20.3
(Linux) Desktop environment and/or window manager
Cinnamon 5.2.7
Additional information
No response
OpenGL context information
No response