s/assert/heim_assert/ and remove dead code
This commit is contained in:
@@ -95,7 +95,7 @@ DB_unlock(krb5_context context, HDB *db)
|
|||||||
db->lock_count--;
|
db->lock_count--;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
assert( db->lock_count == 1 );
|
heim_assert(db->lock_count == 1, "HDB lock/unlock sequence does not match");
|
||||||
db->lock_count--;
|
db->lock_count--;
|
||||||
|
|
||||||
if(fd < 0) {
|
if(fd < 0) {
|
||||||
|
@@ -102,7 +102,7 @@ DB_unlock(krb5_context context, HDB *db)
|
|||||||
db->lock_count--;
|
db->lock_count--;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
assert( db->lock_count == 1 );
|
heim_assert(db->lock_count == 1, "HDB lock/unlock sequence does not match");
|
||||||
db->lock_count--;
|
db->lock_count--;
|
||||||
|
|
||||||
if ((*d->fd)(d, &fd))
|
if ((*d->fd)(d, &fd))
|
||||||
|
@@ -678,7 +678,7 @@ mdb_unlock(krb5_context context, HDB *db)
|
|||||||
db->lock_count--;
|
db->lock_count--;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
assert( db->lock_count == 1 );
|
heim_assert(db->lock_count == 1, "HDB lock/unlock sequence does not match");
|
||||||
db->lock_count--;
|
db->lock_count--;
|
||||||
|
|
||||||
if(fd < 0) {
|
if(fd < 0) {
|
||||||
|
@@ -37,6 +37,7 @@
|
|||||||
#define __HDB_LOCL_H__
|
#define __HDB_LOCL_H__
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
#include <heimbase.h>
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
|
||||||
|
@@ -56,19 +56,6 @@ hdb_free_keys(krb5_context context, int len, Key *keys)
|
|||||||
free (keys);
|
free (keys);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
hdb_free_keysets(krb5_context context, int len, hdb_keyset *keysets)
|
|
||||||
{
|
|
||||||
size_t i;
|
|
||||||
|
|
||||||
for (i = 0; i < len; i++) {
|
|
||||||
hdb_free_keys(context, keysets[i].keys.len, keysets[i].keys.val);
|
|
||||||
keysets[i].keys.val = NULL;
|
|
||||||
keysets[i].keys.len = 0;
|
|
||||||
}
|
|
||||||
free (keysets);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* for each entry in `default_keys' try to parse it as a sequence
|
* for each entry in `default_keys' try to parse it as a sequence
|
||||||
* of etype:salttype:salt, syntax of this if something like:
|
* of etype:salttype:salt, syntax of this if something like:
|
||||||
|
@@ -32,7 +32,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "hdb_locl.h"
|
#include "hdb_locl.h"
|
||||||
#include <assert.h>
|
|
||||||
#ifndef O_BINARY
|
#ifndef O_BINARY
|
||||||
#define O_BINARY 0
|
#define O_BINARY 0
|
||||||
#endif
|
#endif
|
||||||
@@ -484,7 +483,7 @@ krb5_error_code
|
|||||||
hdb_unseal_keys_kvno(krb5_context context, HDB *db, krb5_kvno kvno,
|
hdb_unseal_keys_kvno(krb5_context context, HDB *db, krb5_kvno kvno,
|
||||||
unsigned flags, hdb_entry *ent)
|
unsigned flags, hdb_entry *ent)
|
||||||
{
|
{
|
||||||
krb5_error_code ret = KRB5KRB_AP_ERR_NOKEY; /* XXX need a better code? */
|
krb5_error_code ret = HDB_ERR_NOENTRY;
|
||||||
HDB_extension *ext;
|
HDB_extension *ext;
|
||||||
HDB_Ext_KeySet *hist_keys;
|
HDB_Ext_KeySet *hist_keys;
|
||||||
Key *tmp_val;
|
Key *tmp_val;
|
||||||
@@ -509,8 +508,6 @@ hdb_unseal_keys_kvno(krb5_context context, HDB *db, krb5_kvno kvno,
|
|||||||
kvno_diff = hdb_entry_get_kvno_diff_svc(ent);
|
kvno_diff = hdb_entry_get_kvno_diff_svc(ent);
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(kvno == 0 || kvno < ent->kvno);
|
|
||||||
|
|
||||||
ext = hdb_find_extension(ent, choice_HDB_extension_data_hist_keys);
|
ext = hdb_find_extension(ent, choice_HDB_extension_data_hist_keys);
|
||||||
if (ext == NULL)
|
if (ext == NULL)
|
||||||
return ret;
|
return ret;
|
||||||
@@ -602,32 +599,6 @@ hdb_unseal_keys_kvno(krb5_context context, HDB *db, krb5_kvno kvno,
|
|||||||
*hist_keys->val[i].set_time = tmp_set_time;
|
*hist_keys->val[i].set_time = tmp_set_time;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
#if 0
|
|
||||||
tmp_keys = realloc(hist_keys->val,
|
|
||||||
sizeof (*hist_keys->val) * (hist_keys->len + 1));
|
|
||||||
if (tmp_keys == NULL)
|
|
||||||
return ENOMEM;
|
|
||||||
|
|
||||||
memmove(&tmp_keys[1], tmp_keys,
|
|
||||||
sizeof (*tmp_keys) * hist_keys->len);
|
|
||||||
tmp_keys[0].keys.len = ent->keys.len;
|
|
||||||
tmp_keys[0].keys.val = ent->keys.val;
|
|
||||||
tmp_keys[0].kvno = ent->kvno;
|
|
||||||
tmp_keys[0].set_time = set_time;
|
|
||||||
(void) hdb_entry_get_pw_change_time(ent, tmp_keys[0].set_time);
|
|
||||||
i++;
|
|
||||||
ent->keys.len = tmp_keys[i].keys.len;
|
|
||||||
ent->keys.val = tmp_keys[i].keys.val;
|
|
||||||
ent->kvno = kvno;
|
|
||||||
ent->flags.do_not_store = 1;
|
|
||||||
hist_keys->val = tmp_keys;
|
|
||||||
|
|
||||||
memmove(&tmp_keys[i], &tmp_keys[i + 1],
|
|
||||||
sizeof (*tmp_keys) * (hist_keys->len - i));
|
|
||||||
tmp_keys[hist_keys->len].keys.len = 0;
|
|
||||||
tmp_keys[hist_keys->len].keys.val = 0;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return (ret);
|
return (ret);
|
||||||
|
Reference in New Issue
Block a user