The bootstrap script extracted the tarball with umask 000, so tar
created any directories not present in the tarball, such as ~/.terminfo
and the ssh kitten data directory, with mode 0777. Since tar is run with
-p, the permissions of entries in the tarball are already restored
exactly, so the umask override is unnecessary. Remove it so that
directories not in the tarball respect the user's umask, matching the
behavior of bootstrap.py.
Fixes#10834Closes#10835
The archive reused the metadata of the top level directory for all nested
directories and both bootstrap implementations recreated directories with
the remote umask.
Stat every directory when building the archive, passing the stat result
explicitly to the header callback and skipping directories that vanish or
are replaced by something else while being copied.
When deploying, move directories not present at the destination intact,
replacing any dangling symlink or file in the way, and merge into existing
directories keeping their permissions. The shell implementation falls back
to creating the directory and merging if the move fails. Make the
temporary directory deletable before removing it as copied directories can
lack write or search permission.
Closes#10727
Since coreutils 9.12, env shell-quotes values written to a terminal
by default (a pty counts as one, see coreutils issue #355 for the
history: https://github.com/coreutils/coreutils/issues/355).
This makes the literal, unquoted match for TSET= in
test_ssh_env_vars no longer find the value, so the test times out
waiting for it and eventually surfaces as an EIO reading from the pty
once the child has already exited. Accept the shlex-quoted form of
the value as well, since the ssh kitten's own env-passing code does
not use env and is unaffected.
Observed failure (Fedora rawhide buildroot with coreutils-9.12-1.fc46):
======================================================================
ERROR: test_ssh_env_vars (kitty_tests.ssh.SSHKitten.test_ssh_env_vars)
----------------------------------------------------------------------
Traceback (most recent call last):
File "kitty_tests/__init__.py", line 461, in wait_till
self.process_input_from_child(timeout=end_time - time.monotonic())
File "kitty_tests/__init__.py", line 449, in process_input_from_child
data = os.read(self.master_fd, io.DEFAULT_BUFFER_SIZE)
OSError: [Errno 5] Input/output error
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "kitty_tests/__init__.py", line 250, in wrapper
return func(*args, **kwargs)
File "kitty_tests/ssh.py", line 146, in test_ssh_env_vars
pty.wait_till(lambda: 'TSET={}'.format(tset.replace('$A', 'AAA')) in pty.screen_contents())
File "kitty_tests/__init__.py", line 464, in wait_till
raise Exception(f'Failed to read from pty with error: {e}. {self.screen_contents_for_error()}') from e
Exception: Failed to read from pty with error: [Errno 5] Input/output error. Screen contents as repr:
'...\nA=AAA\nTSET=\'AAA-$(echo no)-`echo no2` !Q5 "something else"\'\n...'
Ran 337 tests in 19.341s
FAILED (errors=1, skipped=3)
Assisted-By: Claude Sonnet 5
It's easier to type, and cuter.
Also, most, if not all of the TUI parts of
kitty's kittens will eventually be re-written into kitten.
The only downside I can see is that we cant tab complete kitty
anymore, but hopefully there will be less reason to run kitty
from the shell as command line tools migrate to kitten.
Meowrrrr!!!