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

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