[PATCH] -- Re: [JDEV] coredump with xdb_sql and user profile changes

Benjamin Ritcey jdev at ritcey.com
Wed Oct 10 14:37:27 CDT 2001

Benoit Orihuela wrote:

> the xdb section in jabber.xml looks strange ... do you really need
> that xdb_file and xdb_sql handle the same namespaces ?

I'm not sure -- that is the example given at 
http://nuthole.homeip.net/howto/how-to-xdb_sql -- I assume some overlap 
is necessary, for the things that xdb_sql can't handle (like the user 
prefs that JIM sends).

>>if the vcard could be 
>>flat-out disabled to fix this, that would be fine too.
> to remove the vcard, you just need to remove the vcard-temp namespace
> from the xdb section.

I tried that, but then JIM just wouldn't start up.

At any rate, now that nuthole.homeip.net is back up, I was able to get 
the modified version of xdb_sql -- I already sent you the patch for the 
groups support, and it appears someone already fixed this problem =) 
After applying the changes below, the memory corruption and crash with 
the user profiles went away.  The profiles now update (almost) correctly 
-- the only remaining problem is that the e-mail address won't update.

Not sure why the e-mail isn't being updated - perhaps because JIM (and 
all clients?) send two e-mail addresses in the vcard (a preferred and 
secondary), and that the code in xdb_sql_vcard.c is grabbing the last 
(empty) one?

At any rate, thanks for your help and I hope the patch helps - I also 
hope a new xdb_sql release is made with these fixes, to help the others 
who may have been banging their heads against the wall =)  Oh, and I 
also changed the sample_database.sql script to set username to 64 chars, 
instead of the default 32 (which was too small in my case) -- I can send 
diffs for that as well, if you like.

Thanks again,


--- xdb_sql_vcard.c     Mon Mar 19 12:08:45 2001
+++ xdb_sql_vcard.c.modified    Wed Oct 10 15:19:22 2001
@@ -22,6 +22,7 @@
      xmlnode rc = NULL;         /* return from this function */
      xmlnode x  = NULL;         /* */
      xmlnode query;             /* the query for this function */
+    xmlnode vcard;             /* the vcard*/
      query_def qd;              /* the query definition */
      XdbSqlResult *result;      /* pointer to database result */
      int first = 1;             /* first time through loop? */
@@ -90,8 +91,9 @@
      } /* end if */

      /* Initialize the return value. */
-    rc = xmlnode_new_tag("query");
+    rc = xmlnode_new_tag("vcard");
+    vcard = xmlnode_insert_tag(rc,"vcard");

      while (sqldb_next_tuple(result))
      { /* look for all vcard vCards and add them to the list */

The following comment was near these changes:

/* Added S.R.L. May 15, 2001*/

More information about the JDev mailing list