]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Change to common source file not applicable to open-vm-tools.
authorKaty Feng <fkaty@vmware.com>
Thu, 5 Oct 2023 17:35:26 +0000 (10:35 -0700)
committerKaty Feng <fkaty@vmware.com>
Thu, 5 Oct 2023 17:35:26 +0000 (10:35 -0700)
open-vm-tools/lib/hgfsServer/hgfsServer.c

index 1f7f2dbad1059bcc850c5ae5c59d480a2de2fe17..c7b4cdd0fc2520039b91761ab75b7daba9ff8b0c 100644 (file)
 #include "vm_basic_asm.h"
 #include "unicodeOperations.h"
 
+#ifndef VM_X86_ANY
+#include "random.h"
+#endif
+
 #if defined(_WIN32)
 #include <io.h>
 #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
 }