mirror of
https://github.com/xcat2/confluent.git
synced 2025-01-17 21:23:18 +00:00
Fix sign of SO_PEERCRED
SO_PEERCRED uses ucred, where pid is signed and the other two are not. Accurately handle large uid/gid
This commit is contained in:
parent
09c5b90c57
commit
fa2b845b55
@ -248,8 +248,8 @@ def _unixdomainhandler():
|
||||
while True:
|
||||
cnn, addr = unixsocket.accept()
|
||||
creds = cnn.getsockopt(socket.SOL_SOCKET, SO_PEERCRED,
|
||||
struct.calcsize('3i'))
|
||||
pid, uid, gid = struct.unpack('3i', creds)
|
||||
struct.calcsize('iII'))
|
||||
pid, uid, gid = struct.unpack('iII', creds)
|
||||
skipauth = False
|
||||
if uid in (os.getuid(), 0):
|
||||
#this is where we happily accept the person
|
||||
|
Loading…
x
Reference in New Issue
Block a user