Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions testsuite/daemon-early-exec-nameconv_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,12 @@ def script(name, body):
# the incoming id is NON-zero, so the source tree needs a non-root owner.
# Pick any non-root passwd entry that exists in this environment; skip the
# name-converter half if there isn't one (or we can't chown).
nonroot = next((p for p in pwd.getpwall() if p.pw_uid != 0 and p.pw_gid != 0), None)
if not owners_supported() or nonroot is None:
# Account enumeration may block on network name services. It is unnecessary
# when the existing ownership-capability check already excludes this half.
nonroot = None
if owners_supported():
nonroot = next((p for p in pwd.getpwall() if p.pw_uid != 0 and p.pw_gid != 0), None)
if nonroot is None:
print("daemon-early-exec-nameconv: early-exec ok; "
"name-converter SKIPPED (no non-root passwd entry / cannot chown)")
raise SystemExit(0)
Expand Down