pmaports/unity8/platform-api/0002-Use-getenv-instead-of-secure_getenv.patch
Luca Weiss 8c2a95dbe2
unity8: initial packaging (!27)
* Mir starts up and is able to display system settings
* x86_64 only for now, because at least ubuntu-app-test did not build
  on aarch64

Based on PureTryOut's work. Getting it to this stage was a huge effort
(as it shows in the package count: 111(!)). See the merge request for
details.

[skip ci]: this won't finish in CI; ollieparanoid made sure that
           everything builds for x86_64.
2019-02-13 21:47:29 +01:00

48 lines
2 KiB
Diff

From 3e44a0e6b759f1cc5483e73efd9a3e50a276fdb3 Mon Sep 17 00:00:00 2001
From: Luca Weiss <luca@z3ntu.xyz>
Date: Sat, 12 Jan 2019 14:13:21 +0100
Subject: [PATCH 2/3] Use getenv instead of secure_getenv
---
src/bridge/bridge.h | 4 ++--
src/ubuntu/application/base_module.h | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/bridge/bridge.h b/src/bridge/bridge.h
index c972e6a..eafacbd 100644
--- a/src/bridge/bridge.h
+++ b/src/bridge/bridge.h
@@ -44,7 +44,7 @@ class HIDDEN_SYMBOL Bridge
void* resolve_symbol(const char* symbol, const char* module = "") const
{
- static const char* test_modules = secure_getenv("UBUNTU_PLATFORM_API_TEST_OVERRIDE");
+ static const char* test_modules = getenv("UBUNTU_PLATFORM_API_TEST_OVERRIDE");
if (test_modules && strstr(test_modules, module)) {
printf("Platform API: INFO: Overriding symbol '%s' with test version\n", symbol);
return Scope::dlsym_fn(lib_override_handle, symbol);
@@ -57,7 +57,7 @@ class HIDDEN_SYMBOL Bridge
Bridge()
: lib_handle(Scope::dlopen_fn(Scope::path(), RTLD_LAZY))
{
- if (Scope::override_path() && secure_getenv("UBUNTU_PLATFORM_API_TEST_OVERRIDE"))
+ if (Scope::override_path() && getenv("UBUNTU_PLATFORM_API_TEST_OVERRIDE"))
lib_override_handle = (Scope::dlopen_fn(Scope::override_path(), RTLD_LAZY));
}
diff --git a/src/ubuntu/application/base_module.h b/src/ubuntu/application/base_module.h
index 31522e3..379276b 100644
--- a/src/ubuntu/application/base_module.h
+++ b/src/ubuntu/application/base_module.h
@@ -47,7 +47,7 @@ struct HIDDEN_SYMBOL ToBackend
char module_name[32];
if (cache == NULL) {
- cache = secure_getenv("UBUNTU_PLATFORM_API_BACKEND");
+ cache = getenv("UBUNTU_PLATFORM_API_BACKEND");
if (cache == NULL) {
FILE *conf;
conf = fopen("/etc/ubuntu-platform-api/application.conf", "r");
--
2.20.1