Harden signed feeds and RelWithDebInfo releases
Modular container CI / release-build (push) Has been cancelled
Modular container CI / release-build (push) Has been cancelled
This commit is contained in:
21 files changed
+243
-40
No files matched your search
@@ -181,6 +181,7 @@ def validate(
|
||||
root: Path,
|
||||
maximum_glibc: tuple[int, ...] | None = None,
|
||||
forbidden_content_prefixes: tuple[bytes, ...] = (),
|
||||
require_debug_info: bool = False,
|
||||
) -> list[str]:
|
||||
executable = root / "bin/echoiond"
|
||||
updater = root / "bin/echoion-updater"
|
||||
@@ -225,6 +226,13 @@ def validate(
|
||||
re.MULTILINE,
|
||||
):
|
||||
raise ValueError(f"{relative} is not an x86-64 ELF")
|
||||
if require_debug_info:
|
||||
sections = command_output(["readelf", "-SW", os.fspath(path)])
|
||||
if re.search(r"\]\s+\.(?:z)?debug_info\s", sections) is None:
|
||||
raise ValueError(
|
||||
f"{relative} has no debug information; expected a "
|
||||
"RelWithDebInfo artifact"
|
||||
)
|
||||
dynamic = command_output(["readelf", "-dW", os.fspath(path)])
|
||||
runpaths = RUNPATH_PATTERN.findall(dynamic)
|
||||
if path in plugin_files:
|
||||
@@ -313,6 +321,11 @@ def main() -> int:
|
||||
parser.add_argument("--root", required=True, type=Path)
|
||||
parser.add_argument("--report", type=Path)
|
||||
parser.add_argument("--max-glibc", type=parse_version)
|
||||
parser.add_argument(
|
||||
"--require-debug-info",
|
||||
action="store_true",
|
||||
help="reject ELF payloads without DWARF debug information",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--forbid-content-prefix",
|
||||
action="append",
|
||||
@@ -334,6 +347,7 @@ def main() -> int:
|
||||
root,
|
||||
arguments.max_glibc,
|
||||
forbidden_content_prefixes,
|
||||
arguments.require_debug_info,
|
||||
)
|
||||
except (OSError, ValueError) as error:
|
||||
parser.error(str(error))
|
||||
|
||||
Reference in new issue
Block a user