rcl  master
C API providing common ROS client library functionality.
Macros | Functions
security_directory.h File Reference
#include "rcl/allocator.h"
#include "rcl/visibility_control.h"
Include dependency graph for security_directory.h:

Go to the source code of this file.

Macros

#define ROS_SECURITY_NODE_DIRECTORY_VAR_NAME   "ROS_SECURITY_NODE_DIRECTORY"
 
#define ROS_SECURITY_ROOT_DIRECTORY_VAR_NAME   "ROS_SECURITY_ROOT_DIRECTORY"
 
#define ROS_SECURITY_LOOKUP_TYPE_VAR_NAME   "ROS_SECURITY_LOOKUP_TYPE"
 

Functions

char * rcl_get_secure_root (const char *node_name, const char *node_namespace, const rcl_allocator_t *allocator)
 Return the secure root directory associated with a node given its validated name and namespace. More...
 

Macro Definition Documentation

◆ ROS_SECURITY_NODE_DIRECTORY_VAR_NAME

#define ROS_SECURITY_NODE_DIRECTORY_VAR_NAME   "ROS_SECURITY_NODE_DIRECTORY"

◆ ROS_SECURITY_ROOT_DIRECTORY_VAR_NAME

#define ROS_SECURITY_ROOT_DIRECTORY_VAR_NAME   "ROS_SECURITY_ROOT_DIRECTORY"

◆ ROS_SECURITY_LOOKUP_TYPE_VAR_NAME

#define ROS_SECURITY_LOOKUP_TYPE_VAR_NAME   "ROS_SECURITY_LOOKUP_TYPE"

Function Documentation

◆ rcl_get_secure_root()

char* rcl_get_secure_root ( const char *  node_name,
const char *  node_namespace,
const rcl_allocator_t allocator 
)

Return the secure root directory associated with a node given its validated name and namespace.

E.g. for a node named "c" in namespace "/a/b", the secure root path will be "a/b/c", where the delimiter "/" is native for target file system (e.g. "\\" for _WIN32). If no exact match is found for the node name, a best match would be used instead (by performing longest-prefix matching).

However, this expansion can be overridden by setting the secure node directory environment variable, allowing users to explicitly specify the exact secure root directory to be utilized. Such an override is useful for where the FQN of a node is non-deterministic before runtime, or when testing and using additional tools that may not otherwise be easily provisioned.

Parameters
[in]node_namevalidated node name (a single token)
[in]node_namespacevalidated, absolute namespace (starting with "/")
[in]allocatorthe allocator to use for allocation
Returns
machine specific (absolute) node secure root path or NULL on failure returned pointer must be deallocated by the caller of this function