Improve security error messages (#480)

* Prints the node name when failing to find security directory

Also quotes directory, node_name and lookup strategy in error message for readability

Signed-off-by: Mikael Arguedas <mikael.arguedas@gmail.com>

* don't quote lookup strategy

Signed-off-by: Mikael Arguedas <mikael.arguedas@gmail.com>

* newline -> whitespace

Signed-off-by: Mikael Arguedas <mikael.arguedas@gmail.com>
This commit is contained in:
Mikael Arguedas 2019-08-03 01:36:44 +02:00 committed by Dirk Thomas
parent 5f1e5438af
commit 6f20cd9480

View file

@ -247,12 +247,12 @@ char * rcl_get_secure_root(
// Check node_secure_root is not NULL before checking directory // Check node_secure_root is not NULL before checking directory
if (NULL == node_secure_root) { if (NULL == node_secure_root) {
RCL_SET_ERROR_MSG_WITH_FORMAT_STRING( RCL_SET_ERROR_MSG_WITH_FORMAT_STRING(
"SECURITY ERROR: unable to find a folder matching the node name in %s%s." "SECURITY ERROR: unable to find a folder matching the node name '%s' in '%s%s'. "
"Lookup strategy: %s", "Lookup strategy: %s",
ros_secure_root_env, node_namespace, lookup_strategy); node_name, ros_secure_root_env, node_namespace, lookup_strategy);
} else { } else {
RCL_SET_ERROR_MSG_WITH_FORMAT_STRING( RCL_SET_ERROR_MSG_WITH_FORMAT_STRING(
"SECURITY ERROR: directory %s does not exist. Lookup strategy: %s", "SECURITY ERROR: directory '%s' does not exist. Lookup strategy: %s",
node_secure_root, lookup_strategy); node_secure_root, lookup_strategy);
} }
allocator->deallocate(ros_secure_root_env, allocator->state); allocator->deallocate(ros_secure_root_env, allocator->state);