b55e177816
OBS-URL: https://build.opensuse.org/package/show/Virtualization/libvirt?expand=0&rev=3edde9bf7d8e38f0fe238af7b554d82a
41 lines
1.8 KiB
Diff
41 lines
1.8 KiB
Diff
Index: libvirt-0.8.0/src/remote/remote_driver.c
|
|
===================================================================
|
|
--- libvirt-0.8.0.orig/src/remote/remote_driver.c
|
|
+++ libvirt-0.8.0/src/remote/remote_driver.c
|
|
@@ -768,12 +768,29 @@ doRemoteOpen (virConnectPtr conn,
|
|
cmd_argv[j++] = strdup ("none");
|
|
}
|
|
cmd_argv[j++] = strdup (priv->hostname);
|
|
- cmd_argv[j++] = strdup (netcat ? netcat : "nc");
|
|
- cmd_argv[j++] = strdup ("-U");
|
|
- cmd_argv[j++] = strdup (sockname ? sockname :
|
|
- (flags & VIR_CONNECT_RO
|
|
- ? LIBVIRTD_PRIV_UNIX_SOCKET_RO
|
|
- : LIBVIRTD_PRIV_UNIX_SOCKET));
|
|
+ if (netcat) {
|
|
+ cmd_argv[j++] = strdup (netcat);
|
|
+ cmd_argv[j++] = strdup ("-U");
|
|
+ cmd_argv[j++] = strdup (sockname ? sockname :
|
|
+ (flags & VIR_CONNECT_RO
|
|
+ ? LIBVIRTD_PRIV_UNIX_SOCKET_RO
|
|
+ : LIBVIRTD_PRIV_UNIX_SOCKET));
|
|
+ } else {
|
|
+ cmd_argv[j++] = strdup ("socat");
|
|
+ cmd_argv[j++] = strdup ("-");
|
|
+
|
|
+ char *socat_addr = NULL;
|
|
+ if ((asprintf (&socat_addr, "GOPEN:%s",
|
|
+ sockname ? sockname :
|
|
+ (flags & VIR_CONNECT_RO
|
|
+ ? LIBVIRTD_PRIV_UNIX_SOCKET_RO
|
|
+ : LIBVIRTD_PRIV_UNIX_SOCKET))) < 0) {
|
|
+ error (conn, VIR_ERR_SYSTEM_ERROR, strerror (ENOMEM));
|
|
+ goto failed;
|
|
+ }
|
|
+ cmd_argv[j++] = strdup (socat_addr);
|
|
+ VIR_FREE(socat_addr);
|
|
+ }
|
|
cmd_argv[j++] = 0;
|
|
assert (j == nr_args);
|
|
for (j = 0; j < (nr_args-1); j++)
|