sasl.patch 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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);
  76. --- lib/server.c.dist Mon Apr 7 16:48:41 2003
  77. +++ lib/server.c Mon Apr 7 16:52:27 2003
  78. @@ -379,18 +379,9 @@
  79. char *c;
  80. char *config_filename=NULL;
  81. int len;
  82. - const sasl_callback_t *getpath_cb=NULL;
  83. - /* get the path to the plugins; for now the config file will reside there */
  84. - getpath_cb=_sasl_find_getpath_callback( global_callbacks.callbacks );
  85. - if (getpath_cb==NULL) return SASL_BADPARAM;
  86. -
  87. - /* getpath_cb->proc MUST be a sasl_getpath_t; if only c had a type
  88. - system */
  89. - result = ((sasl_getpath_t *)(getpath_cb->proc))(getpath_cb->context,
  90. - &path_to_config);
  91. - if (result!=SASL_OK) goto done;
  92. - if (path_to_config == NULL) path_to_config = "";
  93. + result = SASL_OK;
  94. + path_to_config = "@l_sysconfdir@";
  95. if ((c = strchr(path_to_config, PATHS_DELIMITER))) {
  96. *c = '\0';