summaryrefslogtreecommitdiffstats
path: root/daemons/ipa-kdb/ipa_kdb.c
blob: ba0bd2f0c6c2accbf4ee1da2c3b2417a40fe8d5f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
/*
 * MIT Kerberos KDC database backend for FreeIPA
 *
 * Authors: Simo Sorce <ssorce@redhat.com>
 *
 * Copyright (C) 2011  Simo Sorce, Red Hat
 * see file 'COPYING' for use and warranty information
 *
 * This program is free software you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#include <kdb.h>

static krb5_error_code ipadb_init_library(void)
{
    return KRB5_PLUGIN_OP_NOTSUPP;
}

static krb5_error_code ipadb_fini_library(void)
{
    return KRB5_PLUGIN_OP_NOTSUPP;
}

static krb5_error_code ipadb_init_module(krb5_context kcontext,
                                         char *conf_section,
                                         char **db_args, int mode)
{
    return KRB5_PLUGIN_OP_NOTSUPP;
}

static krb5_error_code ipadb_fini_module(krb5_context kcontext)
{
    return KRB5_PLUGIN_OP_NOTSUPP;
}

static krb5_error_code ipadb_create(krb5_context kcontext,
                                    char *conf_section,
                                    char **db_args)
{
    return KRB5_PLUGIN_OP_NOTSUPP;
}

static krb5_error_code ipadb_get_age(krb5_context kcontext,
                                     char *db_name, time_t *age)
{
    return KRB5_PLUGIN_OP_NOTSUPP;
}

static krb5_error_code ipadb_get_principal(krb5_context kcontext,
                                           krb5_const_principal search_for,
                                           unsigned int flags,
                                           krb5_db_entry **entry)
{
    return KRB5_PLUGIN_OP_NOTSUPP;
}

void ipadb_free_principal(krb5_context kcontext, krb5_db_entry *entry)
{
    return;
}

static krb5_error_code ipadb_put_principal(krb5_context kcontext,
                                           krb5_db_entry *entry,
                                           char **db_args)
{
    return KRB5_PLUGIN_OP_NOTSUPP;
}

static krb5_error_code ipadb_delete_principal(krb5_context kcontext,
                                              krb5_const_principal search_for)
{
    return KRB5_PLUGIN_OP_NOTSUPP;
}

static krb5_error_code ipadb_iterate(krb5_context kcontext,
                                     char *match_entry,
                                     int (*func)(krb5_pointer,
                                                 krb5_db_entry *),
                                     krb5_pointer func_arg)
{
    return KRB5_PLUGIN_OP_NOTSUPP;
}

static krb5_error_code ipadb_create_policy(krb5_context kcontext,
                                           osa_policy_ent_t policy)
{
    return KRB5_PLUGIN_OP_NOTSUPP;
}

static krb5_error_code ipadb_get_policy(krb5_context kcontext, char *name,
                                        osa_policy_ent_t *policy)
{
    return KRB5_PLUGIN_OP_NOTSUPP;
}

static krb5_error_code ipadb_put_policy(krb5_context kcontext,
                                        osa_policy_ent_t policy)
{
    return KRB5_PLUGIN_OP_NOTSUPP;
}

static krb5_error_code ipadb_iterate_policy(krb5_context kcontext,
                                            char *match_entry,
                                            osa_adb_iter_policy_func func,
                                            void *data)
{
    return KRB5_PLUGIN_OP_NOTSUPP;
}

static krb5_error_code ipadb_delete_policy(krb5_context kcontext,
                                           char *policy)
{
    return KRB5_PLUGIN_OP_NOTSUPP;
}

static void ipadb_free_policy(krb5_context kcontext, osa_policy_ent_t val)
{
    return;
}

static void *ipadb_alloc(krb5_context context, void *ptr, size_t size)
{
    return realloc(ptr, size);
}

static void ipadb_free(krb5_context context, void *ptr)
{
    free(ptr);
}

/* KDB Virtual Table */

kdb_vftabl kdb_function_table = {
    KRB5_KDB_DAL_MAJOR_VERSION,         /* major version number */
    0,                                  /* minor version number */
    ipadb_init_library,                 /* init_library */
    ipadb_fini_library,                 /* fini_library */
    ipadb_init_module,                  /* init_module */
    ipadb_fini_module,                  /* fini_module */
    ipadb_create,                       /* create */
    NULL,                               /* destroy */
    ipadb_get_age,                      /* get_age */
    NULL,                               /* lock */
    NULL,                               /* unlock */
    ipadb_get_principal,                /* get_principal */
    ipadb_free_principal,               /* free_principal */
    ipadb_put_principal,                /* put_principal */
    ipadb_delete_principal,             /* delete_principal */
    ipadb_iterate,                      /* iterate */
    ipadb_create_policy,                /* create_policy */
    ipadb_get_policy,                   /* get_policy */
    ipadb_put_policy,                   /* put_policy */
    ipadb_iterate_policy,               /* iter_policy */
    ipadb_delete_policy,                /* delete_policy */
    ipadb_free_policy,                  /* free_policy */
    ipadb_alloc,                        /* alloc */
    ipadb_free,                         /* free */
    NULL,                               /* fetch_master_key */
    NULL,                               /* fetch_master_key_list */
    NULL,                               /* store_master_key_list */
    NULL,                               /* dbe_search_enctype */
    NULL,                               /* change_pwd */
    NULL,                               /* promote_db */
    NULL,                               /* decrypt_key_data */
    NULL,                               /* encrypt_key_data */
    NULL,                               /* sign_authdata */
    NULL,                               /* check_transited_realms */
    NULL,                               /* check_policy_as */
    NULL,                               /* check_policy_tgs */
    NULL,                               /* audit_as_req */
    NULL,                               /* refresh_config */
    NULL                                /* check_allowed_to_delegate */
};