summaryrefslogtreecommitdiffstats
path: root/daemons
diff options
context:
space:
mode:
authorLukas Slebodnik <lslebodn@redhat.com>2016-08-05 08:29:27 +0200
committerMartin Basti <mbasti@redhat.com>2016-08-09 14:37:49 +0200
commite7480bed277e441abf4cfdb1dd8c11471514c8ab (patch)
tree70281e27f55e6ea0da86f8f5b3f54175e48ff416 /daemons
parent58da5fb4b9e81e872e0b59c17263071f8b2889da (diff)
downloadfreeipa-e7480bed277e441abf4cfdb1dd8c11471514c8ab.tar.gz
freeipa-e7480bed277e441abf4cfdb1dd8c11471514c8ab.tar.xz
freeipa-e7480bed277e441abf4cfdb1dd8c11471514c8ab.zip
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 <abokovoy@redhat.com>
Diffstat (limited to 'daemons')
-rw-r--r--daemons/configure.ac12
-rw-r--r--daemons/ipa-kdb/ipa_kdb_mspac.c9
2 files changed, 21 insertions, 0 deletions
diff --git a/daemons/configure.ac b/daemons/configure.ac
index 94d66d813..5c5a10463 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 <ndr.h>
+ #include <gen_ndr/krb5pac.h>]])
+
+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 80e7055fd..65cc03565 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 <http://www.gnu.org/licenses/>.
*/
+#include "config.h"
+
#include "ipa_kdb.h"
#include "ipa_mspac.h"
#include <talloc.h>
@@ -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;
}