From: Oliver Kurth Date: Thu, 3 Oct 2019 00:48:33 +0000 (-0700) Subject: Fix AliasSafeRenameFiles() in vgauth/serviceImpl/alias.c X-Git-Tag: stable-11.1.0~219 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=393336967fdf8ed16821fbdc16732c96197ebc49;p=thirdparty%2Fopen-vm-tools.git Fix AliasSafeRenameFiles() in vgauth/serviceImpl/alias.c If the alias mapfile was empty, the updated alias file was not properly saved (renamed). This issues has been fixed. --- diff --git a/open-vm-tools/vgauth/serviceImpl/alias.c b/open-vm-tools/vgauth/serviceImpl/alias.c index 83694e876..5e2c00892 100644 --- a/open-vm-tools/vgauth/serviceImpl/alias.c +++ b/open-vm-tools/vgauth/serviceImpl/alias.c @@ -2234,7 +2234,10 @@ updateMap: Debug("%s: removed empty map file '%s'\n", __FUNCTION__, mapFilename); g_free(mapFilename); - goto done; + if (emptyAliasFile) { + goto done; + } + goto rename; } tmpMapFilename = g_strdup_printf("%s"DIRSEP"%sXXXXXX", @@ -2328,6 +2331,7 @@ updateMap: #endif } +rename: /* * Make the tmpfiles become the real in a way we can try to recover from. */