summaryrefslogtreecommitdiff
path: root/recipes/glib/0012-gutils-Don-t-use-issetugid-on-Android.patch
blob: be8544f3defb5b75318162defbc3e182c96eaf82 (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
34
35
36
37
From 012717f32c16596246d12fd70b26a58153ecaea5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= <sebastian@centricular.com>
Date: Tue, 9 Sep 2014 20:18:20 +0200
Subject: [PATCH] gutils: Don't use issetugid() on Android

Android had it in older versions but the new 64 bit ABI does not
have it anymore, and some versions of the 32 bit ABI neither.

https://code.google.com/p/android-developer-preview/issues/detail?id=168

https://bugzilla.gnome.org/show_bug.cgi?id=736351
---
 glib/gutils.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/glib/gutils.c b/glib/gutils.c
index 8fd045a..e229d0d 100644
--- a/glib/gutils.c
+++ b/glib/gutils.c
@@ -2330,8 +2330,13 @@ g_check_setuid (void)
     extern int __libc_enable_secure;
     return __libc_enable_secure;
   }
-#elif defined(HAVE_ISSETUGID)
+#elif defined(HAVE_ISSETUGID) && !defined(__BIONIC__)
   /* BSD: http://www.freebsd.org/cgi/man.cgi?query=issetugid&sektion=2 */
+
+  /* Android had it in older versions but the new 64 bit ABI does not
+   * have it anymore, and some versions of the 32 bit ABI neither.
+   * https://code.google.com/p/android-developer-preview/issues/detail?id=168
+   */
   return issetugid ();
 #elif defined(G_OS_UNIX)
   uid_t ruid, euid, suid; /* Real, effective and saved user ID's */
-- 
2.1.0