mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-06 16:05:05 +02:00
Fix ssh kitten not working on FreeBSD
Apparently on FreeBSD one cannot unlink shared mem if it is not created with write permissions. Adding IWRITE to the permissions when creating the shared memory is harmless. It means any process running as the user can either write to the file or delete it. Deleting was already possible except on FreeBSD. As for writing, it's needed on FreeBSD for shared memory to be useable at all, and since processes running as the user can already completely access all their data, kitty config files, tty pipes, etc. allowing them to write to the SHM used here doesnt grant any significant new capability, since they could just write to ssh.conf in the kitty config folder to get the ssh kitten to do whatever they like. Fixes #5928
This commit is contained in:
@@ -95,6 +95,8 @@ Detailed list of changes
|
||||
|
||||
- Fix using :opt:`cursor` = ``none`` not working on text that has reverse video (:iss:`5897`)
|
||||
|
||||
- Fix ssh kitten not working on FreeBSD (:iss:`5928`)
|
||||
|
||||
|
||||
0.26.5 [2022-11-07]
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
@@ -83,7 +83,7 @@ def create_shared_memory(data: Any, prefix: str) -> str:
|
||||
|
||||
from kitty.shm import SharedMemory
|
||||
db = json.dumps(data).encode('utf-8')
|
||||
with SharedMemory(size=len(db) + SharedMemory.num_bytes_for_size, mode=stat.S_IREAD, prefix=prefix) as shm:
|
||||
with SharedMemory(size=len(db) + SharedMemory.num_bytes_for_size, prefix=prefix) as shm:
|
||||
shm.write_data_with_size(db)
|
||||
shm.flush()
|
||||
atexit.register(shm.unlink)
|
||||
|
||||
Reference in New Issue
Block a user