From 0354b42cdcacd26b25405099fcb8426a5c05fa67 Mon Sep 17 00:00:00 2001 From: Erik Boasson Date: Sat, 14 Mar 2020 10:19:55 +0100 Subject: [PATCH] Check for permissions handle by testing for != 0 The test gates access-control plugin invocation and with the inverted condition all remote readers/writers requiring access control are blocked eiter because of the permissions handle, or because a NIL handle is passed to the access control plugin. Signed-off-by: Erik Boasson --- src/core/ddsi/src/ddsi_security_omg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/ddsi/src/ddsi_security_omg.c b/src/core/ddsi/src/ddsi_security_omg.c index 7539ea5..06b6dab 100644 --- a/src/core/ddsi/src/ddsi_security_omg.c +++ b/src/core/ddsi/src/ddsi_security_omg.c @@ -1956,7 +1956,7 @@ bool q_omg_security_check_remote_writer_permissions(const struct proxy_writer *p { DDS_Security_PermissionsHandle permissions_handle; - if ((permissions_handle = get_permissions_handle(pp, pwr->c.proxypp)) != 0) + if ((permissions_handle = get_permissions_handle(pp, pwr->c.proxypp)) == 0) { GVTRACE("Secure remote writer "PGUIDFMT" proxypp does not have permissions handle yet\n", PGUID(pwr->e.guid)); return false; @@ -2180,7 +2180,7 @@ bool q_omg_security_check_remote_reader_permissions(const struct proxy_reader *p { DDS_Security_PermissionsHandle permissions_handle; - if ((permissions_handle = get_permissions_handle(pp, prd->c.proxypp)) != 0) + if ((permissions_handle = get_permissions_handle(pp, prd->c.proxypp)) == 0) { GVTRACE("Secure remote reader "PGUIDFMT" proxypp does not have permissions handle yet\n", PGUID(prd->e.guid)); return false;