From 9a7bc4a0e6b97c5c5548f250aa04eefac74313cc Mon Sep 17 00:00:00 2001 From: Stefan Tatschner Date: Fri, 28 Oct 2022 11:14:18 +0200 Subject: [PATCH] fix: Error out if dumpcap is enabled but not available --- src/gallia/command/base.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gallia/command/base.py b/src/gallia/command/base.py index bf3e0b1ac..3c77ac813 100644 --- a/src/gallia/command/base.py +++ b/src/gallia/command/base.py @@ -6,6 +6,7 @@ import asyncio import fcntl import os +import shutil import signal import sys import traceback @@ -495,6 +496,8 @@ async def setup(self, args: Namespace) -> None: # Start dumpcap as the first subprocess; otherwise network # traffic might be missing. if args.dumpcap: + if shutil.which("dumpcap") is None: + self.parser.error("--dumpcap specified but `dumpcap` is not available") self.dumpcap = await Dumpcap.start(args.target, self.artifacts_dir) await self.dumpcap.sync()