sasl.patch 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. --- plugins/mysql.c.orig Wed May 14 20:46:02 2003
  2. +++ plugins/mysql.c Fri Jul 4 10:11:16 2003
  3. @@ -254,6 +254,7 @@
  4. MYSQL mysql,*sock = NULL;
  5. MYSQL_RES *result;
  6. MYSQL_ROW row;
  7. + unsigned long *rlen;
  8. /* setup the settings */
  9. settings = (struct mysql_settings *)glob_context;
  10. @@ -326,6 +327,7 @@
  11. "mysql plugin try and connect to %s\n",
  12. cur_host);
  13. + mysql_init(&mysql);
  14. sock = mysql_real_connect(&mysql,cur_host,
  15. settings->mysql_user,
  16. settings->mysql_passwd,
  17. @@ -408,8 +410,10 @@
  18. /* now get the result set value and value_len */
  19. /* we only fetch one becuse we dont car about the rest */
  20. row = mysql_fetch_row(result);
  21. - strncpy(value,row[0],8190);
  22. - value_len = strlen(value);
  23. + rlen = mysql_fetch_lengths(result);
  24. + value_len = rlen[0] > 8190 ? 8190 : rlen[0];
  25. + memcpy(value, row[0], value_len);
  26. + value[value_len] = '\0';
  27. sparams->utils->prop_set(sparams->propctx, cur->name,
  28. value, value_len);
  29. --- lib/server.c.orig Wed Apr 16 21:36:01 2003
  30. +++ lib/server.c Fri Jul 4 10:07:52 2003
  31. @@ -390,18 +390,9 @@
  32. unsigned path_len;
  33. char *config_filename=NULL;
  34. int len;
  35. - const sasl_callback_t *getpath_cb=NULL;
  36. - /* get the path to the plugins; for now the config file will reside there */
  37. - getpath_cb=_sasl_find_getpath_callback( global_callbacks.callbacks );
  38. - if (getpath_cb==NULL) return SASL_BADPARAM;
  39. -
  40. - /* getpath_cb->proc MUST be a sasl_getpath_t; if only c had a type
  41. - system */
  42. - result = ((sasl_getpath_t *)(getpath_cb->proc))(getpath_cb->context,
  43. - &path_to_config);
  44. - if (result!=SASL_OK) goto done;
  45. - if (path_to_config == NULL) path_to_config = "";
  46. + result = SASL_OK;
  47. + path_to_config = "@l_sysconfdir@";
  48. c = strchr(path_to_config, PATHS_DELIMITER);