1/* db_none.c--provides linkage for systems which lack a backend db lib
2 * Rob Siemborski
3 * Rob Earhart
4 * $Id: db_none.c,v 1.5 2005/01/10 19:01:34 snsimon Exp $
5 */
6/*
7 * Copyright (c) 1998-2003 Carnegie Mellon University.  All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 *
13 * 1. Redistributions of source code must retain the above copyright
14 *    notice, this list of conditions and the following disclaimer.
15 *
16 * 2. Redistributions in binary form must reproduce the above copyright
17 *    notice, this list of conditions and the following disclaimer in
18 *    the documentation and/or other materials provided with the
19 *    distribution.
20 *
21 * 3. The name "Carnegie Mellon University" must not be used to
22 *    endorse or promote products derived from this software without
23 *    prior written permission. For permission or any other legal
24 *    details, please contact
25 *      Office of Technology Transfer
26 *      Carnegie Mellon University
27 *      5000 Forbes Avenue
28 *      Pittsburgh, PA  15213-3890
29 *      (412) 268-4387, fax: (412) 268-7395
30 *      tech-transfer@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
46#include <config.h>
47#include "sasldb.h"
48
49/* This just exists to provide these symbols on systems where configure
50 * couldn't find a database library (or the user says we do not want one). */
51int _sasldb_getdata(const sasl_utils_t *utils,
52		    sasl_conn_t *conn,
53		    const char *authid __attribute__((unused)),
54		    const char *realm __attribute__((unused)),
55		    const char *propName __attribute__((unused)),
56		    char *out __attribute__((unused)),
57		    const size_t max_out __attribute__((unused)),
58		    size_t *out_len __attribute__((unused)))
59{
60    if(conn) utils->seterror(conn, 0, "No Database Driver");
61    return SASL_FAIL;
62}
63
64int _sasldb_putdata(const sasl_utils_t *utils,
65		    sasl_conn_t *conn,
66		    const char *authid __attribute__((unused)),
67		    const char *realm __attribute__((unused)),
68		    const char *propName __attribute__((unused)),
69		    const char *data __attribute__((unused)),
70		    size_t data_len __attribute__((unused)))
71{
72    if(conn) utils->seterror(conn, 0, "No Database Driver");
73    return SASL_FAIL;
74}
75
76int _sasl_check_db(const sasl_utils_t *utils,
77		   sasl_conn_t *conn)
78{
79    if(conn) utils->seterror(conn, 0, "No Database Driver");
80    return SASL_FAIL;
81}
82
83sasldb_handle _sasldb_getkeyhandle(const sasl_utils_t *utils,
84                                   sasl_conn_t *conn)
85{
86    if(conn) utils->seterror(conn, 0, "No Database Driver");
87    return NULL;
88}
89
90int _sasldb_getnextkey(const sasl_utils_t *utils __attribute__((unused)),
91                       sasldb_handle handle __attribute__((unused)),
92		       char *out __attribute__((unused)),
93                       const size_t max_out __attribute__((unused)),
94		       size_t *out_len __attribute__((unused)))
95{
96    return SASL_FAIL;
97}
98
99int _sasldb_releasekeyhandle(const sasl_utils_t *utils __attribute__((unused)),
100                             sasldb_handle handle __attribute__((unused)))
101{
102    return SASL_FAIL;
103}
104