Bug 6929 - testing krb5/locate_plugin.h usability fails with heimdal-1.3
Summary: testing krb5/locate_plugin.h usability fails with heimdal-1.3
Status: RESOLVED FIXED
Alias: None
Product: Samba 3.4
Classification: Unclassified
Component: Build environment (show other bugs)
Version: 3.4.3
Hardware: All Linux
: P3 normal
Target Milestone: ---
Assignee: Karolin Seeger
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-11-25 00:50 UTC by Allan
Modified: 2009-12-03 08:00 UTC (History)
0 users

See Also:


Attachments
check for prerequisite krb5/krb5.h headers while checking for locate_plugin.h (1.36 KB, patch)
2009-11-25 14:48 UTC, Guenther Deschner
no flags Details
remaing patch for master (3.61 KB, patch)
2009-11-27 02:55 UTC, Guenther Deschner
no flags Details
v3-4-test patch (9.11 KB, patch)
2009-11-27 03:21 UTC, Guenther Deschner
no flags Details
patch for 3.4 (fixed version) (37.82 KB, patch)
2009-11-30 07:55 UTC, Guenther Deschner
metze: review+
Details
patch for 3.3 (43.25 KB, patch)
2009-12-01 17:18 UTC, Guenther Deschner
no flags Details
v3-4-test missing patch (1.49 KB, patch)
2009-12-03 07:53 UTC, Guenther Deschner
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Allan 2009-11-25 00:50:24 UTC
With heimdal-1.3, testing for the usability of krb5/locate_plugin.h fails.

checking for krb5.h... yes
checking krb5/locate_plugin.h usability... no
checking krb5/locate_plugin.h presence... yes
configure: WARNING: krb5/locate_plugin.h: present but cannot be compiled
configure: WARNING: krb5/locate_plugin.h:     check for missing prerequisite headers?
configure: WARNING: krb5/locate_plugin.h: see the Autoconf documentation
configure: WARNING: krb5/locate_plugin.h:     section "Present But Cannot Be Compiled"
configure: WARNING: krb5/locate_plugin.h: proceeding with the preprocessor's result
configure: WARNING: krb5/locate_plugin.h: in the future, the compiler will take precedence
configure: WARNING:     ## ---------------------------------------- ##
configure: WARNING:     ## Report this to samba-technical@samba.org ##
configure: WARNING:     ## ---------------------------------------- ##
checking for krb5/locate_plugin.h... yes
checking gssapi.h usability... yes
checking gssapi.h presence... yes

From discussion with the heimdal devs, this can be rectified by always including <krb5.h> before <krb5/locate_plugin.h>.
Comment 1 Allan 2009-11-25 03:52:36 UTC
The same applies to including krb5-protos.h.  This is detected only during build (resulting in a 8648 line error message...)
Comment 2 Allan 2009-11-25 04:39:23 UTC
Ignore comment #1.  It appears to be a completely unrelated build error.
Comment 3 Guenther Deschner 2009-11-25 08:09:35 UTC
Ok, we need to workaround the DEPRECATED handling for heimdal 1.3.1.
This patch should make the build work for (and probably only for) newest heimdal releases:


 source3/libsmb/clikrb5.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/source3/libsmb/clikrb5.c b/source3/libsmb/clikrb5.c
index 3da64d6..bacd0af 100644
--- a/source3/libsmb/clikrb5.c
+++ b/source3/libsmb/clikrb5.c
@@ -21,7 +21,7 @@
 */

 #define KRB5_PRIVATE    1       /* this file uses PRIVATE interfaces! */
-#define KRB5_DEPRECATED 1       /* this file uses DEPRECATED interfaces! */
+#define KRB5_DEPRECATED         /* this file uses DEPRECATED interfaces! */

 #include "includes.h"

Comment 4 Allan 2009-11-25 09:16:50 UTC
That appears to make the build work (at least it now gets passed the main problem area), but does not fix the initial ./configure issue.
Comment 5 Guenther Deschner 2009-11-25 14:48:12 UTC
Created attachment 5011 [details]
check for prerequisite krb5/krb5.h headers while checking for locate_plugin.h

Does this resolve the other configure warning ?
Comment 6 Allan 2009-11-25 22:09:31 UTC
Not quite.  The default location for krb5.h with heimdal-1.3 is <krb5.h> and not <krb5/krb5.h>, although it is probably best to check for both for future compatibility.  I adjusted that patch slightly:

@@ -3350,7 +3350,15 @@ if test x"$with_ads_support" != x"no"; then
     CPPFLAGS=$ac_save_CPPFLAGS
     LDFLAGS=$ac_save_LDFLAGS
   fi
-  AC_CHECK_HEADERS(krb5/locate_plugin.h)
+  AC_CHECK_HEADERS([krb5/locate_plugin.h], [], [],
+[[#ifdef HAVE_KRB5_KRB5_H
+ #include <krb5/krb5.h>
+ #endif
+ #ifdef HAVE_KRB5_H
+ #include <krb5.h>
+ #endif
+]])
+
   if test x"$ac_cv_header_krb5_locate_plugin_h" = x"yes"; then
 	WINBIND_KRB5_LOCATOR="bin/winbind_krb5_locator.$SHLIBEXT"
 	if test x"$BLDSHARED" = x"true" ; then

and configure now works as expected:

checking krb5.h usability... yes
checking krb5.h presence... yes
checking for krb5.h... yes
checking krb5/krb5.h usability... no
checking krb5/krb5.h presence... no
checking for krb5/krb5.h... no
checking for krb5/locate_plugin.h... yes

That leaves this compiler error:

Compiling ../nsswitch/pam_winbind.c
Compiling localedir.c
Linking shared library bin/pam_winbind.so
Compiling ../nsswitch/winbind_krb5_locator.c
In file included from ../nsswitch/winbind_krb5_locator.c:29:
/usr/include/krb5/locate_plugin.h:50: error: expected declaration specifiers or ‘...’ before ‘*’ token
/usr/include/krb5/locate_plugin.h:53: error: ‘krb5_error_code’ declared as function returning a function
/usr/include/krb5/locate_plugin.h:58: error: expected ‘)’ before ‘void’
/usr/include/krb5/locate_plugin.h:59: error: expected ‘;’ before ‘void’
...

which is fixed by adding <krb5.h> or <krb5/krb5.h> as detected about the "#include <krb5/locate_plugin.h>" in nsswitch/winbind_krb5_locator.c
Comment 7 Guenther Deschner 2009-11-27 02:55:51 UTC
Created attachment 5016 [details]
remaing patch for master
Comment 8 Guenther Deschner 2009-11-27 03:21:44 UTC
Created attachment 5017 [details]
v3-4-test patch
Comment 9 Guenther Deschner 2009-11-30 07:55:05 UTC
Created attachment 5024 [details]
patch for 3.4 (fixed version)

This should fix all krb5 builds
Comment 10 Stefan Metzmacher 2009-11-30 08:08:45 UTC
Comment on attachment 5024 [details]
patch for 3.4 (fixed version)

looks good
Comment 11 Guenther Deschner 2009-11-30 08:13:41 UTC
Karolin, please pick for v3-4-test.

Actually it is required for v3-3-test as well, oh well...
Comment 12 Karolin Seeger 2009-11-30 08:22:03 UTC
Pushed to v3-4-test.
Comment 13 Karolin Seeger 2009-12-01 02:23:55 UTC
Reassigning to Günther (waiting for a patch for v3-3-test).
Comment 14 Guenther Deschner 2009-12-01 17:18:27 UTC
Created attachment 5038 [details]
patch for 3.3
Comment 15 Guenther Deschner 2009-12-01 17:19:49 UTC
Uploaded patch for 3-3-test, also added two other minor heimdal build warning patches (the first two in the patchlist).
Comment 16 Karolin Seeger 2009-12-02 02:19:58 UTC
(In reply to comment #15)
> Uploaded patch for 3-3-test, also added two other minor heimdal build warning
> patches (the first two in the patchlist).
> 

Pushed. Closing out bug report.

Thanks!
Comment 17 Guenther Deschner 2009-12-03 07:51:40 UTC
one hunk missing in v3-4-test patch.
Comment 18 Guenther Deschner 2009-12-03 07:53:01 UTC
Created attachment 5051 [details]
v3-4-test missing patch
Comment 19 Guenther Deschner 2009-12-03 07:53:44 UTC
Karolin, please add that missing patch to v3-4-test (it is included in master and v3-3-test already).
Comment 20 Karolin Seeger 2009-12-03 08:00:09 UTC
(In reply to comment #19)
> Karolin, please add that missing patch to v3-4-test (it is included in master
> and v3-3-test already).
> 

Pushed, closing out bug report.
Thanks!