From ee240e2bf43d69a61e3cf9a81a20c59eae6e8a4c Mon Sep 17 00:00:00 2001 From: Christian Kellner Date: Mon, 8 Jun 2020 19:20:25 +0200 Subject: [PATCH] image-info: read the system passwd for ostrees When analyzing a ostree filesystem, also parse and add the system passwd and group files. --- tools/image-info | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tools/image-info b/tools/image-info index 4293ec470..30567a042 100755 --- a/tools/image-info +++ b/tools/image-info @@ -248,6 +248,13 @@ def append_filesystem(report, tree, *, is_ostree=False): with open(f"{tree}/etc/group") as f: report["groups"] = sorted(f.read().strip().split("\n")) + if is_ostree: + with open(f"{tree}/usr/lib/passwd") as f: + report["passwd-system"] = sorted(f.read().strip().split("\n")) + + with open(f"{tree}/usr/lib/group") as f: + report["groups-system"] = sorted(f.read().strip().split("\n")) + if os.path.exists(f"{tree}/boot") and len(os.listdir(f"{tree}/boot")) > 0: assert "bootmenu" not in report try: