brintos

brintos / llvm-project-archived public Read only

0
0
Text · 570 B · c19e07f Raw
23 lines · plain
1.. title:: clang-tidy - android-cloexec-pipe2 3android-cloexec-pipe4====================5 6This check detects usage of ``pipe()``. Using ``pipe()`` is not recommended,7``pipe2()`` is the suggested replacement. The check also adds the ``O_CLOEXEC``8flag that marks the file descriptor to be closed in child processes.9Without this flag a sensitive file descriptor can be leaked to a10child process, potentially into a lower-privileged SELinux domain.11 12Examples:13 14.. code-block:: c++15 16  pipe(pipefd);17 18Suggested replacement:19 20.. code-block:: c++21 22  pipe2(pipefd, O_CLOEXEC);23