| Index: sandbox/linux/seccomp-bpf/util.cc
|
| diff --git a/sandbox/linux/seccomp-bpf/util.cc b/sandbox/linux/seccomp-bpf/util.cc
|
| index 77a92d9091439127c2fce90dcaea98ef937a1da7..e84e1900dc5a5bcb865338f4a04e3057f3855c06 100644
|
| --- a/sandbox/linux/seccomp-bpf/util.cc
|
| +++ b/sandbox/linux/seccomp-bpf/util.cc
|
| @@ -115,10 +115,12 @@ bool Util::GetFds(int transport, void *buf, size_t *len, ...) {
|
| return true;
|
| }
|
|
|
| -void Util::CloseAllBut(int fd, ...) {
|
| - int proc_fd;
|
| +void Util::CloseAllBut(int proc_fd, int fd, ...) {
|
| int fdir;
|
| - if ((proc_fd = Sandbox::proc_fd()) < 0 ||
|
| + if (proc_fd < 0) {
|
| + proc_fd = open("/proc/", O_RDONLY|O_DIRECTORY);
|
| + }
|
| + if (proc_fd < 0 ||
|
| (fdir = openat(proc_fd, "self/fd", O_RDONLY|O_DIRECTORY)) < 0) {
|
| SANDBOX_DIE("Cannot access \"/proc/self/fd\"");
|
| }
|
|
|