db_none.c 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. /* db_none.c--provides linkage for systems which lack a backend db lib
  2. * Rob Siemborski
  3. * Rob Earhart
  4. */
  5. /*
  6. * Copyright (c) 1998-2016 Carnegie Mellon University. All rights reserved.
  7. *
  8. * Redistribution and use in source and binary forms, with or without
  9. * modification, are permitted provided that the following conditions
  10. * are met:
  11. *
  12. * 1. Redistributions of source code must retain the above copyright
  13. * notice, this list of conditions and the following disclaimer.
  14. *
  15. * 2. Redistributions in binary form must reproduce the above copyright
  16. * notice, this list of conditions and the following disclaimer in
  17. * the documentation and/or other materials provided with the
  18. * distribution.
  19. *
  20. * 3. The name "Carnegie Mellon University" must not be used to
  21. * endorse or promote products derived from this software without
  22. * prior written permission. For permission or any other legal
  23. * details, please contact
  24. * Carnegie Mellon University
  25. * Center for Technology Transfer and Enterprise Creation
  26. * 4615 Forbes Avenue
  27. * Suite 302
  28. * Pittsburgh, PA 15213
  29. * (412) 268-7393, fax: (412) 268-7395
  30. * innovation@andrew.cmu.edu
  31. *
  32. * 4. Redistributions of any form whatsoever must retain the following
  33. * acknowledgment:
  34. * "This product includes software developed by Computing Services
  35. * at Carnegie Mellon University (http://www.cmu.edu/computing/)."
  36. *
  37. * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO
  38. * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  39. * AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE
  40. * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  41. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
  42. * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
  43. * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  44. */
  45. #include <config.h>
  46. #include "sasldb.h"
  47. /* This just exists to provide these symbols on systems where configure
  48. * couldn't find a database library (or the user says we do not want one). */
  49. int _sasldb_getdata(const sasl_utils_t *utils,
  50. sasl_conn_t *conn,
  51. const char *authid __attribute__((unused)),
  52. const char *realm __attribute__((unused)),
  53. const char *propName __attribute__((unused)),
  54. char *out __attribute__((unused)),
  55. const size_t max_out __attribute__((unused)),
  56. size_t *out_len __attribute__((unused)))
  57. {
  58. if(conn) utils->seterror(conn, 0, "No Database Driver");
  59. return SASL_FAIL;
  60. }
  61. int _sasldb_putdata(const sasl_utils_t *utils,
  62. sasl_conn_t *conn,
  63. const char *authid __attribute__((unused)),
  64. const char *realm __attribute__((unused)),
  65. const char *propName __attribute__((unused)),
  66. const char *data __attribute__((unused)),
  67. size_t data_len __attribute__((unused)))
  68. {
  69. if(conn) utils->seterror(conn, 0, "No Database Driver");
  70. return SASL_FAIL;
  71. }
  72. int _sasl_check_db(const sasl_utils_t *utils,
  73. sasl_conn_t *conn)
  74. {
  75. if(conn) utils->seterror(conn, 0, "No Database Driver");
  76. return SASL_FAIL;
  77. }
  78. sasldb_handle _sasldb_getkeyhandle(const sasl_utils_t *utils,
  79. sasl_conn_t *conn)
  80. {
  81. if(conn) utils->seterror(conn, 0, "No Database Driver");
  82. return NULL;
  83. }
  84. int _sasldb_getnextkey(const sasl_utils_t *utils __attribute__((unused)),
  85. sasldb_handle handle __attribute__((unused)),
  86. char *out __attribute__((unused)),
  87. const size_t max_out __attribute__((unused)),
  88. size_t *out_len __attribute__((unused)))
  89. {
  90. return SASL_FAIL;
  91. }
  92. int _sasldb_releasekeyhandle(const sasl_utils_t *utils __attribute__((unused)),
  93. sasldb_handle handle __attribute__((unused)))
  94. {
  95. return SASL_FAIL;
  96. }