sasl.patch 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. --- saslauthd/lak.c.dist Wed Mar 12 11:39:22 2003
  2. +++ saslauthd/lak.c Wed Mar 12 11:39:22 2003
  3. @@ -532,8 +532,6 @@
  4. return;
  5. if (lak->ld != NULL) {
  6. - if (lak->conf->cache_ttl)
  7. - ldap_destroy_cache(lak->ld);
  8. ldap_unbind_s(lak->ld);
  9. }
  10. @@ -642,16 +640,6 @@
  11. syslog(LOG_WARNING|LOG_AUTH, "Unable to set LDAP_OPT_RESTART.");
  12. }
  13. - /*
  14. - * Set up client-side caching
  15. - */
  16. - if (lak->conf->cache_ttl) {
  17. - rc = ldap_enable_cache(lak->ld, lak->conf->cache_ttl, lak->conf->cache_mem);
  18. - if (rc != LDAP_SUCCESS) {
  19. - syslog(LOG_WARNING|LOG_AUTH, "Unable to enable cache -- continuing (%s)", ldap_err2string(rc));
  20. - }
  21. - }
  22. -
  23. return LAK_OK;
  24. }
  25. @@ -667,8 +655,6 @@
  26. if (lak->bind_status == LAK_NOT_BOUND) {
  27. if (lak->ld != NULL) {
  28. - if (lak->conf->cache_ttl)
  29. - ldap_destroy_cache(lak->ld);
  30. ldap_unbind_s(lak->ld);
  31. lak->ld = NULL;
  32. }
  33. @@ -683,8 +669,6 @@
  34. lak->bind_status = LAK_NOT_BOUND;
  35. if (lak->ld != NULL) {
  36. - if (lak->conf->cache_ttl)
  37. - ldap_destroy_cache(lak->ld);
  38. ldap_unbind_s(lak->ld);
  39. lak->ld = NULL;
  40. --- plugins/mysql.c.dist Fri Mar 7 13:26:42 2003
  41. +++ plugins/mysql.c Fri Apr 4 16:55:38 2003
  42. @@ -254,6 +254,7 @@
  43. MYSQL mysql,*sock = NULL;
  44. MYSQL_RES *result;
  45. MYSQL_ROW row;
  46. + unsigned long *rlen;
  47. /* setup the settings */
  48. settings = (struct mysql_settings *)glob_context;
  49. @@ -325,8 +326,15 @@
  50. sparams->utils->log(NULL, SASL_LOG_WARN,
  51. "mysql plugin try and connect to %s\n",
  52. cur_host);
  53. +#ifdef HAVE_MYSQL_REAL_CONNECT
  54. + mysql_init(&mysql);
  55. + sock = mysql_real_connect(&mysql,cur_host,settings->mysql_user,
  56. + settings->mysql_passwd,
  57. + NULL,0,NULL,CLIENT_COMPRESS);
  58. +#else
  59. sock = mysql_connect(&mysql,cur_host,settings->mysql_user,
  60. settings->mysql_passwd);
  61. +#endif
  62. if (sock) break;
  63. cur_host = db_host;
  64. @@ -405,8 +413,10 @@
  65. /* now get the result set value and value_len */
  66. /* we only fetch one becuse we dont car about the rest */
  67. row = mysql_fetch_row(result);
  68. - strncpy(value,row[0],8190);
  69. - value_len = strlen(value);
  70. + rlen = mysql_fetch_lengths(result);
  71. + value_len = rlen[0] > 8190 ? 8190 : rlen[0];
  72. + memcpy(value, row[0], value_len);
  73. + value[value_len] = '\0';
  74. sparams->utils->prop_set(sparams->propctx, cur->name,
  75. value, value_len);