|
45 | 45 | PROXY_WS_TIMEOUT = envfloat("XPRA_PROXY_WS_TIMEOUT", 1.0)
|
46 | 46 | assert PROXY_SOCKET_TIMEOUT > 0, "invalid proxy socket timeout"
|
47 | 47 | CAN_STOP_PROXY = envbool("XPRA_CAN_STOP_PROXY", getuid() != 0 or WIN32)
|
48 |
| -STOP_PROXY_SOCKET_TYPES = os.environ.get("XPRA_STOP_PROXY_SOCKET_TYPES", "socket,named-pipe").split(",") |
| 48 | +STOP_PROXY_SOCKET_TYPES = os.environ.get("XPRA_STOP_PROXY_SOCKET_TYPES", "named-pipe").split(",") |
49 | 49 | STOP_PROXY_AUTH_SOCKET_TYPES = os.environ.get("XPRA_STOP_PROXY_AUTH_SOCKET_TYPES", "socket").split(",")
|
50 | 50 | # something (a thread lock?) doesn't allow us to use multiprocessing on MS Windows:
|
51 | 51 | PROXY_INSTANCE_THREADED = envbool("XPRA_PROXY_INSTANCE_THREADED", WIN32)
|
@@ -331,7 +331,10 @@ def handle_hello_request(self, request: str, proto, caps: typedict) -> bool:
|
331 | 331 | return False
|
332 | 332 |
|
333 | 333 | def handle_stop_request(self, proto) -> None:
|
334 |
| - default_can_stop = CAN_STOP_PROXY and get_socktype(proto) in STOP_PROXY_SOCKET_TYPES and proto.authenticators |
| 334 | + socktype = get_socktype(proto) |
| 335 | + default_can_stop = CAN_STOP_PROXY |
| 336 | + default_can_stop |= socktype in STOP_PROXY_SOCKET_TYPES |
| 337 | + default_can_stop |= (socktype in STOP_PROXY_AUTH_SOCKET_TYPES) and proto.authenticators |
335 | 338 | if not is_request_allowed(proto, "stop", default_can_stop):
|
336 | 339 | msg = "`stop` requests are not enabled for this proxy server connection"
|
337 | 340 | log.warn(f"Warning: {msg}")
|
|
0 commit comments