4cf60e
diff -up mozilla-aurora/security/sandbox/linux/broker/SandboxBroker.cpp.build-sandbox mozilla-aurora/security/sandbox/linux/broker/SandboxBroker.cpp
4cf60e
--- mozilla-aurora/security/sandbox/linux/broker/SandboxBroker.cpp.build-sandbox	2015-12-16 16:47:02.000000000 +0100
4cf60e
+++ mozilla-aurora/security/sandbox/linux/broker/SandboxBroker.cpp	2016-01-21 15:34:59.168878105 +0100
4cf60e
@@ -201,7 +201,7 @@ AllowAccess(int aReqFlags, int aPerms)
4cf60e
 // on this process.  These shouldn't be relevant to the child process
4cf60e
 // in any case due to the sandboxing restrictions on it.  (See also
4cf60e
 // the use of MSG_CMSG_CLOEXEC in SandboxBrokerCommon.cpp).
4cf60e
-static const int kRequiredOpenFlags = O_CLOEXEC | O_NOCTTY;
4cf60e
+static const int kRequiredOpenFlags = O_NOCTTY;
4cf60e
 
4cf60e
 // Linux originally assigned a flag bit to O_SYNC but implemented the
4cf60e
 // semantics standardized as O_DSYNC; later, that bit was renamed and
4cf60e
@@ -212,7 +212,7 @@ static const int kRequiredOpenFlags = O_
4cf60e
 static const int kAllowedOpenFlags =
4cf60e
   O_APPEND | O_ASYNC | O_DIRECT | O_DIRECTORY | O_EXCL | O_LARGEFILE
4cf60e
   | O_NOATIME | O_NOCTTY | O_NOFOLLOW | O_NONBLOCK | O_NDELAY | O_SYNC_NEW
4cf60e
-  | O_TRUNC | O_CLOEXEC | O_CREAT;
4cf60e
+  | O_TRUNC | O_CREAT;
4cf60e
 #undef O_SYNC_NEW
4cf60e
 
4cf60e
 static bool
4cf60e
@@ -358,6 +358,7 @@ SandboxBroker::ThreadMain(void)
4cf60e
           // new ones).
4cf60e
           openedFd = open(pathBuf, req.mFlags | kRequiredOpenFlags, 0600);
4cf60e
           if (openedFd >= 0) {
4cf60e
+            fcntl(openedFd, F_SETFD, fcntl(openedFd, F_GETFD, 0) | FD_CLOEXEC);
4cf60e
             resp.mError = 0;
4cf60e
           } else {
4cf60e
             resp.mError = errno;
4cf60e
diff -up mozilla-aurora/security/sandbox/linux/SandboxBrokerClient.cpp.build-sandbox mozilla-aurora/security/sandbox/linux/SandboxBrokerClient.cpp
4cf60e
--- mozilla-aurora/security/sandbox/linux/SandboxBrokerClient.cpp.build-sandbox	2016-01-21 15:48:55.807532739 +0100
4cf60e
+++ mozilla-aurora/security/sandbox/linux/SandboxBrokerClient.cpp	2016-01-21 15:49:26.163518779 +0100
4cf60e
@@ -149,9 +149,10 @@ SandboxBrokerClient::Open(const char* aP
4cf60e
   int maybeFd = DoCall(&req, aPath, nullptr, true);
4cf60e
   if (maybeFd >= 0) {
4cf60e
     // NSPR has opinions about file flags.  Fix O_CLOEXEC.
4cf60e
-    if ((aFlags & O_CLOEXEC) == 0) {
4cf60e
-      fcntl(maybeFd, F_SETFD, 0);
4cf60e
-    }
4cf60e
+    // O_CLOEXEC is not available in RHEL5
4cf60e
+    //if ((aFlags & O_CLOEXEC) == 0) {
4cf60e
+    //  fcntl(maybeFd, F_SETFD, 0);
4cf60e
+    //}
4cf60e
   }
4cf60e
   return maybeFd;
4cf60e
 }