diff options
author | Greg Hudson <ghudson@mit.edu> | 2014-07-16 16:02:21 -0400 |
---|---|---|
committer | Tom Yu <tlyu@mit.edu> | 2015-02-06 18:33:10 -0500 |
commit | d94ec3f610f1ff3198e306523bc5dbd227c4f219 (patch) | |
tree | 1b9f5400f15be85ef8c84d019a1cfb5d4b889ed6 | |
parent | 4e4895c6e2d3ebed8f4ccd1aafe2c8c0cd52d884 (diff) | |
download | krb5-d94ec3f610f1ff3198e306523bc5dbd227c4f219.zip krb5-d94ec3f610f1ff3198e306523bc5dbd227c4f219.tar.gz krb5-d94ec3f610f1ff3198e306523bc5dbd227c4f219.tar.bz2 |
Fix deleted node handling in libprofile
In profile_find_node, skip deleted nodes when finding the second
match. Otherwise, profile_clear_nodes could return an error if a node
has some values to clear but the last one is deleted.
In profile_node_iterator, skip deleted nodes when looking up the
section names. Otherwise we could iterate over a deleted section
and/or ignore its replacement.
(cherry picked from commit e7f50a1c11845ba73ce4ffa4729d10113563a247)
ticket: 8117 (new)
version_fixed: 1.11.6
status: resolved
-rw-r--r-- | src/util/profile/prof_tree.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/util/profile/prof_tree.c b/src/util/profile/prof_tree.c index 4543441..2d67144 100644 --- a/src/util/profile/prof_tree.c +++ b/src/util/profile/prof_tree.c @@ -294,6 +294,8 @@ errcode_t profile_find_node(struct profile_node *section, const char *name, if (value && (strcmp(p->value, value))) continue; } + if (p->deleted) + continue; /* A match! */ break; } @@ -527,7 +529,7 @@ get_new_file: assert(section != NULL); for (cpp = iter->names; cpp[iter->done_idx]; cpp++) { for (p=section->first_child; p; p = p->next) { - if (!strcmp(p->name, *cpp) && !p->value) + if (!strcmp(p->name, *cpp) && !p->value && !p->deleted) break; } if (!p) { |