Candidate527b9a1e6(gander/row196-r6-prd19, basef48725cfc), the 39 manifest paths of CANDIDATE.sha256 537d30aef70b6cd1 atec1e7fad8. Duckworth approved round 1 outside B1/B2 (rev 2973, comment 30145) and round 2 merge-scoped (rev 2986, comment 30156). Gate gander-0066 on grant sage-2145: 2334 pass, 0 fail, 1 skip; mutants 38/38 killed. BUILD-LOG lines and Duckworth's C1 DEFERRED entry follow as a doc-only append.
15 lines
510 B
Python
15 lines
510 B
Python
"""Read only kernel credentials from an inherited accepted AF_UNIX stream."""
|
|
import json
|
|
import socket
|
|
import struct
|
|
import sys
|
|
|
|
try:
|
|
with socket.socket(fileno=3) as peer:
|
|
if peer.family != socket.AF_UNIX or peer.type != socket.SOCK_STREAM:
|
|
raise ValueError()
|
|
pid, uid, gid = struct.unpack("3i", peer.getsockopt(socket.SOL_SOCKET, socket.SO_PEERCRED, 12))
|
|
print(json.dumps({"pid": pid, "uid": uid, "gid": gid}, separators=(",", ":")))
|
|
except Exception:
|
|
sys.exit(2)
|