brintos

brintos / llvm-project-archived public Read only

0
0
Text · 465 B · 7411589 Raw
20 lines · plain
1.. title:: clang-tidy - android-cloexec-inotify-init12 3android-cloexec-inotify-init14=============================5 6``inotify_init1()`` should include ``IN_CLOEXEC`` in its type argument7to avoid the file descriptor leakage. Without this flag, an opened8sensitive file would remain open across a fork+exec to a9lower-privileged SELinux domain.10 11Examples:12 13.. code-block:: c++14 15  inotify_init1(IN_NONBLOCK);16 17  // becomes18 19  inotify_init1(IN_NONBLOCK | IN_CLOEXEC);20