Ensure names of public tree IsoNodes are valid POSIX names.

This commit is contained in:
Vreixo Formoso
2008-01-08 19:47:33 +01:00
parent aec6c8ce69
commit 1459801134
3 changed files with 65 additions and 22 deletions

View File

@ -56,6 +56,11 @@ int iso_tree_add_new_dir(IsoDir *parent, const char *name, IsoDir **dir)
if (dir) {
*dir = NULL;
}
/* check if the name is valid */
if (!iso_node_is_valid_name(name)) {
return ISO_WRONG_ARG_VALUE;
}
/* find place where to insert */
pos = &(parent->children);
@ -140,6 +145,11 @@ int iso_tree_add_new_symlink(IsoDir *parent, const char *name,
if (link) {
*link = NULL;
}
/* check if the name is valid */
if (!iso_node_is_valid_name(name)) {
return ISO_WRONG_ARG_VALUE;
}
/* find place where to insert */
pos = &(parent->children);
@ -248,6 +258,11 @@ int iso_tree_add_new_special(IsoDir *parent, const char *name, mode_t mode,
if (special) {
*special = NULL;
}
/* check if the name is valid */
if (!iso_node_is_valid_name(name)) {
return ISO_WRONG_ARG_VALUE;
}
/* find place where to insert */
pos = &(parent->children);