Home GnuPG

posix:spawn: Use getdents64 when closefrom is not available.

Description

posix:spawn: Use getdents64 when closefrom is not available.

* configure.ac (AC_CHECK_FUNCS): Check getdents64.
* src/spawn-posix.c [!HAVE_CLOSEFROM] (get_max_fds): Use getdents64
instead of readdir, for AS-Safety.

closefrom is available with glibc >= 2.34.
getdents64 is available with glibc >= 2.30.
To support older glibc versions, we could use syscall as
GPGME does.

  • GnuPG-bug-id: T7696
  • Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>

Details

Provenance
gniibeAuthored on Thu, Jun 26, 4:10 AM
Parents
rE2c029e737e88: spawn:posix: Fix spawning a process on POSIX machine.
Branches
Unknown
Tags
Unknown
Tasks
T7696: POSIX: spawn fixes