Blame SOURCES/0110-winbind-idmap-plugin-fix-detection.patch

ab1ddb
From f2a1f317dfa76ec7b5ff7a218b82f92e2de5f30d Mon Sep 17 00:00:00 2001
ab1ddb
From: Sumit Bose <sbose@redhat.com>
ab1ddb
Date: Fri, 18 May 2018 21:34:44 +0200
ab1ddb
Subject: [PATCH] winbind idmap plugin: fix detection
ab1ddb
MIME-Version: 1.0
ab1ddb
Content-Type: text/plain; charset=UTF-8
ab1ddb
Content-Transfer-Encoding: 8bit
ab1ddb
ab1ddb
Currently when compiling the detection code for the idmap interface
ab1ddb
version only SMBCLIENT_CFLAGS are used. Since libsmbclient does not use
ab1ddb
NTSTATUS the cflags do not contain '-DHAVE_IMMEDIATE_STRUCTURES=1' which
ab1ddb
make NTSTATUS to a struct instead of an integer. Since Samba itself
ab1ddb
might be complied with this define (it typically is) we have to make
ab1ddb
sure we use it as well. Otherwise the test program might crash on
ab1ddb
platforms where this change changes the calling convention as well.
ab1ddb
ab1ddb
Related to https://pagure.io/SSSD/sssd/issue/3741
ab1ddb
ab1ddb
Reviewed-by: Fabiano FidĂȘncio <fidencio@redhat.com>
ab1ddb
(cherry picked from commit 095bbe17b25369b967e97162d945cb001a13029e)
ab1ddb
---
ab1ddb
 src/external/samba.m4 | 4 ++--
ab1ddb
 1 file changed, 2 insertions(+), 2 deletions(-)
ab1ddb
ab1ddb
diff --git a/src/external/samba.m4 b/src/external/samba.m4
ab1ddb
index 610831bf054e3687eb13025e954acf345fca1a00..794cac2461d7fbd5e690ea105cd346cbe6fcce9a 100644
ab1ddb
--- a/src/external/samba.m4
ab1ddb
+++ b/src/external/samba.m4
ab1ddb
@@ -59,7 +59,7 @@ them. In this case, you will need to execute configure script with argument
ab1ddb
         sambalibdir="`$PKG_CONFIG --variable=libdir smbclient`"/samba
ab1ddb
         SAVE_CFLAGS=$CFLAGS
ab1ddb
         SAVE_LIBS=$LIBS
ab1ddb
-        CFLAGS="$CFLAGS $SMBCLIENT_CFLAGS -I/usr/include/samba-4.0"
ab1ddb
+        CFLAGS="$CFLAGS $SMBCLIENT_CFLAGS $NDR_NBT_CFLAGS $NDR_KRB5PAC_CFLAGS -I/usr/include/samba-4.0"
ab1ddb
         LIBS="$LIBS -L${sambalibdir} -lidmap-samba4 -Wl,-rpath ${sambalibdir}"
ab1ddb
         AC_RUN_IFELSE(
ab1ddb
             [AC_LANG_SOURCE([
ab1ddb
@@ -98,7 +98,7 @@ int main(void)
ab1ddb
     /* Check the versions we know about */
ab1ddb
     for (v = 5; v <= 6; v++) {
ab1ddb
         ret = smb_register_idmap(v, NULL, NULL);
ab1ddb
-        if (ret != NT_STATUS_OBJECT_TYPE_MISMATCH) {
ab1ddb
+        if (!NT_STATUS_EQUAL(ret, NT_STATUS_OBJECT_TYPE_MISMATCH)) {
ab1ddb
             return v;
ab1ddb
         }
ab1ddb
     }
ab1ddb
-- 
ab1ddb
2.17.0
ab1ddb