Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quelle  SandboxPrefBridge.cpp

  Sprache: C
 

/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/. */


#include "Sandbox.h"

#include "mozilla/Preferences.h"
#include "mozilla/SandboxSettings.h"
#include "mozilla/dom/ContentChild.h"
#include "mozilla/dom/ContentParent.h"  // for FILE_REMOTE_TYPE

namespace mozilla {

/* static */ ContentProcessSandboxParams
ContentProcessSandboxParams::ForThisProcess(
    const Maybe<ipc::FileDescriptor>& aBroker) {
  ContentProcessSandboxParams params;
  params.mLevel = GetEffectiveContentSandboxLevel();

  if (aBroker.isSome()) {
    auto fd = aBroker.value().ClonePlatformHandle();
    params.mBrokerFd = fd.release();
    // brokerFd < 0 means to allow direct filesystem access, so
    // make absolutely sure that doesn't happen if the parent
    // didn't intend it.
    MOZ_RELEASE_ASSERT(params.mBrokerFd >= 0);
  }
  // (Otherwise, mBrokerFd will remain -1 from the default ctor.)

  auto* cc = dom::ContentChild::GetSingleton();
  params.mFileProcess = cc->GetRemoteType() == FILE_REMOTE_TYPE;

  nsAutoCString extraSyscalls;
  nsresult rv = Preferences::GetCString(
      "security.sandbox.content.syscall_whitelist", extraSyscalls);
  if (NS_SUCCEEDED(rv)) {
    for (const nsACString& callNrString : extraSyscalls.Split(',')) {
      int callNr = PromiseFlatCString(callNrString).ToInteger(&rv);
      if (NS_SUCCEEDED(rv)) {
        params.mSyscallWhitelist.push_back(callNr);
      }
    }
  }

  return params;
}

/* static */ SocketProcessSandboxParams
SocketProcessSandboxParams::ForThisProcess(
    const Maybe<ipc::FileDescriptor>& aBroker) {
  SocketProcessSandboxParams self;

  if (aBroker.isSome()) {
    self.mBroker = aBroker->ClonePlatformHandle();
    MOZ_RELEASE_ASSERT(self.mBroker);
  }

  self.mLevel = GetEffectiveSocketProcessSandboxLevel();
  return self;
}

}  // namespace mozilla

Messung V0.5 in Prozent
C=87 H=67 G=77

¤ Dauer der Verarbeitung: 0.3 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik

Statistik
#Sources=277311
#Domains=752002