Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 528048 - net-nds/openldap-2.4.40-r2 USE=kerberos with app-crypt/heimdal-1.5.3-r2 - kinit.c:28:23: fatal error: krb5/krb5.h: No such file or directory
Summary: net-nds/openldap-2.4.40-r2 USE=kerberos with app-crypt/heimdal-1.5.3-r2 - kin...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo LDAP project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-02 21:57 UTC by Martin von Gagern
Modified: 2016-01-22 06:29 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build log (net-nds:openldap-2.4.40-r2:20141102-144930.log,599.42 KB, text/plain)
2014-11-02 21:57 UTC, Martin von Gagern
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin von Gagern 2014-11-02 21:57:07 UTC
Created attachment 388360 [details]
build log

It seems openldap-2.4.40-r2 doesn't compile against heimdal, while I have openldap-2.4.39 compiled against it.

 * Compiling contrib-module: kinit
libtool: compile:  x86_64-pc-linux-gnu-gcc -DSLAPD_OVER_KINIT=SLAPD_MOD_DYNAMIC 
-I/var/tmp/portage/net-nds/openldap-2.4.40-r2/work/openldap-2.4.40-abi_x86_64.am
d64/include -I../../../include -I../../../servers/slapd -march=amdfam10 -O2 -ggd
b -pipe -c kinit.c  -fPIC -DPIC -o .libs/kinit.o
kinit.c:28:23: fatal error: krb5/krb5.h: No such file or directory
 #include <krb5/krb5.h>
                       ^
compilation terminated.

Heimdal ships a file called /usr/include/krb5.h but no krb5/krb5.h.

Funny thing is, looking at a diff of the ebuilds, the new one specifically mentions heimdal in one place of its dependencies, in addition to virtual/krb5.
Comment 1 Martin von Gagern 2014-11-19 19:42:41 UTC
Still an issue in 2.4.40-r3. Changing from <krb5/krb5.h> to <krb5.h> solves the include problem, but there is some access to MIT-specific data structures. Seems like Heimdal isn't supported by this module, as also indicated by its initial announcement, http://www.openldap.org/lists/openldap-technical/201010/msg00227.html

I guess I MIGHT be able to make it work with Heimdal, but I don't have a test environment at the moment, so I couldn't verify my test. Therefore I suggest you disable the kinit addon (just like it was disabled in the 2.4.39 ebuild) at least for heimdal-based systems, until someone turns up who could test this.
Comment 2 Gerald Raaf 2015-02-14 11:17:23 UTC
i have a working heimdal installation, and i can confirm that the openldap ebuild till openldap-2.4.39 is working fine out of the box.

in my opinion the problem is the ebuild, i have changed openldap-2.4.39.ebuild so it compiles with the source from openldap-2.4.40.
The problem is the multilib_src_compile() part from the ebuild, especially the parts smbkrb5passwd kerberos and overlays

In my installation i use samba version 3 and compiled openldap with the following use flags

net-nds/openldap-2.4.40-r3 was built with the following:
USE="berkdb crypt gnutls ipv6 kerberos overlays samba sasl smbkrb5passwd ssl syslog tcpd -cxx -debug -experimental -icu -iodbc -minimal -odbc -perl (-selinux) -slp" ABI_X86="64 -32 -x32"
CFLAGS="-march=native -O2 -pipe -D_GNU_SOURCE"
CXXFLAGS="-march=native -O2 -pipe -D_GNU_SOURCE"

the ebuild should be changed so it differences between samba4 and samba3 installation or it should depend on samba4.
Comment 3 Stefan Briesenick (RETIRED) gentoo-dev 2015-06-10 15:57:54 UTC
ping.

would ne nice to fix it... samba4 doesn't work with mit-krb5 and openldap-2.4.40 doesn't build with heimdal. :-/
Comment 4 Torsten Kurbad 2015-07-13 14:24:25 UTC
Yes, would be definitely nice to have a permanent fix!

ATM, I circumvent the issue by prepending a '#' to the line that builds the kinit module...
Comment 5 asears 2015-08-29 02:21:56 UTC
This bug still exists in 2.4.40-r4.
Using the kerberos USE flag causes package to depend on virtual/krb5, however it attempts to build contrib module "kinit" which will only build against app-crypt/mit-krb5.
In addition, using the smbkrb5passwd AND kerberos USE flags will implicitly depend on app-crypt/heimdal, which, due to the previously mentioned issue, will always fail.
Unfortunately, contrib/slapd-modules/smbk5pwd was written specifically for heimdal and contrib/slapd-modules/kinit was written specifically for mit-krb5 so it's unlikely they can both be built simultaneously at this point.
Comment 6 Martin von Gagern 2015-11-08 14:08:22 UTC
Happy birthday to this bug! Can we please get SOME way to disable the kinit addon for heimdal users? Either disable it unconditionally until someone complains, or disable it conditionally if heimdal is detected, or give us a USE flag for it, or whatever? This is really annoying, having to manually copy and tweak the ebuild after every openldap bump.
Comment 7 Torsten Kurbad 2016-01-13 12:44:30 UTC
(In reply to Martin von Gagern from comment #6)
> Happy birthday to this bug! Can we please get SOME way to disable the kinit
> addon for heimdal users? Either disable it unconditionally until someone
> complains, or disable it conditionally if heimdal is detected, or give us a
> USE flag for it, or whatever? This is really annoying, having to manually
> copy and tweak the ebuild after every openldap bump.

I concur!
Comment 8 Matthew Thode ( prometheanfire ) archtester Gentoo Infrastructure gentoo-dev Security 2016-01-18 01:25:02 UTC
2.4.43 has some references to heimdal, if using smbkrb5passwd and kerberos.  let us know if it doesn't work and we are always open to patches.
Comment 9 Torsten Kurbad 2016-01-19 16:51:14 UTC
(In reply to Matthew Thode ( prometheanfire ) from comment #8)
> 2.4.43 has some references to heimdal, if using smbkrb5passwd and kerberos. 
> let us know if it doesn't work and we are always open to patches.

The problem isn't smbkrb5passwd, but this line, which tries to build a contrib module unconditionally:

build_contrib_module "kinit" "kinit.c" "kinit"

The kinit module just doesn't build with heimdal, which causes the whole openldap ebuild to fail. This is just annoying, especially given that most users will never need this contrib module.

Building it thus could be handled either 

1. by a local use flag "kinit", which could be handled in CDEPEND like this:

kerberos? (
    virtual/krb5
    kinit? ( !app-crypt/heimdal )
    )

I know that there usually is a policy not to introduce new USE flags in abundance, but since smbkrb5passwd made it into a USE flag, too, a long while ago, I do not see any reason, why "kinit" shouldn't be a USE flag, too.

or

2. By detecting which kerberos implementation is installed and building the kinit module only upon detection of mit-krb5, but not, if heimdal is being detected.

Hope that cleared the matter up a bit.

Best,
Torsten
Comment 10 Matthew Thode ( prometheanfire ) archtester Gentoo Infrastructure gentoo-dev Security 2016-01-19 17:09:50 UTC
ebuilds shouldn't inspect the system at build time (looking for heimdal).  If heimdal isn't a use flag then we need to choose the use flag.  I'm in favor of adding it.
Comment 11 Torsten Kurbad 2016-01-19 18:06:18 UTC
(In reply to Matthew Thode ( prometheanfire ) from comment #10)
> ebuilds shouldn't inspect the system at build time (looking for heimdal). 
> If heimdal isn't a use flag then we need to choose the use flag.  I'm in
> favor of adding it.

That would be fine with me!
Comment 12 Matthew Thode ( prometheanfire ) archtester Gentoo Infrastructure gentoo-dev Security 2016-01-22 06:29:04 UTC
fixed in 2.4.43-r1