more netinfo stuff
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@3051 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -49,21 +49,32 @@ RCSID("$Id$");
|
|||||||
static ni_status
|
static ni_status
|
||||||
ni_proplist2binding(ni_proplist *pl, krb5_config_section **ret)
|
ni_proplist2binding(ni_proplist *pl, krb5_config_section **ret)
|
||||||
{
|
{
|
||||||
int i;
|
int i, j;
|
||||||
|
krb5_config_section **next = NULL;
|
||||||
|
|
||||||
for (i = 0; i < pl->ni_proplist_len; i++) {
|
for (i = 0; i < pl->ni_proplist_len; i++) {
|
||||||
krb5_config_binding *b;
|
if (!strcmp(pl->nipl_val[i].nip_name, "name"))
|
||||||
if (!strcmp(pl->nipl_val[i].nip_name, "name")) continue;
|
continue;
|
||||||
b = malloc(sizeof(*b));
|
|
||||||
if (b == NULL) return NI_FAILED;
|
for (j = 0; j < pl->nipl_val[i].nip_val.ni_namelist_len; j++) {
|
||||||
if (i == pl->ni_proplist_len)
|
krb5_config_binding *b;
|
||||||
|
|
||||||
|
b = malloc(sizeof(*b));
|
||||||
|
if (b == NULL)
|
||||||
|
return NI_FAILED;
|
||||||
|
|
||||||
b->next = NULL;
|
b->next = NULL;
|
||||||
else
|
b->type = STRING;
|
||||||
b->next = *ret;
|
b->name = ni_name_dup(pl->nipl_val[i].nip_name);
|
||||||
b->type = STRING;
|
b->u.string = ni_name_dup(pl->nipl_val[i].nip_val.ninl_val[j]);
|
||||||
b->name = ni_name_dup(pl->nipl_val[i].nip_name);
|
|
||||||
b->u.string = ni_name_dup(pl->nipl_val[i].nip_val.ninl_val[0]);
|
if (next == NULL) {
|
||||||
*ret = b;
|
*ret = b;
|
||||||
|
} else {
|
||||||
|
*next = b;
|
||||||
|
}
|
||||||
|
next = &b->next;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return NI_OK;
|
return NI_OK;
|
||||||
}
|
}
|
||||||
@@ -104,18 +115,20 @@ ni_idlist2binding(void *ni, ni_idlist *idlist, krb5_config_section **ret)
|
|||||||
b->name = ni_name_dup(pl.nipl_val[index].nip_val.ninl_val[0]);
|
b->name = ni_name_dup(pl.nipl_val[index].nip_val.ninl_val[0]);
|
||||||
b->next = NULL;
|
b->next = NULL;
|
||||||
b->u.list = NULL;
|
b->u.list = NULL;
|
||||||
nis = ni_proplist2binding(&pl, &b->u.list);
|
|
||||||
ni_proplist_free(&pl);
|
|
||||||
if (nis != NI_OK) return nis;
|
|
||||||
|
|
||||||
|
/* get the child directories */
|
||||||
nis = ni_children(ni, &nid, &children);
|
nis = ni_children(ni, &nid, &children);
|
||||||
if (nis == NI_OK) {
|
if (nis == NI_OK) {
|
||||||
krb5_config_binding **node;
|
nis = ni_idlist2binding(ni, &children, &b->u.list);
|
||||||
if (b->u.list == NULL)
|
if (nis != NI_OK) {
|
||||||
node = &b->u.list;
|
return nis;
|
||||||
else
|
}
|
||||||
node = &b->u.list->next;
|
}
|
||||||
nis = ni_idlist2binding(ni, &children, node);
|
|
||||||
|
nis = ni_proplist2binding(&pl, b->u.list == NULL ? &b->u.list : &b->u.list->next);
|
||||||
|
ni_proplist_free(&pl);
|
||||||
|
if (nis != NI_OK) {
|
||||||
|
return nis;
|
||||||
}
|
}
|
||||||
next = &b->next;
|
next = &b->next;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user