Bug 14964 - build failure due to outdated installed headers pulled in by CPPFLAGS in samba3/utils/net_offlinejoin.c
Summary: build failure due to outdated installed headers pulled in by CPPFLAGS in samb...
Status: NEW
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: Build (show other bugs)
Version: 4.15.4
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Samba QA Contact
QA Contact: Samba QA Contact
Depends on:
Reported: 2022-01-28 16:49 UTC by Thomas Orgis
Modified: 2022-01-28 16:49 UTC (History)
0 users

See Also:

patch to fix header inclusion (603 bytes, text/x-csrc)
2022-01-28 16:49 UTC, Thomas Orgis
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Orgis 2022-01-28 16:49:32 UTC
Created attachment 17134 [details]
patch to fix header inclusion

In a build environment that provides CPPFLAGS to point to the install location of samba, those flags get prepended to compiler calls before the paths to the local codebase. While it might be an idea to change that, another way to deal with this is to change source3/utils/net_offlinejoin.c not to simply include <netapi.h>, but "lib/netapi/netapi.h" and "lib/netapi/netapi_net.h" to refer to the current headers in the source tree and not those from an old install of samba that will trigger build failures.

Such failure occured to me while testing the build of samba in pkgsrc. It picks up the netapi.h from samba 4.13 and barks out. My patch aligns the header use with other files in utils.

I guess the attached patch is uncontroversial … it seems like an oversight that the <netapi.h> include was left there.