Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enforce a floor on the desched_fd to prevent it from being too low fo…
…r the chromium IPC code in Firefox. F_DUPFD(_CLOEXEC) picks the first free fd at or above the provided one, so this effectively gives us dup() with a custom floor value. Chromium only wants the first few fds to itself, so 100 is mor than enough.
- Loading branch information
1 parent
14bf16e
commit f806123
Showing
4 changed files
with
40 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/* -*- Mode: C; tab-width: 8; c-basic-offset: 2; indent-tabs-mode: nil; -*- */ | ||
|
||
#include "rrutil.h" | ||
|
||
int main(int argc, char** argv) { | ||
int fd; | ||
|
||
for (fd = 3; fd < 100; ++fd) { | ||
/* Check that |fd| is available to us. */ | ||
test_assert(dup2(2, fd) == fd); | ||
} | ||
|
||
atomic_puts("EXIT-SUCCESS"); | ||
return 0; | ||
} |