image-info: read the system passwd for ostrees

When analyzing a ostree filesystem, also parse and add the system
passwd and group files.
This commit is contained in:
Christian Kellner 2020-06-08 19:20:25 +02:00 committed by Tom Gundersen
parent 0479bfc78a
commit ee240e2bf4

View file

@ -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: