diff --git a/docs/changelog.rst b/docs/changelog.rst index a62d2109c..ccac71b05 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -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] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/kitty/launch.py b/kitty/launch.py index bd26cef62..97135d720 100644 --- a/kitty/launch.py +++ b/kitty/launch.py @@ -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()