S108: ignore our uses

This commit is contained in:
Jörg Thalheim
2025-08-20 16:06:56 +02:00
parent 136acc7901
commit 0a70ed6268
5 changed files with 6 additions and 6 deletions

View File

@@ -139,7 +139,7 @@ class Remote:
if sys.platform == "darwin" and os.environ.get("TMPDIR", "").startswith(
"/var/folders/",
):
directory = "/tmp/"
directory = "/tmp/" # noqa: S108 - Required on macOS due to bugs with default TMPDIR
with TemporaryDirectory(prefix="clan-ssh", dir=directory) as temp_dir:
remote = Remote(
address=self.address,

View File

@@ -33,7 +33,7 @@ def upload(
# Exceptions: Allow depth 2 if the path starts with /tmp/, /root/, or /etc/.
# This allows destinations like /tmp/mydir or /etc/conf.d, but not /tmp or /etc directly.
is_allowed_exception = depth >= 2 and (
str(remote_dest).startswith("/tmp/")
str(remote_dest).startswith("/tmp/") # noqa: S108 - Path validation check
or str(remote_dest).startswith("/root/")
or str(remote_dest).startswith("/etc/")
)