Extra Clang Tools 6 documentation

clang-tidy - android-cloexec-accept

«  Clang-Tidy Checks   ::   Contents   ::   android-cloexec-accept4  »

android-cloexec-accept

The usage of accept() is not recommended, it’s better to use accept4(). Without this flag, an opened sensitive file descriptor would remain open across a fork+exec to a lower-privileged SELinux domain.

Examples:

accept(sockfd, addr, addrlen);

// becomes

accept4(sockfd, addr, addrlen, SOCK_CLOEXEC);

«  Clang-Tidy Checks   ::   Contents   ::   android-cloexec-accept4  »