From: Katy Feng Date: Fri, 25 Aug 2023 18:58:48 +0000 (-0700) Subject: Change to common source file not applicable to open-vm-tools. X-Git-Tag: stable-12.3.0~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8e2c1ae33923b700cd26a8e17c2d74bb355d39dd;p=thirdparty%2Fopen-vm-tools.git Change to common source file not applicable to open-vm-tools. --- diff --git a/open-vm-tools/lib/hgfsServer/hgfsServer.c b/open-vm-tools/lib/hgfsServer/hgfsServer.c index 1f7f2dbad..c7b4cdd0f 100644 --- a/open-vm-tools/lib/hgfsServer/hgfsServer.c +++ b/open-vm-tools/lib/hgfsServer/hgfsServer.c @@ -56,6 +56,10 @@ #include "vm_basic_asm.h" #include "unicodeOperations.h" +#ifndef VM_X86_ANY +#include "random.h" +#endif + #if defined(_WIN32) #include #define HGFS_PARENT_DIR "..\\" @@ -4159,7 +4163,16 @@ HgfsServer_ShareAccessCheck(HgfsOpenMode accessMode, // IN: open mode to check static uint64 HgfsGenerateSessionId(void) { +#ifdef VM_X86_ANY return RDTSC(); +#else + uint64 sessionId; + rqContext *rCtx = Random_QuickSeed((uint32)time(NULL)); + sessionId = (uint64)Random_Quick(rCtx) << 32; + sessionId |= Random_Quick(rCtx); + free(rCtx); + return sessionId; +#endif }