[Bug 3874] New: Include <fcntl.h> explicitly in includes.h

bugzilla-daemon at mindrot.org bugzilla-daemon at mindrot.org
Tue Oct 7 05:48:22 AEDT 2025


https://bugzilla.mindrot.org/show_bug.cgi?id=3874

            Bug ID: 3874
           Summary: Include <fcntl.h> explicitly in includes.h
           Product: Portable OpenSSH
           Version: -current
          Hardware: All
                OS: FreeBSD
            Status: NEW
          Severity: enhancement
          Priority: P5
         Component: Miscellaneous
          Assignee: unassigned-bugs at mindrot.org
          Reporter: jlduran at gmail.com

Created attachment 3903
  --> https://bugzilla.mindrot.org/attachment.cgi?id=3903&action=edit
FreeBSD patch

Obtained from FreeBSD. Verbatim commit message:

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)
      |          ^~~~~~~~

-- 
You are receiving this mail because:
You are watching the assignee of the bug.


More information about the openssh-bugs mailing list