mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2025-12-14 02:00:32 +08:00
note about pid==0 in get_request_unix_credentials()
This commit is contained in:
parent
46ef5fd46b
commit
d630e24aa0
@ -305,7 +305,7 @@ def get_request_unix_credentials(req: BaseRequest) -> (RequestUnixCredentials |
|
|||||||
return None
|
return None
|
||||||
(pid, uid, gid) = struct.unpack("iii", data)
|
(pid, uid, gid) = struct.unpack("iii", data)
|
||||||
if pid < 0 or uid < 0 or gid < 0:
|
if pid < 0 or uid < 0 or gid < 0:
|
||||||
# PID == 0 inside a docker container
|
# PID == 0 when the client is outside of server's PID namespace, e.g. when kvmd runs in a container
|
||||||
return None
|
return None
|
||||||
return RequestUnixCredentials(pid=pid, uid=uid, gid=gid)
|
return RequestUnixCredentials(pid=pid, uid=uid, gid=gid)
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user