klippy_connection: log raw peercred data on error
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
parent
0a0993f9e0
commit
835e49c10e
|
@ -233,13 +233,16 @@ class KlippyConnection:
|
||||||
"Unable to get Unix Socket, cant fetch peer credentials"
|
"Unable to get Unix Socket, cant fetch peer credentials"
|
||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
data: bytes = b""
|
||||||
try:
|
try:
|
||||||
data = sock.getsockopt(socket.SOL_SOCKET, socket.SO_PEERCRED, 12)
|
data = sock.getsockopt(socket.SOL_SOCKET, socket.SO_PEERCRED, 12)
|
||||||
pid, uid, gid = struct.unpack("@LLL", data)
|
pid, uid, gid = struct.unpack("@LLL", data)
|
||||||
except asyncio.CancelledError:
|
except asyncio.CancelledError:
|
||||||
raise
|
raise
|
||||||
except Exception:
|
except Exception:
|
||||||
logging.exception("Failed to get Klippy Credentials")
|
logging.exception(
|
||||||
|
f"Failed to get Klippy Peer Credentials, raw: 0x{data.hex()}"
|
||||||
|
)
|
||||||
return
|
return
|
||||||
self._peer_cred = {
|
self._peer_cred = {
|
||||||
"process_id": pid,
|
"process_id": pid,
|
||||||
|
|
Loading…
Reference in New Issue