lib/replace: split out GSSAPI from lib/replace/system/kerberos.h into lib/replace...
authorAlexander Bokovoy <ab@samba.org>
Tue, 24 Apr 2012 16:37:13 +0000 (19:37 +0300)
committerAlexander Bokovoy <ab@samba.org>
Tue, 24 Apr 2012 22:18:32 +0000 (00:18 +0200)
With waf build include directories are defined by dependencies specified to subsystems.
Without proper dependency <gssapi/gssapi.h> cannot be found for embedded Heimdal builds
when there are no system-wide gssapi/gssapi.h available.

Split out GSSAPI header includes in a separate replacement header and use that explicitly
where needed.

Autobuild-User: Alexander Bokovoy <ab@samba.org>
Autobuild-Date: Wed Apr 25 00:18:33 CEST 2012 on sn-devel-104

18 files changed:
auth/credentials/credentials_krb5.c
auth/kerberos/gssapi_pac.c
auth/kerberos/pac_utils.h
buildtools/wafsamba/samba3.py
lib/addns/dns.h
lib/krb5_wrap/krb5_samba.c
lib/replace/system/gssapi.h [new file with mode: 0644]
lib/replace/system/kerberos.h
libcli/smb/wscript_build
source3/configure.in
source3/libads/ads_status.c
source3/libads/sasl.c
source3/wscript_build
source4/auth/gensec/gensec_gssapi.c
source4/auth/kerberos/krb5_init_context.c
source4/auth/kerberos/wscript_build
source4/heimdal_build/wscript_configure
source4/ntvfs/ipc/vfs_ipc.c

index 480d7c5951c6f5946b4f942d741d5b6cff54606e..86b33d499833c3304917928d334ec9903befeb71 100644 (file)
@@ -23,6 +23,7 @@
 
 #include "includes.h"
 #include "system/kerberos.h"
+#include "system/gssapi.h"
 #include "auth/kerberos/kerberos.h"
 #include "auth/credentials/credentials.h"
 #include "auth/credentials/credentials_proto.h"
index d1a79501cce49c4f823c37b1fcb932f05db550a4..dadae1afa2680452cac16a3e6293be609f4adfde 100644 (file)
@@ -21,7 +21,6 @@
 #include "includes.h"
 #ifdef HAVE_KRB5
 
-#include "lib/krb5_wrap/krb5_samba.h"
 #include "auth/kerberos/pac_utils.h"
 
 #if 0
index bb954597f514ac573114a3f0033ae24b2d03c29b..7726f527754a0045a20bbab5d464995f585c28ad 100644 (file)
@@ -22,6 +22,8 @@
 #define _PAC_UTILS_H
 
 #include "lib/krb5_wrap/krb5_samba.h"
+#include "system/gssapi.h"
+
 struct PAC_SIGNATURE_DATA;
 struct PAC_DATA;
 
index 369285c395ae3735d5b501b53945dfced2432a50..7f05ffe40d3fbbcd25ba6cf19e7e69b1196ffb23 100644 (file)
@@ -56,8 +56,10 @@ def s3_fix_kwargs(bld, kwargs):
     # local heimdal paths only included when USING_SYSTEM_KRB5 is not set
     if not bld.CONFIG_SET("USING_SYSTEM_KRB5"):
         extra_includes += [ '../source4/heimdal/lib/com_err',
+                            '../source4/heimdal/lib/krb5',
                             '../source4/heimdal/lib/gssapi',
-                            '../source4/heimdal_build' ]
+                            '../source4/heimdal_build',
+                            '../bin/default/source4/heimdal/lib/asn1' ]
 
     if bld.CONFIG_SET('BUILD_TDB2'):
         if bld.CONFIG_SET('USING_SYSTEM_TDB2'):
index d0999918c14217e83dd0e29e35102a55cc4a32cd..88ba9d1fc0ba17f3532c49cd35061ec59e17ae55 100644 (file)
@@ -28,6 +28,7 @@
 #include "../replace/replace.h"
 #include "system/network.h"
 #include "system/kerberos.h"
+#include "system/gssapi.h"
 
 /* make sure we have included the correct config.h */
 #ifndef NO_CONFIG_H /* for some tests */
index 4e555b285331086e515ac564fb906c09a338187e..10207b58bc4e47ebafc945db6db9e3cd565955cf 100644 (file)
@@ -39,6 +39,7 @@
 #define GSSAPI_BNDLENGTH     16                 /* Bind Length (rfc-1964 pg.3) */
 #define GSSAPI_CHECKSUM_SIZE (4+GSSAPI_BNDLENGTH+4) /* Length of bind length,
                                                        bind field, flags field. */
+#define GSS_C_DELEG_FLAG 1
 
 /* MIT krb5 1.7beta3 (in Ubuntu Karmic) is missing the prototype,
    but still has the symbol */
diff --git a/lib/replace/system/gssapi.h b/lib/replace/system/gssapi.h
new file mode 100644 (file)
index 0000000..c22663c
--- /dev/null
@@ -0,0 +1,53 @@
+#ifndef _system_gssapi_h
+#define _system_gssapi_h
+
+/*
+   Unix SMB/CIFS implementation.
+
+   GSSAPI system include wrappers
+
+   Copyright (C) Andrew Tridgell 2004
+
+     ** NOTE! The following LGPL license applies to the replace
+     ** library. This does NOT imply that all of Samba is released
+     ** under the LGPL
+
+   This library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 3 of the License, or (at your option) any later version.
+
+   This library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with this library; if not, see <http://www.gnu.org/licenses/>.
+
+*/
+
+#ifdef HAVE_LIBGSSAPI
+
+#ifdef HAVE_GSSAPI_GSSAPI_EXT_H
+#include <gssapi/gssapi_ext.h>
+#elif HAVE_GSSAPI_GSSAPI_H
+#include <gssapi/gssapi.h>
+#elif HAVE_GSSAPI_GSSAPI_GENERIC_H
+#include <gssapi/gssapi_generic.h>
+#elif HAVE_GSSAPI_H
+#include <gssapi.h>
+#endif
+
+#if HAVE_GSSAPI_GSSAPI_KRB5_H
+#include <gssapi/gssapi_krb5.h>
+#endif
+
+#if HAVE_GSSAPI_GSSAPI_SPNEGO_H
+#include <gssapi/gssapi_spnego.h>
+#elif HAVE_GSSAPI_SPNEGO_H
+#include <gssapi_spnego.h>
+#endif
+
+#endif
+#endif
index 7762d4be46910f7b9d285c9da8b7da6d0f738a29..636ce0f2e0bff273b332f3704abf7501854845e6 100644 (file)
@@ -7,11 +7,11 @@
    kerberos system include wrappers
 
    Copyright (C) Andrew Tridgell 2004
-   
+
      ** NOTE! The following LGPL license applies to the replace
      ** library. This does NOT imply that all of Samba is released
      ** under the LGPL
-   
+
    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
    License as published by the Free Software Foundation; either
 #include <com_err.h>
 #endif
 
-#ifdef HAVE_GSSAPI_GSSAPI_EXT_H
-#include <gssapi/gssapi_ext.h>
-#elif HAVE_GSSAPI_GSSAPI_H
-#include <gssapi/gssapi.h>
-#elif HAVE_GSSAPI_GSSAPI_GENERIC_H
-#include <gssapi/gssapi_generic.h>
-#elif HAVE_GSSAPI_H
-#include <gssapi.h>
-#endif
-
-#if HAVE_GSSAPI_GSSAPI_KRB5_H
-#include <gssapi/gssapi_krb5.h>
-#endif
-
 #endif
 #endif
index 6feed445df58b38f81eac524cc0a461cf3d5db4a..4e860290e5acf7e29a8a4a6ef943db88a7de94cc 100755 (executable)
@@ -10,7 +10,7 @@ bld.SAMBA_LIBRARY('cli_smb_common',
                smbXcli_base.c
                smb1cli_trans.c
        ''',
-       deps='LIBCRYPTO errors gssapi gensec krb5samba LIBASYNC_REQ',
+       deps='LIBCRYPTO errors gensec krb5samba LIBASYNC_REQ',
        public_deps='talloc samba-util',
        private_library=True,
        public_headers='''
index 70bdfc7b63033760f3c093d2141b5c9084f1dd52..0253e076dce5389e7b6928a07aacc329b8389207 100644 (file)
@@ -3568,6 +3568,8 @@ if test x"$with_ads_support" != x"no"; then
   if test x"$have_gssapi" != xyes ; then
        AC_MSG_WARN([Samba cannot be supported without GSSAPI])
        use_ads=no
+  else
+       AC_DEFINE(HAVE_LIBGSSAPI, , [Whether the platform has GSSAPI support])
   fi
 
   AC_CHECK_FUNC_EXT(krb5_set_real_time, $KRB5_LIBS)
index 919e5d34dcd1a476f0359fb77f3580227291dade..fc489a9f00576df45d1ed2657f6ca803286e39dd 100644 (file)
@@ -22,6 +22,7 @@
 
 #include "includes.h"
 #include "smb_krb5.h"
+#include "system/gssapi.h"
 #include "smb_ldap.h"
 #include "libads/ads_status.h"
 
index 02fd7545e5ee08be8291d8a0d0c1ee0004fc4aa9..42d65b63d47e01307fcf5ca09cc96ff0eb0ab080 100644 (file)
@@ -23,6 +23,7 @@
 #include "auth_generic.h"
 #include "ads.h"
 #include "smb_krb5.h"
+#include "system/gssapi.h"
 
 #ifdef HAVE_LDAP
 
index ddd33467cc14409f7c45b79f5954528a3024df4b..b9bb6ad52435ab7ad44db5e89f5bccebd05b8e7d 100755 (executable)
@@ -782,7 +782,7 @@ bld.SAMBA3_LIBRARY('util_cmdline',
 
 bld.SAMBA3_SUBSYSTEM('KRBCLIENT',
                     source=KRBCLIENT_SRC,
-                    public_deps='krb5samba k5crypto LIBTSOCKET CLDAP LIBNMB',
+                    public_deps='krb5samba k5crypto gssapi LIBTSOCKET CLDAP LIBNMB',
                     vars=locals())
 
 bld.SAMBA3_SUBSYSTEM('samba3util',
@@ -875,7 +875,7 @@ bld.SAMBA3_LIBRARY('ads',
 
 bld.SAMBA3_SUBSYSTEM('LIBADS_SERVER',
                     source=LIBADS_SERVER_SRC,
-                    deps='SERVER_MUTEX ndr-krb5pac krb5samba',
+                    deps='SERVER_MUTEX ndr-krb5pac krb5samba gssapi',
                    vars=locals())
 
 bld.SAMBA3_SUBSYSTEM('LIBADS_PRINTER',
index efd84437608f4b96188594ec2ec3b9212cc825f8..31964731d5ac60eb40802c4abbc06d0acfbc1c07 100644 (file)
@@ -24,6 +24,7 @@
 #include "includes.h"
 #include "lib/events/events.h"
 #include "system/kerberos.h"
+#include "system/gssapi.h"
 #include "auth/kerberos/kerberos.h"
 #include "librpc/gen_ndr/krb5pac.h"
 #include "auth/auth.h"
@@ -37,9 +38,6 @@
 #include "auth/gensec/gensec_toplevel_proto.h"
 #include "param/param.h"
 #include "auth/session_proto.h"
-#include <gssapi/gssapi.h>
-#include <gssapi/gssapi_krb5.h>
-#include <gssapi/gssapi_spnego.h>
 #include "gensec_gssapi.h"
 #include "lib/util/util_net.h"
 #include "auth/kerberos/pac_utils.h"
index 4125f395486357dd71488e24d56cd8e2b91b0b6f..e90f8a6e1989b3bed2be50484deb66cf349db3d8 100644 (file)
@@ -22,6 +22,7 @@
 
 #include "includes.h"
 #include "system/kerberos.h"
+#include "system/gssapi.h"
 #include <tevent.h>
 #include "auth/kerberos/kerberos.h"
 #include "lib/socket/socket.h"
index 2ba6d56410725966c02104a6df866a9c7941d3ff..1a9b544465c868530df57c64d745ff9245d45639 100755 (executable)
@@ -2,7 +2,7 @@
 
 bld.SAMBA_SUBSYSTEM('KRB_INIT_CTX',
                    source='krb5_init_context.c',
-                   deps='krb5samba'
+                   deps='gssapi krb5samba'
                   )
 
 bld.SAMBA_LIBRARY('authkrb5',
index e64128f44abcf01fec1aa4cfa72daa3241d48d19..1c03b341069be571fc4ca3da2d66e143c3340408 100644 (file)
@@ -147,6 +147,7 @@ conf.define('HAVE_KRB5_PDU_NONE_DECL', 1)
 conf.define('HAVE_ENCTYPE_AES128_CTS_HMAC_SHA1_96', 1)
 conf.define('HAVE_ENCTYPE_AES256_CTS_HMAC_SHA1_96', 1)
 conf.define('HAVE_KRB5_KRB5_PRINCIPAL_GET_NUM_COMP', 1)
+conf.define('HAVE_GSSAPI_GSSAPI_SPNEGO_H', 1)
 
 heimdal_includedirs = []
 heimdal_libdirs = []
index 8097a67ab9ea5f00aea042bfa13efd16803d0b04..a1651b0f02df9cf33d729579fdec1f7b29c4f809 100644 (file)
@@ -38,7 +38,7 @@
 #include "lib/socket/socket.h"
 #include "auth/credentials/credentials.h"
 #include "auth/credentials/credentials_krb5.h"
-#include <gssapi/gssapi.h>
+#include "system/gssapi.h"
 #include "system/locale.h"
 
 /* this is the private structure used to keep the state of an open