]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Specify the proper size while sending deploypkg.update.state RPC message.
authorOliver Kurth <okurth@vmware.com>
Fri, 15 Sep 2017 18:23:31 +0000 (11:23 -0700)
committerOliver Kurth <okurth@vmware.com>
Fri, 15 Sep 2017 18:23:31 +0000 (11:23 -0700)
Due to a recent change, the VMX handler for 'deployPkg.update.state' RPC
ignores the message if the specified argument size doesn't match with
the string size.

In the current code, in a certain error code path, deploypkg plugin
specifies one extra byte in the size for 'deploypkg.update.size' RPC
message.  This results in an error at the VMX layer.

Fixed the code to specify the proper string length while sending the RPC.

open-vm-tools/services/plugins/deployPkg/deployPkg.c

index 5df1367d0478420d6da4c2135ae4212720e25d7b..f5479400f1d254d89bdb3f528a4a65af773222b2 100644 (file)
@@ -180,7 +180,7 @@ DeployPkg_TcloDeploy(RpcInData *data)  // IN
 
    msg = g_strdup_printf("deployPkg.update.state %d",
                          TOOLSDEPLOYPKG_DEPLOYING);
-   if (!RpcChannel_Send(ctx->rpc, msg, strlen(msg) + 1, NULL, NULL)) {
+   if (!RpcChannel_Send(ctx->rpc, msg, strlen(msg), NULL, NULL)) {
       g_warning("%s: failed update state to TOOLSDEPLOYPKG_DEPLOYING\n",
                 __FUNCTION__);
    }
@@ -204,7 +204,7 @@ DeployPkg_TcloDeploy(RpcInData *data)  // IN
                             TOOLSDEPLOYPKG_DEPLOYING,
                             TOOLSDEPLOYPKG_ERROR_DEPLOY_FAILED,
                             pkgStart);
-      if (!RpcChannel_Send(ctx->rpc, msg, strlen(msg) + 1, NULL, NULL)) {
+      if (!RpcChannel_Send(ctx->rpc, msg, strlen(msg), NULL, NULL)) {
          g_warning("%s: failed update state to TOOLSDEPLOYPKG_DEPLOYING\n",
                    __FUNCTION__);
       }
@@ -220,7 +220,7 @@ DeployPkg_TcloDeploy(RpcInData *data)  // IN
                             TOOLSDEPLOYPKG_DEPLOYING,
                             TOOLSDEPLOYPKG_ERROR_DEPLOY_FAILED,
                             errMsg);
-      if (!RpcChannel_Send(ctx->rpc, msg, strlen(msg) + 1, NULL, NULL)) {
+      if (!RpcChannel_Send(ctx->rpc, msg, strlen(msg), NULL, NULL)) {
          g_warning("%s: failed update state to TOOLSDEPLOYPKG_DEPLOYING\n",
                    __FUNCTION__);
       }