Sublime Forum

Saving a read-only file does not pop-up the "overwrite..." consistently

#1

Hi all,

(Similar post but didn’t particularly go anywhere)

Problem/Context

I need some help with troubleshooting this ?inconsistent issue of not having sublime pop-up of “overwriting” a read-only file. I am on RedHat Rhel 7.9, via VM.

I notice that Sublime 4 (Build 4143) has somewhat of a weird behavior when I try to save on a r--r--r-- file depending on different directory permissions and who owns the top-level directory with write-permissions.

The expected behavior is similar to Sublime 3, where if I made some edits to a read-only file and save, it would pop up something like:
image
And depending on cancel or not, it will save or not (as expected). Additionally, with the pop-up, the Sublime console would spit out the below errors if I press cancel:
image

However, in certain situations (the only thing I could pinpoint to is SGID permission where the top-level is not owned by myself), the behavior is unexpected. What happened was:

  1. I received a notification in my terminalimage
  2. Sublime’s “o” unsaved tab-symbol would turn to “x”, suggesting it was “saved” but in reality, no changes were actually saved.
  3. EDIT: after further checking, no “errors” in the console even appeared. Sublime 4 appears to just “kept going” as if nothing happened…

This became a huge problem in my workplace as users would think they’ve saved their changes and kept working, only to realize that on re-opening files, none of their edits were actually saved.

Help/Question

Is there a way to get Sublime 4 to behave like Sublime 3 again where it pops up the “overwrite…” every time?

Extra info

Permissions in successful cases

In below case, Sublime 4 works as expected (I own the directory structures, even when it has SGID set):
image

Permissions in unsuccessful cases

In below case, Sublime 4 behaves as described above with the unexpected behavior:
image

Much appreciated for the help and do let me know if more information is needed!

0 Likes

#2

Thanks, I’ve found an issue where we didn’t detect the pkexec command failing under certain conditions, we’ll be shipping a fix in the next build. This won’t actually fix it not working for you though.

Does a GUI admin check show up if you run pkexec bash? You could also try installing gksudo, which ST will prefer to use.

Note: The code in question that runs pkexec hasn’t changed since 2015, have you tried using ST3 to see if it does the same thing?

0 Likes