Make Samba compile on RH 6.2 again.
authorAndrew Bartlett <abartlet@samba.org>
Sun, 30 Dec 2001 05:59:43 +0000 (05:59 +0000)
committerAndrew Bartlett <abartlet@samba.org>
Sun, 30 Dec 2001 05:59:43 +0000 (05:59 +0000)
We now include the libber.h file if required, but currently we just don't use
ldap.  (I'll chase this up).

In the meantime, I've moved the ads_status code about, its now in its own file,
and has a couple of #ifdefs to allow smbd to link - becouse the lack of LDAP
caused HAVE_ADS to be undefined. (I hope its not too ugly).

Andrew Bartlett
(This used to be commit 14407c87e2dcccae1784290e3eb7a2d611516aff)

source3/Makefile.in
source3/configure
source3/configure.in
source3/include/config.h.in
source3/include/includes.h
source3/libads/ads_status.c [new file with mode: 0644]
source3/libads/ldap.c

index 6b9bcb0ee71a7826536f2f5ae736b0abc944a3d6..3b0795bd1d6e3151d4e4cb4fc39c9afe5a4d1df3 100644 (file)
@@ -133,7 +133,8 @@ UBIQX_OBJ = ubiqx/ubi_BinTree.o ubiqx/ubi_Cache.o ubiqx/ubi_SplayTree.o \
 PARAM_OBJ = param/loadparm.o param/params.o dynconfig.o
 
 LIBADS_OBJ = libads/ldap.o libads/sasl.o libads/krb5_setpw.o libads/kerberos.o \
-            libads/ads_struct.o passdb/secrets.o libads/util.o
+            libads/ads_struct.o libads/ads_status.o passdb/secrets.o \
+             libads/util.o
 
 LIBSMB_OBJ = libsmb/clientgen.o libsmb/cliconnect.o libsmb/clifile.o \
             libsmb/clikrb5.o libsmb/clispnego.o libsmb/asn1.o \
index 10a497669d4a71a0b88c3e191f7455d41e265e74..1497175bfc83da28ea265c7ce4132a525cb08fcd 100755 (executable)
@@ -2172,7 +2172,7 @@ else
 fi
 done
 
-for ac_hdr in security/pam_modules.h security/_pam_macros.h ldap.h
+for ac_hdr in security/pam_modules.h security/_pam_macros.h ldap.h lber.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
index 059936e0a457f85f1da180482178060aa83c51c8..d3f13e586a0f3529c0183296e8c48536e15d55ba 100644 (file)
@@ -257,7 +257,7 @@ AC_CHECK_HEADERS(sys/param.h ctype.h sys/wait.h sys/resource.h sys/ioctl.h sys/i
 AC_CHECK_HEADERS(sys/mman.h sys/filio.h sys/priv.h sys/shm.h string.h strings.h stdlib.h sys/socket.h)
 AC_CHECK_HEADERS(sys/mount.h sys/vfs.h sys/fs/s5param.h sys/filsys.h termios.h termio.h)
 AC_CHECK_HEADERS(sys/termio.h sys/statfs.h sys/dustat.h sys/statvfs.h stdarg.h sys/sockio.h)
-AC_CHECK_HEADERS(security/pam_modules.h security/_pam_macros.h ldap.h)
+AC_CHECK_HEADERS(security/pam_modules.h security/_pam_macros.h ldap.h lber.h)
 
 #
 # HPUX has a bug in that including shadow.h causes a re-definition of MAXINT.
index f85de1b1af1cedf8e53308e9574dc4ee101bbb17..9aa9a1b203d4220a540f737fdcfcec636684e887 100644 (file)
 /* Define if you have the <lastlog.h> header file.  */
 #undef HAVE_LASTLOG_H
 
+/* Define if you have the <lber.h> header file.  */
+#undef HAVE_LBER_H
+
 /* Define if you have the <ldap.h> header file.  */
 #undef HAVE_LDAP_H
 
index 92ac462e1b1cb8d1be037d7fc789f65f5e879f2b..3a4c50ab9a66638f9e265eda946fb3a1f144f0a1 100644 (file)
 #undef HAVE_KRB5
 #endif
 
+#if HAVE_LBER_H
+#include <lber.h>
+#endif
+
 #if HAVE_LDAP_H
 #include <ldap.h>
 #else
diff --git a/source3/libads/ads_status.c b/source3/libads/ads_status.c
new file mode 100644 (file)
index 0000000..6dac335
--- /dev/null
@@ -0,0 +1,91 @@
+/* 
+   Unix SMB/Netbios implementation.
+   Version 3.0
+   ads (active directory) utility library
+   Copyright (C) Andrew Tridgell 2001
+   Copyright (C) Remus Koos 2001
+   Copyright (C) Andrew Bartlett 2001
+   
+   
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+   
+   This program 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 General Public License for more details.
+   
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+
+#include "includes.h"
+
+/*
+  build a ADS_STATUS structure
+*/
+ADS_STATUS ads_build_error(enum ads_error_type etype, 
+                          int rc, int minor_status)
+{
+       ADS_STATUS ret;
+       ret.error_type = etype;
+       ret.rc = rc;
+       ret.minor_status = minor_status;
+       return ret;
+}
+
+/*
+  do a rough conversion between ads error codes and NT status codes
+  we'll need to fill this in more
+*/
+NTSTATUS ads_ntstatus(ADS_STATUS rc)
+{
+       if (ADS_ERR_OK(rc)) return NT_STATUS_OK;
+       return NT_STATUS_UNSUCCESSFUL;
+}
+
+/*
+  return a string for an error from a ads routine
+*/
+const char *ads_errstr(ADS_STATUS status)
+{
+       gss_buffer_desc msg1, msg2;
+       uint32 minor;
+       int msg_ctx;
+       static char *ret;
+
+       SAFE_FREE(ret);
+       msg_ctx = 0;
+
+       switch (status.error_type) {
+       case ADS_ERROR_SYSTEM:
+               return strerror(status.rc);
+#ifdef HAVE_LDAP
+       case ADS_ERROR_LDAP:
+               return ldap_err2string(status.rc);
+#endif
+#ifdef HAVE_KRB5
+       case ADS_ERROR_KRB5: 
+               return error_message(status.rc);
+       case ADS_ERROR_GSS:
+               msg1.value = NULL;
+               msg2.value = NULL;
+               gss_display_status(&minor, status.rc, GSS_C_GSS_CODE,
+                                  GSS_C_NULL_OID, &msg_ctx, &msg1);
+               gss_display_status(&minor, status.minor_status, GSS_C_MECH_CODE,
+                                  GSS_C_NULL_OID, &msg_ctx, &msg2);
+               asprintf(&ret, "%s : %s", (char *)msg1.value, (char *)msg2.value);
+               gss_release_buffer(&minor, &msg1);
+               gss_release_buffer(&minor, &msg2);
+               return ret;
+#endif
+       default:
+               return "Unknown ADS error type!? (not compiled in?)";
+       }
+
+}
+
+
index 8966ceb32a9c263d99cc4a4b10c01abeb5609bda..5503b6e3535d900e8a64aeeea537bfd71fcbb043 100644 (file)
 
 #ifdef HAVE_ADS
 
-/*
-  build a ADS_STATUS structure
-*/
-ADS_STATUS ads_build_error(enum ads_error_type etype, 
-                          int rc, int minor_status)
-{
-       ADS_STATUS ret;
-       ret.error_type = etype;
-       ret.rc = rc;
-       ret.minor_status = minor_status;
-       return ret;
-}
-
-/*
-  do a rough conversion between ads error codes and NT status codes
-  we'll need to fill this in more
-*/
-NTSTATUS ads_ntstatus(ADS_STATUS rc)
-{
-       if (ADS_ERR_OK(rc)) return NT_STATUS_OK;
-       return NT_STATUS_UNSUCCESSFUL;
-}
-
-/*
-  return a string for an error from a ads routine
-*/
-const char *ads_errstr(ADS_STATUS status)
-{
-       gss_buffer_desc msg1, msg2;
-       uint32 minor;
-       int msg_ctx;
-       static char *ret;
-
-       SAFE_FREE(ret);
-       msg_ctx = 0;
-
-       switch (status.error_type) {
-       case ADS_ERROR_KRB5: 
-               return error_message(status.rc);
-       case ADS_ERROR_LDAP:
-               return ldap_err2string(status.rc);
-       case ADS_ERROR_SYSTEM:
-               return strerror(status.rc);
-       case ADS_ERROR_GSS:
-               msg1.value = NULL;
-               msg2.value = NULL;
-               gss_display_status(&minor, status.rc, GSS_C_GSS_CODE,
-                                  GSS_C_NULL_OID, &msg_ctx, &msg1);
-               gss_display_status(&minor, status.minor_status, GSS_C_MECH_CODE,
-                                  GSS_C_NULL_OID, &msg_ctx, &msg2);
-               asprintf(&ret, "%s : %s", (char *)msg1.value, (char *)msg2.value);
-               gss_release_buffer(&minor, &msg1);
-               gss_release_buffer(&minor, &msg2);
-               return ret;
-       }
-
-       return "Unknown ADS error type!?";
-}
-
 /*
   connect to the LDAP server
 */