Skip to content

Commit

Permalink
Improve security error messages (#480)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
mikaelarguedas authored and dirk-thomas committed Aug 2, 2019
1 parent 5f1e543 commit 6f20cd9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions rcl/src/rcl/security_directory.c
Original file line number Diff line number Diff line change
Expand Up @@ -247,12 +247,12 @@ char * rcl_get_secure_root(
// Check node_secure_root is not NULL before checking directory
if (NULL == node_secure_root) {
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",
ros_secure_root_env, node_namespace, lookup_strategy);
node_name, ros_secure_root_env, node_namespace, lookup_strategy);
} else {
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);
}
allocator->deallocate(ros_secure_root_env, allocator->state);
Expand Down

0 comments on commit 6f20cd9

Please sign in to comment.