--- a/src/modules/rlm_mschap/configure.ac 2021-10-07 21:46:04.000000000 +0200 +++ b/src/modules/rlm_mschap/configure.ac 2022-09-24 05:22:47.398688867 +0200 @@ -15,13 +15,14 @@ dnl ############################################################ dnl extra argument: --with-winbind-include-dir=DIR + winbind_omit= winbind_include_dir= AC_ARG_WITH(winbind-include-dir, [AS_HELP_STRING([--with-winbind-include-dir=DIR], [Directory where the winbind includes may be found])], [case "$withval" in no) - AC_MSG_ERROR(Need winbind-include-dir) + winbind_omit="yes" ;; yes) ;; @@ -37,7 +38,7 @@ [Directory where the winbind libraries may be found])], [case "$withval" in no) - AC_MSG_ERROR(Need winbind-lib-dir) + winbind_omit="yes" ;; yes) ;; @@ -52,7 +53,7 @@ [Base directory where winbind is installed])], [case "$withval" in no) - AC_MSG_ERROR(Need winbind-dir) + winbind_omit="yes" ;; yes) ;; @@ -67,44 +68,48 @@ dnl # Check for header files dnl ############################################################ - mschap_sources= - FR_SMART_CHECK_INCLUDE(membership.h) - if test "x$ac_cv_header_membership_h" = "xyes"; then + if test "x$winbind_omit" = "xyes"; then + AC_MSG_WARN([building without support for direct authentication via winbind]) + else + mschap_sources= + FR_SMART_CHECK_INCLUDE(membership.h) + if test "x$ac_cv_header_membership_h" = "xyes"; then AC_DEFINE([HAVE_MEMBERSHIP_H],[1],[Build with Apple Open Directory support]) mschap_sources="$mschap_sources opendir.c" mod_ldflags="-framework DirectoryService" - fi + fi - smart_try_dir="$winbind_include_dir /usr/include/samba-4.0" - FR_SMART_CHECK_INCLUDE(wbclient.h, [#include + smart_try_dir="$winbind_include_dir /usr/include/samba-4.0" + FR_SMART_CHECK_INCLUDE(wbclient.h, [#include #include ]) - if test "x$ac_cv_header_wbclient_h" != "xyes"; then + if test "x$ac_cv_header_wbclient_h" != "xyes"; then AC_MSG_WARN([wbclient.h not found. Use --with-winbind-include-dir=.]) AC_MSG_WARN([silently building without support for direct authentication via winbind. requires: libwbclient]) - fi + fi - FR_SMART_CHECK_INCLUDE(core/ntstatus.h, [#include + FR_SMART_CHECK_INCLUDE(core/ntstatus.h, [#include #include ]) - if test "x$ac_cv_header_core_ntstatus_h" != "xyes"; then + if test "x$ac_cv_header_core_ntstatus_h" != "xyes"; then AC_MSG_WARN([core/ntstatus.h not found. Use --with-winbind-include-dir=.]) AC_MSG_WARN([silently building without support for direct authentication via winbind. requires: libwbclient]) - fi - - dnl ############################################################ - dnl # Check for libraries - dnl ############################################################ - - if test "x$ac_cv_header_wbclient_h" = "xyes" && \ - test "x$ac_cv_header_core_ntstatus_h" = "xyes"; then + fi - smart_try_dir="$winbind_lib_dir" - FR_SMART_CHECK_LIB(wbclient, wbcCtxAuthenticateUserEx) - if test "x$ac_cv_lib_wbclient_wbcCtxAuthenticateUserEx" != "xyes"; then - AC_MSG_WARN([winbind libraries not found. Use --with-winbind-lib-dir=.]) - AC_MSG_WARN([Samba must be version 4.2.1 or higher to use this feature.]) - else - mschap_sources="$mschap_sources auth_wbclient.c" - AC_DEFINE([WITH_AUTH_WINBIND],[1],[Build with direct winbind auth support]) + dnl ############################################################ + dnl # Check for libraries + dnl ############################################################ + + if test "x$ac_cv_header_wbclient_h" = "xyes" && \ + test "x$ac_cv_header_core_ntstatus_h" = "xyes"; then + + smart_try_dir="$winbind_lib_dir" + FR_SMART_CHECK_LIB(wbclient, wbcCtxAuthenticateUserEx) + if test "x$ac_cv_lib_wbclient_wbcCtxAuthenticateUserEx" != "xyes"; then + AC_MSG_WARN([winbind libraries not found. Use --with-winbind-lib-dir=.]) + AC_MSG_WARN([Samba must be version 4.2.1 or higher to use this feature.]) + else + mschap_sources="$mschap_sources auth_wbclient.c" + AC_DEFINE([WITH_AUTH_WINBIND],[1],[Build with direct winbind auth support]) + fi fi fi --- a/src/modules/rlm_mschap/configure 2021-10-07 21:46:04.000000000 +0200 +++ b/src/modules/rlm_mschap/configure 2022-09-24 07:03:53.673208336 +0200 @@ -2773,7 +2773,7 @@ if test "${with_winbind_include_dir+set}" = set; then : withval=$with_winbind_include_dir; case "$withval" in no) - as_fn_error $? "Need winbind-include-dir" "$LINENO" 5 + winbind_omit="yes" ;; yes) ;; @@ -2790,7 +2790,7 @@ if test "${with_winbind_lib_dir+set}" = set; then : withval=$with_winbind_lib_dir; case "$withval" in no) - as_fn_error $? "Need winbind-lib-dir" "$LINENO" 5 + winbind_omit="yes" ;; yes) ;; @@ -2806,7 +2806,7 @@ if test "${with_winbind_dir+set}" = set; then : withval=$with_winbind_dir; case "$withval" in no) - as_fn_error $? "Need winbind-dir" "$LINENO" 5 + winbind_omit="yes" ;; yes) ;; @@ -2819,6 +2819,10 @@ + if test "x$winbind_omit" = "xyes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: building without support for direct authentication via winbind" >&5 +$as_echo "$as_me: WARNING: building without support for direct authentication via winbind" >&2;} + else mschap_sources= @@ -3723,6 +3727,8 @@ fi fi +fi + targetname=rlm_mschap else targetname=