Full_Name: Ben Schmidt
Version: 2.4.10
OS: MinGW32, Mac OS X
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (124.168.9.190)


I have recently cross-compiled OpenLDAP for MinGW32 on Mac OS X. In so doing, I
discovered the following platform-specific issue.

The executables on Win32 have a .exe extension, so slapd does not detect the
tool names and act accordingly. Consequently, slapadd, slaptest, etc. all act
the same as slapd!

I solved the problem by patching main.c as follows:

diff -ru --exclude=Makefile openldap-2.4.10/servers/slapd/main.c
openldap/servers/slapd/main.c
--- openldap-2.4.10/servers/slapd/main.c        2008-05-20 10:10:40.000000000 
+1000
+++ openldap/servers/slapd/main.c       2008-06-28 21:56:09.000000000 +1000
@@ -71,14 +71,14 @@
        char *name;
        MainFunc *func;
 } tools[] = {
-       {"slapadd", slapadd},
-       {"slapcat", slapcat},
-       {"slapdn", slapdn},
-       {"slapindex", slapindex},
-       {"slappasswd", slappasswd},
-       {"slaptest", slaptest},
-       {"slapauth", slapauth},
-       {"slapacl", slapacl},
+       {"slapadd.exe", slapadd},
+       {"slapcat.exe", slapcat},
+       {"slapdn.exe", slapdn},
+       {"slapindex.exe", slapindex},
+       {"slappasswd.exe", slappasswd},
+       {"slaptest.exe", slaptest},
+       {"slapauth.exe", slapauth},
+       {"slapacl.exe", slapacl},
        /* NOTE: new tools must be added in chronological order,
         * not in alphabetical order, because for backwards
         * compatibility name[4] is used to identify the

Obviously this exact fix is not appropriate, because it will break every other
platform, but I am not sure of the appropriate preprocessor directive to use to
address this, as I guess it would also break a cygwin build, and should only be
done for a MinGW32 build. However, it would be helpful to fix with an
appropriate conditional!

I couldn't find a mention of this in your tracker so reporting it now.



Reply via email to