LDAP Fixes

Matt Roberts mattro at cowboy.net
Mon Jul 7 20:17:48 GMT 2003


Developers,

Please find attached a simple diff that includes some changes I made to
source files to get LDAP code to compile on my SuSE 8 box.  I have been
using this host to compile previous 3.0 versions without problems.

The IMMEDIATE_STRUCUTRES is just a work-around.  I think there is most
likely a detection for this somewhere that isn't working quite right, or
my compiler is just too old.  I am using gcc 3.0.4.

Also, when I run 'configure,' the resulting Makefile is missing a couple
of items.  I also had to repair these, as follows:

1.  Add -lldap to PASSDBLIBS and LDAPLIBS. -llber was already there.
2.  Add lib/smbldap.o to SMBLDAP_OBJ.

The diff of the source code follows.  If you need to see anything else
from my build for this to be useful, please let me know.

Thanks,
Matt



-------------------------------------------


diff -C 3 -r samba-orig/source/include/ads.h samba/source/include/ads.h
*** samba-orig/source/include/ads.h     Mon Jun  9 22:47:36 2003
--- samba/source/include/ads.h  Mon Jul  7 12:18:56 2003
***************
*** 4,9 ****
--- 4,12 ----
    basically this is a wrapper around ldap
  */

+ #ifndef _SAMBA_ADS_H
+ #define _SAMBA_ADS_H
+
  typedef struct {
        void *ld; /* the active ldap structure */
        struct in_addr ldap_ip; /* the ip of the active connection, if any */
***************
*** 221,223 ****
--- 224,228 ----
  #ifndef AP_OPTS_USE_SUBKEY
  #define AP_OPTS_USE_SUBKEY 0
  #endif
+
+ #endif /* _SAMBA_ADS_H */
diff -C 3 -r samba-orig/source/include/nt_status.h samba/source/include/nt_status.h
*** samba-orig/source/include/nt_status.h       Sat Nov  9 08:49:26 2002
--- samba/source/include/nt_status.h    Mon Jul  7 12:31:06 2003
***************
*** 34,39 ****
--- 34,43 ----
     from using BOOL for internal functions
  */

+ #if 1
+ #undef HAVE_IMMEDIATE_STRUCTURES
+ #endif
+
  #if defined(HAVE_IMMEDIATE_STRUCTURES)
  typedef struct {uint32 v;} NTSTATUS;
  #define NT_STATUS(x) ((NTSTATUS) { x })
diff -C 3 -r samba-orig/source/include/smbldap.h samba/source/include/smbldap.h
*** samba-orig/source/include/smbldap.h Fri Jul  4 08:29:41 2003
--- samba/source/include/smbldap.h      Mon Jul  7 12:20:03 2003
***************
*** 22,29 ****
--- 22,34 ----
  #ifndef _SMBLDAP_H
  #define _SMBLDAP_H

+ #define HAVE_LDAP 1
  #ifdef HAVE_LDAP

+ #include <ads.h>
+ #include <lber.h>
+ #include <ldap.h>
+
  /* specify schema versions between 2.2. and 3.0 */

  #define SCHEMAVER_SAMBAACCOUNT                1





More information about the samba-technical mailing list