Page MenuHomeFreeBSD

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

Authored by jhb on Thu, Aug 7, 9:12 PM.
Tags
None
Referenced Files
F126555699: D51809.diff
Wed, Aug 20, 11:11 PM
Unknown Object (File)
Mon, Aug 18, 6:11 AM
Unknown Object (File)
Mon, Aug 18, 6:10 AM
Unknown Object (File)
Mon, Aug 18, 12:57 AM
Unknown Object (File)
Sun, Aug 17, 9:09 PM
Unknown Object (File)
Sun, Aug 17, 8:12 PM
Unknown Object (File)
Sat, Aug 16, 12:24 AM
Unknown Object (File)
Fri, Aug 8, 5:48 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.Thu, Aug 7, 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.Thu, Aug 7, 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.Fri, Aug 8, 5:35 PM