summaryrefslogtreecommitdiffstats
path: root/ipc/chromium/src/base/process_util_linux.cc
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@gmail.com>2018-05-13 00:08:52 +0200
committerwolfbeast <mcwerewolf@gmail.com>2018-05-13 00:08:52 +0200
commite16bcd08aae85a7d9c2de5a4b1c733280cb81112 (patch)
tree220026724ceb8fbcf18bf627fde022c2d8df0e91 /ipc/chromium/src/base/process_util_linux.cc
parent6571d2ceb42930dab01677ef0e95e732d5076fb8 (diff)
downloadUXP-e16bcd08aae85a7d9c2de5a4b1c733280cb81112.tar
UXP-e16bcd08aae85a7d9c2de5a4b1c733280cb81112.tar.gz
UXP-e16bcd08aae85a7d9c2de5a4b1c733280cb81112.tar.lz
UXP-e16bcd08aae85a7d9c2de5a4b1c733280cb81112.tar.xz
UXP-e16bcd08aae85a7d9c2de5a4b1c733280cb81112.zip
Remove MOZ_WIDGET_GONK [2/2]
Tag #288
Diffstat (limited to 'ipc/chromium/src/base/process_util_linux.cc')
-rw-r--r--ipc/chromium/src/base/process_util_linux.cc45
1 files changed, 2 insertions, 43 deletions
diff --git a/ipc/chromium/src/base/process_util_linux.cc b/ipc/chromium/src/base/process_util_linux.cc
index 204017db5..57388ccb0 100644
--- a/ipc/chromium/src/base/process_util_linux.cc
+++ b/ipc/chromium/src/base/process_util_linux.cc
@@ -24,24 +24,13 @@
#include "prenv.h"
#include "prmem.h"
-#ifdef MOZ_WIDGET_GONK
/*
- * AID_APP is the first application UID used by Android. We're using
- * it as our unprivilegied UID. This ensure the UID used is not
- * shared with any other processes than our own childs.
- */
-# include <private/android_filesystem_config.h>
-# define CHILD_UNPRIVILEGED_UID AID_APP
-# define CHILD_UNPRIVILEGED_GID AID_APP
-#else
-/*
- * On platforms that are not gonk based, we fall back to an arbitrary
- * UID. This is generally the UID for user `nobody', albeit it is not
+ * On our platforms we use an arbitrary UID.
+ * This is generally the UID for user `nobody', albeit it is not
* always the case.
*/
# define CHILD_UNPRIVILEGED_UID 65534
# define CHILD_UNPRIVILEGED_GID 65534
-#endif
namespace {
@@ -229,36 +218,6 @@ void SetCurrentProcessPrivileges(ChildPrivileges privs) {
gid_t gid = CHILD_UNPRIVILEGED_GID;
uid_t uid = CHILD_UNPRIVILEGED_UID;
-#ifdef MOZ_WIDGET_GONK
- {
- static bool checked_pix_max, pix_max_ok;
- if (!checked_pix_max) {
- checked_pix_max = true;
- int fd = open("/proc/sys/kernel/pid_max", O_CLOEXEC | O_RDONLY);
- if (fd < 0) {
- DLOG(ERROR) << "Failed to open pid_max";
- _exit(127);
- }
- char buf[PATH_MAX];
- ssize_t len = read(fd, buf, sizeof(buf) - 1);
- close(fd);
- if (len < 0) {
- DLOG(ERROR) << "Failed to read pid_max";
- _exit(127);
- }
- buf[len] = '\0';
- int pid_max = atoi(buf);
- pix_max_ok =
- (pid_max + CHILD_UNPRIVILEGED_UID > CHILD_UNPRIVILEGED_UID);
- }
- if (!pix_max_ok) {
- DLOG(ERROR) << "Can't safely get unique uid/gid";
- _exit(127);
- }
- gid += getpid();
- uid += getpid();
- }
-#endif
if (setgid(gid) != 0) {
DLOG(ERROR) << "FAILED TO setgid() CHILD PROCESS";
_exit(127);