"Fossies" - the Fresh Open Source Software Archive

Member "sssd-2.4.2/src/external/samba.m4" (19 Feb 2021, 6586 Bytes) of package /linux/misc/sssd-2.4.2.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "samba.m4": 2.4.1_vs_2.4.2.

    1 AC_SUBST(NDR_NBT_CFLAGS)
    2 AC_SUBST(NDR_NBT_LIBS)
    3 AC_SUBST(SMBCLIENT_CFLAGS)
    4 AC_SUBST(SMBCLIENT_LIBS)
    5 AC_SUBST(NDR_KRB5PAC_CFLAGS)
    6 AC_SUBST(NDR_KRB5PAC_LIBS)
    7 
    8 if test x"$with_samba" = xyes; then
    9     PKG_CHECK_MODULES(NDR_NBT, ndr_nbt, ,
   10         AC_MSG_ERROR([[Please install Samba 4 NDR NBT development libraries.
   11 Samba 4 libraries are necessary for building ad and ipa provider.
   12 If you do not want to build these providers it is possible to build SSSD
   13 without them. In this case, you will need to execute configure script
   14 with argument --without-samba
   15     ]]))
   16 
   17     PKG_CHECK_MODULES(NDR_KRB5PAC, ndr_krb5pac, ,
   18         AC_MSG_ERROR([[Please install Samba 4 NDR KRB5PAC development libraries.
   19 Samba 4 libraries are necessary for building ad and ipa provider.
   20 If you do not want to build these providers it is possible to build SSSD
   21 without them. In this case, you will need to execute configure script
   22 with argument --without-samba
   23     ]]))
   24 
   25     PKG_CHECK_MODULES(SMBCLIENT, smbclient, ,
   26         AC_MSG_ERROR([[Please install libsmbclient development libraries.
   27 libsmbclient libraries are necessary for building ad and ipa provider.
   28 If you do not want to build these providers it is possible to build SSSD
   29 without them. In this case, you will need to execute configure script
   30 with argument --without-samba
   31     ]]))
   32 
   33     PKG_CHECK_MODULES(SAMBA_UTIL, samba-util, ,
   34         AC_MSG_ERROR([[Please install libsamba-util development libraries.
   35 libsamba-util libraries are necessary for building ad and ipa provider.
   36 If you do not want to build these providers it is possible to build SSSD
   37 without them. In this case, you will need to execute configure script
   38 with argument --without-samba
   39     ]]))
   40 
   41     if test x"$HAVE_LIBINI_CONFIG_V1_1" != x1; then
   42         AC_MSG_ERROR([[Please install libini_config development libraries
   43 v1.1.0, or newer. libini_config libraries are necessary for building ipa
   44 provider, as well as for building gpo-based access control in ad provider. If
   45 you do not want to build these providers it is possible to build SSSD without
   46 them. In this case, you will need to execute configure script with argument
   47 --without-samba
   48         ]])
   49     fi
   50 
   51     AC_ARG_WITH([smb-idmap-interface-version],
   52                 [AC_HELP_STRING([--with-smb-idmap-interface-version=[5|6]],
   53                                 [Idmap interface version of installed Samba]
   54                                )
   55                 ]
   56                )
   57 
   58     if test x"$with_smb_idmap_interface_version" != x; then
   59         if test x"$with_smb_idmap_interface_version" = x5 -o x"$with_smb_idmap_interface_version" = x6; then
   60             idmap_test_result=$with_smb_idmap_interface_version
   61         else
   62             AC_MSG_ERROR([Illegal value -$with_smb_idmap_interface_version- for option --with-smb-idmap-interface-version])
   63         fi
   64     else
   65 
   66         AC_MSG_CHECKING([Samba's idmap plugin interface version])
   67         sambalibdir="`$PKG_CONFIG --variable=libdir smbclient`"/samba
   68         SAVE_CFLAGS=$CFLAGS
   69         SAVE_LIBS=$LIBS
   70         CFLAGS="$CFLAGS $SMBCLIENT_CFLAGS $NDR_NBT_CFLAGS $NDR_KRB5PAC_CFLAGS"
   71         LIBS="$LIBS -L${sambalibdir} -lidmap-samba4 -Wl,-rpath ${sambalibdir}"
   72         AC_RUN_IFELSE(
   73             [AC_LANG_SOURCE([
   74 #include <stdlib.h>
   75 #include <stdint.h>
   76 #include <stdbool.h>
   77 #include <tevent.h>
   78 #include <core/ntstatus.h>
   79 
   80 struct winbindd_domain;
   81 
   82 /* overwrite some winbind internal functions */
   83 struct winbindd_domain *find_domain_from_name(const char *domain_name)
   84 {
   85     return NULL;
   86 }
   87 
   88 bool get_global_winbindd_state_offline(void) {
   89     return false;
   90 }
   91 
   92 struct tevent_context *winbind_event_context(void)
   93 {
   94     return NULL;
   95 }
   96 
   97 struct idmap_methods;
   98 
   99 NTSTATUS smb_register_idmap(int version, const char *name, struct idmap_methods *methods);
  100 
  101 int main(void)
  102 {
  103     int v;
  104     NTSTATUS ret;
  105 
  106     /* Check the versions we know about */
  107     for (v = 5; v <= 6; v++) {
  108         ret = smb_register_idmap(v, NULL, NULL);
  109         if (!NT_STATUS_EQUAL(ret, NT_STATUS_OBJECT_TYPE_MISMATCH)) {
  110             return v;
  111         }
  112     }
  113 
  114     return -1;
  115 }])],
  116             [AC_MSG_ERROR([idmap version test program is not expected to return 0])],
  117             [idmap_test_result=$?; AC_MSG_RESULT([idmap test result is: $idmap_test_result])]
  118         )
  119     fi
  120 
  121     CFLAGS=$SAVE_CFLAGS
  122     LIBS=$SAVE_LIBS
  123 
  124     if test $idmap_test_result -eq 5 -o $idmap_test_result -eq 6 ; then
  125         idmap_version=$idmap_test_result
  126     else
  127         AC_MSG_ERROR([Cannot determine Samba's idmap interface version, please use --with-smb-idmap-interface-version])
  128     fi
  129     AC_MSG_NOTICE([Samba's idmap interface version: $idmap_version])
  130     AC_DEFINE_UNQUOTED(SMB_IDMAP_INTERFACE_VERSION, $idmap_version,
  131                        [Detected version of Samba's idmap plugin interface])
  132 
  133     samba_major_version=`printf '#include <samba/version.h>\nSAMBA_VERSION_MAJOR' | $CPP $SMBCLIENT_CFLAGS -P -`
  134     samba_minor_version=`printf '#include <samba/version.h>\nSAMBA_VERSION_MINOR' | $CPP $SMBCLIENT_CFLAGS -P -`
  135     samba_release_version=`printf '#include <samba/version.h>\nSAMBA_VERSION_RELEASE' | $CPP $SMBCLIENT_CFLAGS -P -`
  136     AC_MSG_NOTICE([Samba version: $samba_major_version $samba_minor_version $samba_release_version])
  137     if ([[ $samba_major_version -gt 4 ]]) ||
  138        ([[ $samba_major_version -eq 4 ]] && [[ $samba_minor_version -ge 8 ]]) ||
  139        ([[ $samba_major_version -eq 4 ]] && [[ $samba_minor_version -eq 7 ]] && [[ $samba_release_version -ge 4 ]]); then
  140         AC_DEFINE_UNQUOTED(SMB_IDMAP_DOMAIN_HAS_DOM_SID, 1,
  141                            [Samba's struct idmap_domain has dom_sid member])
  142         AC_MSG_NOTICE([Samba's struct idmap_domain has dom_sid member])
  143     else
  144         AC_MSG_NOTICE([Samba's struct idmap_domain does not have dom_sid member])
  145     fi
  146 
  147     if ([[ $samba_major_version -gt 4 ]]) ||
  148        ([[ $samba_major_version -eq 4 ]] && [[ $samba_minor_version -ge 12 ]]); then
  149         AC_DEFINE_UNQUOTED(SMB_HAS_NEW_NDR_PULL_STEAL_SWITCH, 1,
  150                            [Samba's new push/pull switch functions])
  151         AC_MSG_NOTICE([Samba has support for new ndr_push_steal_switch_value and ndr_pull_steal_switch_value functions])
  152     else
  153         AC_MSG_NOTICE([Samba supports old ndr_pull_steal_switch_value and ndr_pull_steal_switch_value functions])
  154     fi
  155 fi
  156 
  157 SAVE_CFLAGS=$CFLAGS
  158 CFLAGS="$CFLAGS $SMBCLIENT_CFLAGS $NDR_NBT_CFLAGS $NDR_KRB5PAC_CFLAGS"
  159 AC_CHECK_MEMBERS([struct PAC_LOGON_INFO.resource_groups], , ,
  160                  [[ #include <ndr.h>
  161                     #include <gen_ndr/krb5pac.h>
  162                     #include <gen_ndr/krb5pac.h>]])
  163 CFLAGS=$SAVE_CFLAGS