Bug 165638 - sys-auth/nss_ldap-254 fails build with kerberos USE flag and app-crypt/heimdal-0.7.2-r3 due to undeclared GSS_S_COMPLETE
Bug#: 165638 Product:  Gentoo Linux Version: 2006.1 Platform: All
OS/Version: Linux Status: RESOLVED Severity: normal Priority: P2
Resolution: FIXED Assigned To: ldap-bugs@gentoo.org Reported By: Martin.vGagern@gmx.net
Component: Library
URL:  http://bugzilla.padl.com/show_bug.cgi?id=308
Summary: sys-auth/nss_ldap-254 fails build with kerberos USE flag and app-crypt/heimdal-0.7.2-r3 due to undeclared GSS_S_COMPLETE
Keywords:  
Status Whiteboard: 
Opened: 2007-02-06 15:46 0000
Description:   Opened: 2007-02-06 15:46 0000
gcc -DHAVE_CONFIG_H   -DLDAP_REFERRALS -DLDAP_DEPRECATED -D_REENTRANT 
-march=prescott -O2 -Wall -fPIC -c ldap-nss.c
ldap-nss.c: In function 'do_bind':
ldap-nss.c:1890: warning: implicit declaration of function
'gss_krb5_ccache_name'
ldap-nss.c:1891: error: 'GSS_S_COMPLETE' undeclared (first use in this
function)
ldap-nss.c:1891: error: (Each undeclared identifier is reported only once
ldap-nss.c:1891: error: for each function it appears in.)
make: *** [ldap-nss.o] Error 1

This macro is defined in the include file gssapi/gssapi.h provided by heimdal.
(Note: it is really heimdal/gssapi.h, but gssapi is a symlink to heimdal.)
However the include section in ldap-nss.c looks like this:

#ifdef HAVE_GSSAPI_H
#include <gssapi.h>
#elif defined(HAVE_GSSAPI_GSSAPI_KRB5_H)
#include <gssapi/gssapi.h>
#include <gssapi/gssapi_krb5.h>
#endif

As you can see, the first include fails because we have our include file in a
sub directory, and the second one fails because this form is only used if there
is a gssapi_krb5.h as well, and at least my heimdal did not provide such a one.

Possible solutions:
1. have heimdal provide a gssapi_krb5.h as well
2. symlink gssapi.h to main include dir
3. patch nss_ldap to look for alternative header file instead
4. patch nss_ldap to look for alternative header file as well
I don't know enough about gssapi and its headers to decide which of these
solutions would be best suited.

bug 119281 discusses similar issues for uw-imap and pine. There it seems to be
an enhancement request to newly add heimdal compatibility.

------- Comment #1 From Robin Johnson 2007-02-07 06:06:19 0000 -------
provide a patch against nss_ldap to make it look elsewhere for headers please.

------- Comment #2 From Martin von Gagern 2007-02-07 10:32:09 0000 -------
Created an attachment (id=109412) [details]
nss_ldap-254-gssapi-headers.patch

(In reply to comment #1)
> provide a patch against nss_ldap to make it look elsewhere for headers please.

Here you are. :-)

------- Comment #3 From Martin von Gagern 2007-02-07 10:33:07 0000 -------
Reported upstream as well: http://bugzilla.padl.com/show_bug.cgi?id=308

------- Comment #4 From Bryan Jacobs 2007-07-23 22:24:42 0000 -------
(In reply to comment #3)
> Reported upstream as well: http://bugzilla.padl.com/show_bug.cgi?id=308
> 

Heimdal 1.0 provides gssapi_krb5.h.

------- Comment #5 From Martin von Gagern 2007-09-20 09:02:48 0000 -------
Still an issue with sys-auth/nss_ldap-257. My patch from comment #2 still
works. Please apply patch in official ebuild until upstream catches up.

------- Comment #6 From Robin Johnson 2007-10-09 23:43:30 0000 -------
257.2 is in the tree now, and upstream has the other kerberos changes.

------- Comment #7 From Martin von Gagern 2007-10-24 12:38:09 0000 -------
Created an attachment (id=134217) [details]
nss_ldap-257.2-gssapi-headers.patch

Old patch fails for 257.2, but is still needed with app-crypt/heimdal-0.7.2-r3.
Recreated patch.

------- Comment #8 From Martin von Gagern 2007-10-24 12:42:34 0000 -------
Reopening, as I still needed this patch in order to build against the only
Heimdal implementation currently available in the official portage tree.

------- Comment #9 From Robin Johnson 2007-11-08 03:17:49 0000 -------
258 is in the tree now with this fix.