mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2025-12-12 01:00:29 +08:00
usc allowed for docker
This commit is contained in:
parent
0437f487b5
commit
79d4d99f37
@ -288,7 +288,7 @@ class RequestUnixCredentials:
|
|||||||
gid: int
|
gid: int
|
||||||
|
|
||||||
def __post_init__(self) -> None:
|
def __post_init__(self) -> None:
|
||||||
assert self.pid > 0
|
assert self.pid >= 0
|
||||||
assert self.uid >= 0
|
assert self.uid >= 0
|
||||||
assert self.gid >= 0
|
assert self.gid >= 0
|
||||||
|
|
||||||
@ -304,7 +304,8 @@ def get_request_unix_credentials(req: BaseRequest) -> (RequestUnixCredentials |
|
|||||||
except Exception:
|
except Exception:
|
||||||
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
|
||||||
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