Bug 1285768 - Let getppid() return 0 to simulate pid namespaces. r=gcp

This commit is contained in:
Julian Hector 2016-07-10 22:06:57 +02:00
Родитель dbede03dce
Коммит ea69125244
1 изменённых файлов: 10 добавлений и 0 удалений

Просмотреть файл

@ -404,6 +404,13 @@ class ContentSandboxPolicy : public SandboxPolicyCommon {
: broker->LStat(path, buf);
}
static intptr_t GetPPidTrap(ArgsRef aArgs, void* aux) {
// In a pid namespace, getppid() will return 0. We will return 0 instead
// of the real parent pid to see what breaks when we introduce the
// pid namespace (Bug 1151624).
return 0;
}
public:
explicit ContentSandboxPolicy(SandboxBrokerClient* aBroker):mBroker(aBroker) { }
virtual ~ContentSandboxPolicy() { }
@ -511,6 +518,9 @@ public:
switch (sysno) {
#ifdef DESKTOP
case __NR_getppid:
return Trap(GetPPidTrap, nullptr);
// Filesystem syscalls that need more work to determine who's
// using them, if they need to be, and what we intend to about it.
case __NR_mkdir: