[ 
https://issues.apache.org/jira/browse/DISPATCH-1732?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17167825#comment-17167825
 ] 

Gordon Sim commented on DISPATCH-1732:
--------------------------------------

The following fixes the segfault. Not sure if it is the correct fix:

{noformat}
diff --git a/src/policy.c b/src/policy.c
index ae093b13..7486dd7c 100644
--- a/src/policy.c
+++ b/src/policy.c
@@ -1294,7 +1294,7 @@ void qd_policy_amqp_open(qd_connection_t *qd_conn) {
                 if (cf && cf->multi_tenant) {
                     char vhost_name_buf[SETTINGS_NAME_SIZE];
                     if (qd_policy_lookup_vhost_alias(policy, vhost, 
vhost_name_buf, SETTINGS_NAME_SIZE)) {
-                        if (!strcmp(pcrh, vhost_name_buf)) {
+                        if (pcrh && !strcmp(pcrh, vhost_name_buf)) {
                             // Default condition: use proton connection value; 
no action here
                         } else {
                             // Policy used a name different from what came in 
the AMQP Open hostname.

{noformat}
 

 

> segfault when connecting to multitenant listener with policy but  no hostname 
> in open
> -------------------------------------------------------------------------------------
>
>                 Key: DISPATCH-1732
>                 URL: https://issues.apache.org/jira/browse/DISPATCH-1732
>             Project: Qpid Dispatch
>          Issue Type: Improvement
>          Components: Policy Engine
>    Affects Versions: 1.13.0
>            Reporter: Gordon Sim
>            Priority: Major
>             Fix For: 1.13.0
>
>
> Start router with following config file and then run qpid-receive against it 
> (which by default does not set a hostname in open).
>  
> {noformat}
> [
>     ["listener", { "host": "0.0.0.0", "port": 5672, "multiTenant": true , 
> "policyVhost": "myhost"}],
>     ["policy", {"enableVhostPolicy": true }],
>     ["vhost", { "hostname": "myhost", "allowUnknownUser": true, 
> "groups":{"$default":{"remoteHosts":"*","sources":"*","targets":"*","allowDynamicSource":true,"allowAnonymousSender":true}}}]
> ] {noformat}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to