edit-in-kitty: Fix running edit-in-kitty with elevated privileges to edit a restricted file not working
This commit is contained in:
parent
79cd6f38fe
commit
474244268c
@ -57,6 +57,8 @@ Detailed list of changes
|
||||
- kitty +open: Ask for permission before executing script files that are not marked as executable. This prevents accidental execution
|
||||
of script files via MIME type association from programs that unconditionally "open" attachments/downloaded files.
|
||||
|
||||
- edit-in-kitty: Fix running edit-in-kitty with elevated privileges to edit a restricted file not working (:disc:`6245`)
|
||||
|
||||
0.28.1 [2023-04-21]
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
|
||||
@ -715,7 +715,7 @@ class EditCmd:
|
||||
self.is_local_file = False
|
||||
with suppress(OSError):
|
||||
st = os.stat(self.file_localpath)
|
||||
self.is_local_file = (st.st_dev, st.st_ino) == self.file_inode
|
||||
self.is_local_file = (st.st_dev, st.st_ino) == self.file_inode and os.access(self.file_localpath, os.W_OK | os.R_OK)
|
||||
if not self.is_local_file:
|
||||
import tempfile
|
||||
self.tdir = tempfile.mkdtemp()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user