Skip to content

Commit b6619b5

Browse files
authored
CA-401324: Update pvsproxy socket location (xapi-project#6098)
A previous commit changed the socket location to /run/pvsproxy but this is problematic because the pvsproxy daemon runs as a deprivileged user and cannot create the socket. Instead, update the path to a location that the daemon has permission to create. Add a fallback to the original path to cope with older pvsproxy daemons. This fallback can be removed in the future.
2 parents 07aeb76 + c0482fe commit b6619b5

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

ocaml/networkd/bin/network_server.ml

+13-2
Original file line numberDiff line numberDiff line change
@@ -1474,10 +1474,21 @@ end
14741474
module PVS_proxy = struct
14751475
open S.PVS_proxy
14761476

1477-
let path = ref "/run/pvsproxy"
1477+
let path = ref ""
1478+
1479+
let depriv_path = "/run/pvsproxy-state/socket"
1480+
1481+
let legacy_path = "/opt/citrix/pvsproxy/socket/pvsproxy"
1482+
1483+
let default_path () =
1484+
if Sys.file_exists depriv_path then
1485+
depriv_path
1486+
else
1487+
legacy_path
14781488

14791489
let do_call call =
1480-
try Jsonrpc_client.with_rpc ~path:!path ~call ()
1490+
let p = match !path with "" -> default_path () | path -> path in
1491+
try Jsonrpc_client.with_rpc ~path:p ~call ()
14811492
with e ->
14821493
error "Error when calling PVS proxy: %s" (Printexc.to_string e) ;
14831494
raise (Network_error PVS_proxy_connection_error)

0 commit comments

Comments
 (0)