Page MenuHomeFreeBSD

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

Authored by jhb on Aug 7 2025, 9:12 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Oct 17, 2:57 PM
Unknown Object (File)
Thu, Oct 16, 5:06 PM
Unknown Object (File)
Mon, Oct 13, 3:16 AM
Unknown Object (File)
Fri, Oct 10, 10:15 PM
Unknown Object (File)
Fri, Oct 10, 10:15 PM
Unknown Object (File)
Fri, Oct 10, 10:15 PM
Unknown Object (File)
Fri, Oct 10, 10:15 PM
Unknown Object (File)
Fri, Oct 10, 4:16 PM
Subscribers

Details

Summary

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

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

des requested changes to this revision.Aug 7 2025, 11:18 PM
des added a subscriber: des.
des added inline comments.
crypto/openssh/includes.h
37

This should be wrapped in #ifdef HAVE_FCNTL_H.

This revision now requires changes to proceed.Aug 7 2025, 11:18 PM

Is this file generated by a configure script btw? Probably that needs to be done?

No, this is not a generated file.

Thank you. We should consider upstreaming this, @emaste.

This revision is now accepted and ready to land.Aug 8 2025, 5:35 PM
In D51809#1184078, @des wrote:

Thank you. We should consider upstreaming this, @emaste.

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

This patch has been accepted upstream. It has been applied to both master and V_10_1 so it'll be in the next release.