Sublime Forum

Sublime Ignores Permissions (Arch Linux)

#1

I’m sure I’m just missing something, but I’ve been looking at this for a day or so, and I’m not sure what it is…

I’ve been setting up my UEFI loader, which resides in a protected region on my drive (/boot/efi, owned by root:root with 755 permissions). Inevitably I’ve started up vim in a terminal a few times without root access and been notified that I don’t have write access, at which point I restart it with sudo.

However, sublime has absolutely no problem modifying any of those files when launched as my user. It just doesn’t care. Testcase:

  • Launch vim from a virtual console
    • Edit my boot configuration file
    • Try to save, get error E212: Can't open file for writing
  • Launch sublime from same console
    • Successfully make changes
  • View file permissions after edit – still no permissions
  • Re-launch vim
    • See sublime changes, but still can’t edit in vim

Additionally, I’ve opened KSysGuard (KDE’s process monitor) and verified that sublime was indeed launched as my user.

What am I missing?

0 Likes

#2

Okay, so apparently when sublime goes to save a file, it does so atomically – it makes a temporary file and copies it over the original. When it goes to execute cp, it does indeed lack permissions, and KDE intervenes to try to give it permissions.

However, my user didn’t have a password, so permissions were granted immediately, and without interaction.

Problem solved! (of course I think of this angle it after posting this…)

0 Likes

#3

FYI, there is a setting to control this behavior: "atomic_save": false

0 Likes

#4

That’s true – I’d forgotten about that.
Weirdly enough, it looks like it’s disabled by default, and I haven’t overridden it. There must be some other reason it’s deferring to cp

0 Likes

#5

Hmm, that is odd. I wonder if there is a fallback process if ST doesn’t have access to the file.

0 Likes

#6

There is indeed a separate mechanism for saving files with lacking permissions and that is through gksu. It’s not related to atmoic saving.

1 Like