Merge in the libkdc/kdc configuration split from Andrew Bartlet <abartlet@samba.org>
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@15529 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
20
kdc/misc.c
20
kdc/misc.c
@@ -38,7 +38,10 @@ RCSID("$Id$");
|
||||
struct timeval now;
|
||||
|
||||
krb5_error_code
|
||||
db_fetch(krb5_principal principal, hdb_entry **h)
|
||||
db_fetch(krb5_context context,
|
||||
struct krb5_kdc_configuration *config,
|
||||
krb5_principal principal,
|
||||
hdb_entry **h)
|
||||
{
|
||||
hdb_entry *ent;
|
||||
krb5_error_code ret = HDB_ERR_NOENTRY;
|
||||
@@ -49,15 +52,18 @@ db_fetch(krb5_principal principal, hdb_entry **h)
|
||||
return ENOMEM;
|
||||
ent->principal = principal;
|
||||
|
||||
for(i = 0; i < num_db; i++) {
|
||||
ret = db[i]->hdb_open(context, db[i], O_RDONLY, 0);
|
||||
for(i = 0; i < config->num_db; i++) {
|
||||
ret = config->db[i]->hdb_open(context, config->db[i], O_RDONLY, 0);
|
||||
if (ret) {
|
||||
kdc_log(0, "Failed to open database: %s",
|
||||
kdc_log(context, config, 0, "Failed to open database: %s",
|
||||
krb5_get_err_text(context, ret));
|
||||
continue;
|
||||
}
|
||||
ret = db[i]->hdb_fetch(context, db[i], HDB_F_DECRYPT, ent);
|
||||
db[i]->hdb_close(context, db[i]);
|
||||
ret = config->db[i]->hdb_fetch(context,
|
||||
config->db[i],
|
||||
HDB_F_DECRYPT,
|
||||
ent);
|
||||
config->db[i]->hdb_close(context, config->db[i]);
|
||||
if(ret == 0) {
|
||||
*h = ent;
|
||||
return 0;
|
||||
@@ -68,7 +74,7 @@ db_fetch(krb5_principal principal, hdb_entry **h)
|
||||
}
|
||||
|
||||
void
|
||||
free_ent(hdb_entry *ent)
|
||||
free_ent(krb5_context context, hdb_entry *ent)
|
||||
{
|
||||
hdb_free_entry (context, ent);
|
||||
free (ent);
|
||||
|
Reference in New Issue
Block a user