[SSSD] [PATCH] use proper Kerberos CFLAGS

Lukas Slebodnik lslebodn at redhat.com
Wed Feb 12 19:50:13 UTC 2014


On (07/02/14 17:13), Alexey Shabalin wrote:
>2014-02-06 Lukas Slebodnik <lslebodn at redhat.com>:
>
>> On (06/02/14 16:23), Jakub Hrozek wrote:
>> >On Thu, Feb 06, 2014 at 04:17:50PM +0100, Lukas Slebodnik wrote:
>> >> I was not able reproduce compilation failures with custom build of MIT
>> Kerberos
>> >> installed in /usr/local/. It could not be influenced by libraries
>> installed
>> >> from rpm, because I remove packages krb5-workstation, krb5-devel,
>> krb5-libs
>> >> (rpm -e --nodeps). I also tried build sssd on ubuntu (with custom build
>> of MIT
>> >> Kerberos) and there was not any problem.
>> >>
>> >> I had to install MIT Kerberos into different directory
>> >> (prefix /usr/local/extra/), but your patch did not solve all problem.
>> >>
>> >> user at user-virtual-machine:/tmp/sssd$ krb5-config --libs
>> >>    -L/usr/local/extra/lib -Wl,--enable-new-dtags -Wl,-rpath
>> >>    -Wl,/usr/local/extra/lib -lkrb5 -lk5crypto -lcom_err
>> >> user at user-virtual-machine:/tmp/sssd$ krb5-config --cflags
>> >>    -I/usr/local/extra/include
>> >> user at user-virtual-machine:/tmp/sssd$ krb5-config --version
>> >>    Kerberos 5 release 1.12.1
>> >>
>> >>   CCLD   sssd_pac_plugin.la
>> >> /usr/bin/ld: cannot find -lkrb5
>> >> collect2: error: ld returned 1 exit status
>> >> make[2]: *** [sssd_pac_plugin.la] Error 1
>> >> make[2]: Leaving directory `/tmp/sssd'
>> >> make[1]: *** [all-recursive] Error 1
>> >> make[1]: Leaving directory `/tmp/sssd'
>> >> make: *** [all] Error 2
>> >>
>> >> There was hardcoded "-lkrb5" in Makefile, so I changed it into
>> $(KRB5_LIBS)
>>
>
>Yes, true.
>Sorry, i did not even look such elementary mistakes.
>
>
>> >>
>> >> But there was another problem.
>> >>
>> >>   CC     src/providers/ldap/ldap_id.lo
>> >> In file included from ./src/providers/krb5/krb5_common.h:34:0,
>> >>                  from ./src/providers/ldap/ldap_common.h:29,
>> >>                  from src/providers/ldap/ldap_id.c:32:
>> >> ./src/util/sss_krb5.h:30:23: fatal error: krb5/krb5.h: No such file or
>> directory
>> >> compilation terminated.
>> >>
>> >>
>>
>
>Please, try new patch.
>
>
>
>> >> So I gave up to fix all problems.
>> >> Do you want to fix them?
>> >>
>> >> Thank you very much for your effort in improving sssd build system.
>> >>
>> >> LS
>> >
>> >I don't think we need to reproduce the failures per se. If the patch
>> >helps their distribution while not breaking ours, that's good enough for
>> >me.
>>
>> In my opinion, Alexander-s patch does not solve all problems.
>> Adding Alexey Shabalin to CC.
>>
>> Could you confirm attached patch solves problem on ALT Linux?
>>
>> LS
>>
>
>
>
>-- 
>Alexey Shabalin

>From bc016f8d928e4ce08a09783a0a0a7705ccdc92da Mon Sep 17 00:00:00 2001
>From: Alexey Shabalin <shaba at altlinux.ru>
>Date: Fri, 7 Feb 2014 17:02:03 +0400
>Subject: [PATCH] There are cases when MIT Kerberos is installed with includes
> in a subdirectory of /usr/include (or /usr/local/include).
>
>In such case we have to properly use KRB5_CFLAGS to reach them.
>
>https://fedorahosted.org/sssd/ticket/2226
>---
> Makefile.am          | 12 ++++++++++--
> src/external/krb5.m4 |  5 +++++
> 2 files changed, 15 insertions(+), 2 deletions(-)
>

TL;DR
I tested patch on ALT linux with the latest master and works well.
All tests passed including cmocka unit tests.

ACK

long version.
One difference between ALT Linux and fedora is that kerberos header files are
more nested on ALT Linux.

-------------------------------------------------------------------------------
[user at fedora] krb5-config --cflags

[altlinux at localhost]$ krb5-config --cflags
-I/usr/include/krb5
-------------------------------------------------------------------------------

and thus krb5.h files are stored in
/usr/include/kbr5/krb5.h
/usr/include/kbr5/krb5/krb5.h

-------------------------------------------------------------------------------
[altlinux at localhost]$ cat /usr/include/krb5/krb5.h
/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */
/* The MIT Kerberos header file krb5.h used to live here.

   As of the 1.5 release, we're installing multiple Kerberos headers,
   so they're all moving to a krb5/ subdirectory.  This file is
   present just to keep old software still compiling.  Please update
   your code to use the new path for the header.  */
#include <krb5/krb5/krb5.h>
-------------------------------------------------------------------------------

SSSD try to detect availability of kerberos header file krb5.h or krb5/krb5.h
The second version was detected and used without any problem. There was not
any problem with header file krb5.h. The problem was only with including
header file profile.h

src/providers/krb5/krb5_common.c:38:21: fatal error: profile.h: No such file or directory

Because its full path is /usr/include/kbr5/profile.h and directory and
directory /usr/include/kbr5 was not added to the list of directories to be
searched for header files. (-I/usr/include/kbr5)

The kerberos libraries are stored in default directories.

We needn't complicate this patch anymore. I fine with this version.

One more time.
ACK

Alexey Shabalin, thank you very much for the patch. If you have any other with
sssd or ding-libs please send patches as soon as possible :-)

LS



More information about the sssd-devel mailing list