From: Oliver Kurth Date: Fri, 15 Sep 2017 18:23:31 +0000 (-0700) Subject: Specify the proper size while sending deploypkg.update.state RPC message. X-Git-Tag: stable-10.2.0~286 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=488aea219340e6821b25fb4240791fa9e7903023;p=thirdparty%2Fopen-vm-tools.git Specify the proper size while sending deploypkg.update.state RPC message. 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. --- diff --git a/open-vm-tools/services/plugins/deployPkg/deployPkg.c b/open-vm-tools/services/plugins/deployPkg/deployPkg.c index 5df1367d0..f5479400f 100644 --- a/open-vm-tools/services/plugins/deployPkg/deployPkg.c +++ b/open-vm-tools/services/plugins/deployPkg/deployPkg.c @@ -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__); }