aboutsummaryrefslogtreecommitdiffstats
path: root/community/chromium/secure_getenv.patch
blob: 842a11532dbb6bb046e6cf667f6a1c8ec52882d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
--- ./third_party/angle/third_party/vulkan-loader/src/loader/loader.c.orig
+++ ./third_party/angle/third_party/vulkan-loader/src/loader/loader.c
@@ -37,6 +37,9 @@
 #include <CoreFoundation/CoreFoundation.h>
 #include <sys/param.h>
 #endif
+#if defined(HAVE_GETAUXVAL)
+#include <sys/auxv.h>
+#endif
 #include <sys/types.h>
 #if defined(_WIN32)
 #include "dirent_on_windows.h"
@@ -240,6 +243,8 @@
 #elif defined(HAVE___SECURE_GETENV)
     (void)inst;
     return __secure_getenv(name);
+#elif defined(HAVE_GETAUXVAL)
+    return getauxval(AT_SECURE) ? NULL : getenv(name);
 #else
 #pragma message(                                                                       \
     "Warning:  Falling back to non-secure getenv for environmental lookups!  Consider" \
--- ./third_party/angle/third_party/vulkan-loader/BUILD.gn.orig
+++ ./third_party/angle/third_party/vulkan-loader/BUILD.gn
@@ -264,8 +264,7 @@
     cflags = [ "/wd4201" ]
   }
   if (is_linux) {
-    # assume secure_getenv() is available
-    defines += [ "HAVE_SECURE_GETENV" ]
+    defines += [ "HAVE_GETAUXVAL" ]
   }
 }