mirror of
https://github.com/samba-team/samba.git
synced 2024-12-22 13:34:15 +03:00
s4-sdb: Generate etypes list out of keys list
This etypes list is Heimdal specific. It doesn't make sense to allocate and fill it in db-glue. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
This commit is contained in:
parent
47f10584d7
commit
b9f9936551
@ -277,24 +277,29 @@ static int sdb_entry_to_hdb_entry(krb5_context context,
|
||||
|
||||
sdb_flags_to_hdb_flags(&s->flags, &h->flags);
|
||||
|
||||
if (s->etypes) {
|
||||
h->etypes = NULL;
|
||||
if (h->keys.val != NULL) {
|
||||
h->etypes = malloc(sizeof(*h->etypes));
|
||||
if (h->etypes == NULL) {
|
||||
rc = ENOMEM;
|
||||
goto error;
|
||||
}
|
||||
h->etypes->len = s->etypes->len;
|
||||
|
||||
h->etypes->len = s->keys.len;
|
||||
|
||||
h->etypes->val = calloc(h->etypes->len, sizeof(int));
|
||||
if (h->etypes->val == NULL) {
|
||||
rc = ENOMEM;
|
||||
goto error;
|
||||
}
|
||||
|
||||
for (i = 0; i < h->etypes->len; i++) {
|
||||
h->etypes->val[i] = s->etypes->val[i];
|
||||
Key k = h->keys.val[i];
|
||||
|
||||
h->etypes->val[i] = KRB5_KEY_TYPE(&(k.key));
|
||||
}
|
||||
} else {
|
||||
h->etypes = NULL;
|
||||
}
|
||||
|
||||
h->generation = NULL;
|
||||
h->extensions = NULL; /* really sure ? FIXME */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user