Skip to content

Fix building for other libc's

listout requested to merge listout/samba:musl_fixes into master

On libc's such as musl some defines and functions are missing which samba project uses. Mainly the defines NETDB_INTERNAL, NETDB_SUCCESS, and the function innetgr. With this MR I'm checking the presence of the NETDB_* defines and if not present defining them, and using the HAVE_INNETGR define to check if we can use the innetgr function before calling it.

Some of the patches are taken in as-is form, from Alpine Linux, while some I've modified a little bit.

Checklist

  • Commits have Signed-off-by: with name/author being identical to the commit author
  • (optional) This MR is just one part towards a larger feature.
  • (optional, if backport required) Bugzilla bug filed and BUG: tag added
  • Test suite updated with functionality tests
  • Test suite updated with negative tests
  • Documentation updated
  • CI timeout is 3h or higher (see Settings/CICD/General pipelines/ Timeout)

Reviewer's checklist:

  • There is a test suite reasonably covering new functionality or modifications
  • Function naming, parameters, return values, types, etc., are consistent and according to README.Coding.md
  • This feature/change has adequate documentation added
  • No obvious mistakes in the code

Merge request reports