]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Fix AliasSafeRenameFiles() in vgauth/serviceImpl/alias.c
authorOliver Kurth <okurth@vmware.com>
Thu, 3 Oct 2019 00:48:33 +0000 (17:48 -0700)
committerOliver Kurth <okurth@vmware.com>
Thu, 3 Oct 2019 00:48:33 +0000 (17:48 -0700)
If the alias mapfile was empty, the updated alias file was not properly
saved (renamed).  This issues has been fixed.

open-vm-tools/vgauth/serviceImpl/alias.c

index 83694e87674e474496e90752087e8dbd3b9c9ccf..5e2c008920cea857361f2e3dbdddfedcf0c8ede1 100644 (file)
@@ -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.
     */