From d5e08d714d47b24da9dcb413cdbbf67d0b66ba45 Mon Sep 17 00:00:00 2001 From: Lukas Slebodnik Date: Fri, 5 Aug 2016 08:29:27 +0200 Subject: [PATCH] ipa-kdb: Allow to build with samba 4.5 daemons/ipa-kdb/ipa_kdb_mspac.c: In function 'filter_logon_info': daemons/ipa-kdb/ipa_kdb_mspac.c:1536:19: error: 'struct PAC_LOGON_INFO' has no member named 'res_group_dom_sid' if (info->info->res_group_dom_sid != NULL && ^~ daemons/ipa-kdb/ipa_kdb_mspac.c:1537:19: error: 'struct PAC_LOGON_INFO' has no member named 'res_groups'; did you mean 'resource_groups'? info->info->res_groups.count != 0) { ^~ mv -f .deps/ipa_kdb_delegation.Tpo .deps/ipa_kdb_delegation.Plo Makefile:806: recipe for target 'ipa_kdb_mspac.lo' failed make[3]: *** [ipa_kdb_mspac.lo] Error 1 make[3]: *** Waiting for unfinished jobs.... Related change in samba https://github.com/samba-team/samba/commit/4406cf792a599724f55777a45efb6367a9bd92b2 Resolves: https://fedorahosted.org/freeipa/ticket/6173 Reviewed-By: Alexander Bokovoy --- daemons/configure.ac | 12 ++++++++++++ daemons/ipa-kdb/ipa_kdb_mspac.c | 9 +++++++++ 2 files changed, 21 insertions(+) diff --git a/daemons/configure.ac b/daemons/configure.ac index f2eebee..9789f68 100644 --- a/daemons/configure.ac +++ b/daemons/configure.ac @@ -170,6 +170,18 @@ PKG_CHECK_MODULES([SAMBAUTIL], [samba-util]) SAMBA40EXTRA_LIBPATH="-L`$PKG_CONFIG --variable=libdir samba-util`/samba -Wl,-rpath=`$PKG_CONFIG --variable=libdir samba-util`/samba" AC_SUBST(SAMBA40EXTRA_LIBPATH) +bck_cflags="$CFLAGS" +CFLAGS="$NDRPAC_CFLAGS" +AC_CHECK_MEMBER( + [struct PAC_DOMAIN_GROUP_MEMBERSHIP.domain_sid], + [AC_DEFINE([HAVE_STRUCT_PAC_DOMAIN_GROUP_MEMBERSHIP], [1], + [struct PAC_DOMAIN_GROUP_MEMBERSHIP is available.])], + [AC_MSG_NOTICE([struct PAC_DOMAIN_GROUP_MEMBERSHIP is not available])], + [[#include + #include ]]) + +CFLAGS="$bck_cflags" + LIBPDB_NAME="" AC_CHECK_LIB([samba-passdb], [make_pdb_method], diff --git a/daemons/ipa-kdb/ipa_kdb_mspac.c b/daemons/ipa-kdb/ipa_kdb_mspac.c index 638069e..484479b 100644 --- a/daemons/ipa-kdb/ipa_kdb_mspac.c +++ b/daemons/ipa-kdb/ipa_kdb_mspac.c @@ -20,6 +20,8 @@ * along with this program. If not, see . */ +#include "config.h" + #include "ipa_kdb.h" #include "ipa_mspac.h" #include @@ -1533,10 +1535,17 @@ krb5_error_code filter_logon_info(krb5_context context, /* According to MS-KILE, ResourceGroups must be zero, so check * that it is the case here */ +#ifdef HAVE_STRUCT_PAC_DOMAIN_GROUP_MEMBERSHIP + if (info->info->resource_groups.domain_sid != NULL && + info->info->resource_groups.groups.count != 0) { + return EINVAL; + } +#else if (info->info->res_group_dom_sid != NULL && info->info->res_groups.count != 0) { return EINVAL; } +#endif return 0; } -- 2.5.5