]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
ToolsCore_InitVsockFamily() must tolerate the lack of an RPC channel
authorOliver Kurth <okurth@vmware.com>
Fri, 15 Sep 2017 18:22:53 +0000 (11:22 -0700)
committerOliver Kurth <okurth@vmware.com>
Fri, 15 Sep 2017 18:22:53 +0000 (11:22 -0700)
when the backdoor has been disabled.

open-vm-tools/services/vmtoolsd/toolsRpc.c

index ad3542c843a9c4e61b211cc6619aa67e99432b40..a015a4abfca9e824b71c616314aaa77265da3aff 100644 (file)
@@ -423,11 +423,18 @@ ToolsCore_InitVsockFamily(ToolsServiceState *state)
    int vsockDev = -1;
 
    ASSERT(state);
-   ASSERT(state->ctx.rpc);
 
    state->vsockDev = -1;
    state->vsockFamily = -1;
 
+   if (!state->ctx.rpc) {
+      /*
+       * Nothing more to do when there is no RPC channel.
+       */
+      g_debug("No RPC channel; skipping reference to vSocket family.\n");
+      return TRUE;
+   }
+
    switch (RpcChannel_GetType(state->ctx.rpc)) {
    case RPCCHANNEL_TYPE_INACTIVE:
    case RPCCHANNEL_TYPE_PRIV_VSOCK:
@@ -467,7 +474,6 @@ void
 ToolsCore_ReleaseVsockFamily(ToolsServiceState *state)
 {
    ASSERT(state);
-   ASSERT(state->ctx.rpc);
 
    if (state->vsockFamily >= 0) {
       ASSERT(state->vsockDev >= 0);