]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Change to common source file not applicable to open-vm-tools.
authorJohn Wolfe <jwolfe@vmware.com>
Thu, 8 Sep 2022 21:51:40 +0000 (14:51 -0700)
committerJohn Wolfe <jwolfe@vmware.com>
Thu, 8 Sep 2022 21:51:40 +0000 (14:51 -0700)
open-vm-tools/lib/misc/idLinux.c

index 1bb86f483919d894a7d1d3408886f58f059c04f2..ab35df06db11b6ea7c2f2d1acec4b09d8f380344 100644 (file)
@@ -1,5 +1,5 @@
 /*********************************************************
- * Copyright (C) 1998-2019 VMware, Inc. All rights reserved.
+ * Copyright (C) 1998-2022 VMware, Inc. All rights reserved.
  *
  * 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
@@ -844,7 +844,7 @@ Id_AuthSet(void const *buf, // IN
  * Results:
  *      TRUE if the right was granted, FALSE if the user cancelled,
  *      entered the wrong password three times in a row, or if an
- *      error was encountered, or if the Authorization session is 
+ *      error was encountered, or if the Authorization session is
  *      invalid or has not been granted the 'right'.
  *
  * Side effects:
@@ -1045,10 +1045,23 @@ IdIsSetUGid(void)
 #else
    static const char envName[] = "VMW_SETUGID_TEST";
 
+   /*
+    * Solves issue where includes are taken from glibc-2.11 while libraries are being
+    * linked against glibc-2.31 for a rde-rft-rel app
+    */
+   extern __attribute__((weak)) char *__secure_getenv(const char *);
+   extern __attribute__((weak)) char *secure_getenv(const char *);
+
    if (setenv(envName, "1", TRUE) == -1) {
       return TRUE; /* Conservative */
    }
-   return __secure_getenv(envName) == NULL;
+   if (__secure_getenv != NULL) {
+      return __secure_getenv(envName) == NULL;
+   }
+   if (secure_getenv != NULL) {
+      return secure_getenv(envName) == NULL;
+   }
+   return TRUE;
 #endif
 #endif
 }