Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reset security related RMW error state. #172

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions rmw_cyclonedds_cpp/src/rmw_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -922,6 +922,8 @@ extern "C" rmw_ret_t rmw_init(const rmw_init_options_t * options, rmw_context_t
if (context->options.security_options.enforce_security == RMW_SECURITY_ENFORCEMENT_ENFORCE) {
return RMW_RET_ERROR;
}
// No security enforced, lack of support is not an error.
rmw_reset_error();
Copy link
Member

@kyrofa kyrofa Apr 28, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think setting the error state is a bug anyway, fixing it like this feels a tad kludgey. I instead suggest surrounding the generation of the error message with an if (security_options->security_root_path != nullptr). If security_root_path == nullptr I'd just return OK, since nothing was requested and we did nothing.

}
impl->ppant = dds_create_participant(domain_id, ppant_qos.get(), nullptr);
if (impl->ppant < 0) {
Expand Down