From 85ba68b59cc63558bfd43988fb9b27740703afd6 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 9 Feb 2025 11:12:47 +0530 Subject: [PATCH] ssh kitten: When using python interpreter fix symlinks with absolute paths not working with the copy command --- shell-integration/ssh/bootstrap.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/shell-integration/ssh/bootstrap.py b/shell-integration/ssh/bootstrap.py index 58ba3df54..f21119d67 100644 --- a/shell-integration/ssh/bootstrap.py +++ b/shell-integration/ssh/bootstrap.py @@ -212,7 +212,10 @@ def get_data(): data = base64.standard_b64decode(data) with temporary_directory(dir=HOME, prefix='.kitty-ssh-kitten-untar-') as tdir, tarfile.open(fileobj=io.BytesIO(data)) as tf: try: - tf.extractall(tdir, filter='data') + # We have to use fully_trusted as otherwise it refuses to extract, + # for example, symlinks that point to absolute paths outside + # tdir. + tf.extractall(tdir, filter='fully_trusted') except TypeError: tf.extractall(tdir) with open(tdir + '/data.sh') as f: