summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--rild/rild.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/rild/rild.c b/rild/rild.c
index 65be7e0..34ed42d 100644
--- a/rild/rild.c
+++ b/rild/rild.c
@@ -96,6 +96,8 @@ static int make_argv(char * args, char ** argv)
* Our group, cache, was set by init.
*/
void switchUser() {
+ char debuggable[PROP_VALUE_MAX];
+
prctl(PR_SET_KEEPCAPS, 1, 0, 0, 0);
setuid(AID_RADIO);
@@ -117,6 +119,15 @@ void switchUser() {
RLOGE("capset failed: %s", strerror(errno));
exit(EXIT_FAILURE);
}
+
+ /*
+ * Debuggable build only:
+ * Set DUMPABLE that was cleared by setuid() to have tombstone on RIL crash
+ */
+ property_get("ro.debuggable", debuggable, "0");
+ if (strcmp(debuggable, "1") == 0) {
+ prctl(PR_SET_DUMPABLE, 1, 0, 0, 0);
+ }
}
int main(int argc, char **argv)