HomeFreeBSD

openssh: Include <fcntl.h> explicitly in includes.h

Description

openssh: Include <fcntl.h> explicitly in includes.h

This was previously included due to nested includes in Heimdal's
headers. Without this, the build fails with an error due to redefining
AT_FDCWD.

clang:

In file included from crypto/openssh/sshd-session.c:46:
/usr/obj/.../tmp/usr/include/fcntl.h:232:9: error: 'AT_FDCWD' macro redefined [-Werror,-Wmacro-redefined]

232 | #define AT_FDCWD                -100
    |         ^

crypto/openssh/openbsd-compat/bsd-misc.h:69:10: note: previous definition is here

69 | # define AT_FDCWD (-2)
   |          ^

GCC (can't be disabled):

In file included from crypto/openssh/sshd-session.c:46:
sys/sys/fcntl.h:232:9: error: "AT_FDCWD" redefined [-Werror]

232 | #define AT_FDCWD                -100
    |         ^~~~~~~~

In file included from crypto/openssh/openbsd-compat/openbsd-compat.h:218,

from crypto/openssh/includes.h:173,
from crypto/openssh/sshd-session.c:30:

openssh/openbsd-compat/bsd-misc.h:69:10: note: this is the location of the previous definition

69 | # define AT_FDCWD (-2)
   |          ^~~~~~~~

Reviewed by: des
Differential Revision: https://reviews.freebsd.org/D51809

Details

Provenance
jhbAuthored on Aug 8 2025, 5:43 PM
Reviewer
des
Differential Revision
D51809: openssh: Include <fcntl.h> explicitly in includes.h
Parents
rG5090ea716b22: inet: fix typo
Branches
Unknown
Tags
Unknown