From: VMware, Inc <> Date: Wed, 18 Sep 2013 03:14:19 +0000 (-0700) Subject: HGFS: Fix the server to close sessions being invalidated X-Git-Tag: 2013.09.16-1328054~113 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=65d11e664ca3e3905f2afe102efa52a6122753d4;p=thirdparty%2Fopen-vm-tools.git HGFS: Fix the server to close sessions being invalidated When the HGFS server running in the tools is left with any sessions open due to the clients not terminating them cleanly they will be marked inactive. The HGFS server callback to invalidate them will periodically be called and after a brief period will terminate those sessions. These sessions are not closed first, thus triggering the assert in the session exit function which checks the session's state. Fix is to close the inactive sessions being terminated in the HGFS server invalidate callback. Signed-off-by: Dmitry Torokhov --- diff --git a/open-vm-tools/lib/hgfsServer/hgfsServer.c b/open-vm-tools/lib/hgfsServer/hgfsServer.c index b8eb50ad3..508867a31 100644 --- a/open-vm-tools/lib/hgfsServer/hgfsServer.c +++ b/open-vm-tools/lib/hgfsServer/hgfsServer.c @@ -4747,6 +4747,9 @@ HgfsServerSessionInvalidateInactiveSessions(void *clientData) // IN: if (session->isInactive) { if (session->numInvalidationAttempts == MAX_SESSION_INVALIDATION_ATTEMPTS) { + LOG(4, ("%s: closing inactive session %"FMT64"x\n", __FUNCTION__, + session->sessionId)); + session->state = HGFS_SESSION_STATE_CLOSED; HgfsServerTransportRemoveSessionFromList(transportSession, session); /*