From: Daan De Meyer Date: Fri, 23 Feb 2024 11:08:56 +0000 (+0100) Subject: Limit ephemeral filename length X-Git-Tag: v21~27 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=814f8280dd1047b96384cc1f437deaf397bb8aba;p=thirdparty%2Fmkosi.git Limit ephemeral filename length --- diff --git a/mkosi/qemu.py b/mkosi/qemu.py index c03500322..6efcdff9d 100644 --- a/mkosi/qemu.py +++ b/mkosi/qemu.py @@ -438,8 +438,9 @@ def vsock_notify_handler() -> Iterator[tuple[str, dict[str, str]]]: def copy_ephemeral(config: Config, src: Path) -> Iterator[Path]: src = src.resolve() # tempfile doesn't provide an API to get a random filename in an arbitrary directory so we do this - # instead. - tmp = src.parent / f"{src.name}-{uuid.uuid4().hex}" + # instead. Limit the size to 16 characters as the output name might be used in a unix socket path by vmspawn and + # needs to fit in 108 characters. + tmp = src.parent / f"{src.name}-{uuid.uuid4().hex[:16]}" try: def copy() -> None: