From: Kruti Pendharkar Date: Tue, 24 Jun 2025 16:26:22 +0000 (-0700) Subject: Fail ServiceNetworkListen if g_unlink has an errno other than ENOENT X-Git-Tag: stable-13.1.0~156 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3dcc452c9bd7cdf0678ca0482c715c3cfcc054f5;p=thirdparty%2Fopen-vm-tools.git Fail ServiceNetworkListen if g_unlink has an errno other than ENOENT Change ServiceNetworkListen to fail if g_unlink fails for any reason other than that the entry being unlinked doesn't exist. --- diff --git a/open-vm-tools/vgauth/serviceImpl/netPosix.c b/open-vm-tools/vgauth/serviceImpl/netPosix.c index 62c93351a..ec878c8e3 100644 --- a/open-vm-tools/vgauth/serviceImpl/netPosix.c +++ b/open-vm-tools/vgauth/serviceImpl/netPosix.c @@ -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 */