From c86e1af750b3ff2828cf84a3f0dffcbf1ec0c6b9 Mon Sep 17 00:00:00 2001 From: Jarrod Johnon Date: Tue, 13 Jan 2015 15:01:55 -0500 Subject: [PATCH] Try to use socket to get SO_PEERCRED Newer socket includes SO_PEERCRED. Try to use that before resorting to the 17 assumption. --- confluent_server/confluent/sockapi.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/confluent_server/confluent/sockapi.py b/confluent_server/confluent/sockapi.py index 1427f0c4..4b4fa215 100644 --- a/confluent_server/confluent/sockapi.py +++ b/confluent_server/confluent/sockapi.py @@ -42,7 +42,10 @@ import confluent.core as pluginapi tracelog = None auditlog = None -SO_PEERCRED = 17 +try: + SO_PEERCRED = socket.SO_PEERCRED +except AttributeError: + SO_PEERCRED = 17 class ClientConsole(object):