[Date Prev][Date Next] [Chronological] [Thread] [Top]

MySQL and openldap - a patch for the CVS version



Hello

        I've been trying to use the SQL backend for OpenLDAP (to store data which is written frequently). I was having problems with non-objectClass filters. I looked at the current cvs code and
saw that some work had been done in that area, so...

        Of all the files in the OpenLDAP repository, the one I wanted to use (search.c in back-sql) failed to compile. :-(

bash-2.05a$ make 
/bin/sh /home/bob/mysql_ldap/cvs/ldap/libtool --only-static --mode=compile cc -g -O2 -I../../../include        -I../../../include -I.. -I./..      -c search.c
cc -g -O2 -I../../../include -I../../../include -I.. -I./.. -c search.c -o search.o
search.c: In function `backsql_search':
search.c:618: too few arguments to function `get_entry_referrals'
search.c:620: warning: passing arg 6 of `send_search_reference' makes pointer from integer without a cast
search.c:620: too many arguments to function `send_search_reference'
make: *** [search.lo] Error 1

         The header file seemed to concur with this diagnosis.

         Delving further, with the help of mr. find and mr. grep, I found that there were recent changes to back-ldbm/search.c 1.62 and 1.63. where these two function calls are changed (functions now in referral.c).

         So, I reflected these changes in parameter lists into back-sql/search.c. I am not a (very recent) C programmer, so the changes I made may be spurious. However, the code now compiles, so I am submitting the patch to you for vet[t|o]ing. I think the change I have made is correct, but....

Bob

bash-2.05a$ diff -u search.c search.new
--- search.c	Tue Dec 18 14:50:17 2001
+++ search.new	Tue Dec 18 14:31:57 2001
@@ -615,9 +615,13 @@
    if ( !manageDSAit && scope != LDAP_SCOPE_BASE &&
 			is_entry_referral( entry ) )
     {
+/* bob 18.12.2001 - following diffs between back-ldbm/search.c 1.62 and 1.63    
      struct berval **refs = get_entry_referrals(be,conn,op,entry);
 
      send_search_reference( be, conn, op, entry, refs, scope, NULL, &v2refs );
+*/
+     struct berval **refs = get_entry_referrals(be,conn,op,entry,base,scope);
+     send_search_reference( be, conn, op, entry, refs, NULL, &v2refs );
      ber_bvecfree( refs );
      continue;
     }
--
Nationalism is an infantile sickness. It is the measles of the human race.   
 - Albert Einstein

Attachment: pgpbn4nPXwCiF.pgp
Description: PGP signature