profile_rename_section should demand only one name.
profile_add_relation should demand only one name if it is creating a
new section. It aso needs to reset state before calling
profile_find_node for the section, in case it didn't look up any
parent sections previously.
ticket: 7972 (new)
target_version: 1.12.2
tags: pullup
if (retval)
return retval;
- if (names == 0 || names[0] == 0 || names[1] == 0)
+ if (names == 0 || names[0] == 0)
return PROF_BAD_NAMESET;
k5_mutex_lock(&profile->first_file->data->lock);
if (retval)
return retval;
- if (names == 0 || names[0] == 0 || names[1] == 0)
+ /* Require at least two names for a new relation, one for a new section. */
+ if (names == 0 || names[0] == 0 || (names[1] == 0 && new_value))
return PROF_BAD_NAMESET;
k5_mutex_lock(&profile->first_file->data->lock);
}
if (new_value == 0) {
+ state = 0;
retval = profile_find_node(section, *cpp, 0, 1, &state, 0);
if (retval == 0) {
k5_mutex_unlock(&profile->first_file->data->lock);