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

Conversation

hidmic
Copy link
Contributor

@hidmic hidmic commented Apr 28, 2020

If security support is not required, the lack of it is not an error. I think this was introduced in #145.

Without this patch, if building with ENABLE_SECURITY=off and RCUTILS_REPORT_ERROR_HANDLING_ERRORS set, the error string set in configure_qos_security() is always printed out on any downstream override.

If security support is not required, the lack of it is not an error.

Signed-off-by: Michel Hidalgo <[email protected]>
@hidmic hidmic requested a review from eboasson April 28, 2020 17:45
Copy link
Member

@ivanpauno ivanpauno left a comment

Choose a reason for hiding this comment

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

I've just hit the same problem (#123 (comment)).
I've tried this locally and it does work.

LGTM!

@@ -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.

@SidFaber SidFaber mentioned this pull request Apr 29, 2020
@ivanpauno
Copy link
Member

Closing in favor of #175

@ivanpauno ivanpauno closed this Apr 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants