]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Fail ServiceNetworkListen if g_unlink has an errno other than ENOENT
authorKruti Pendharkar <kp025370@broadcom.com>
Tue, 24 Jun 2025 16:26:22 +0000 (09:26 -0700)
committerKruti Pendharkar <kp025370@broadcom.com>
Tue, 24 Jun 2025 16:26:22 +0000 (09:26 -0700)
Change ServiceNetworkListen to fail if g_unlink fails for any reason
other than that the entry being unlinked doesn't exist.

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

index 62c93351a644068e758fd0357917ea5f60c5627f..ec878c8e34a0abebbd901fb6b4bfe90cd0e4f27d 100644 (file)
@@ -1,5 +1,6 @@
 /*********************************************************
- * Copyright (c) 2011-2017, 2019-2022 VMware, Inc. All rights reserved.
+ * Copyright (c) 2011-2025 Broadcom. All Rights Reserved.
+ * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU Lesser General Public License as published
@@ -153,8 +154,10 @@ ServiceNetworkListen(ServiceConnection *conn,            // IN/OUT
 
    ret = g_unlink(conn->pipeName);
    if (ret < 0 && errno != ENOENT) {
-      Warning("%s: unlink(%s) failed, %d - continuing\n", __FUNCTION__,
-              conn->pipeName, errno);
+      err = VGAUTH_E_COMM;
+      Warning("%s: unlink(%s) failed, %d\n", __FUNCTION__, conn->pipeName,
+              errno);
+      goto quit;
    }
 
    /* Ignore return, returns the length of the source string */