Repository: qpid-dispatch
Updated Branches:
  refs/heads/master 6eeb184aa -> d84356fe3


DISPATCH-528: Remove workaround for port-in-hostname proton 0.12 bug


Project: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/commit/d84356fe
Tree: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/tree/d84356fe
Diff: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/diff/d84356fe

Branch: refs/heads/master
Commit: d84356fe394bc375073d8bde0d935262906e97be
Parents: 6eeb184
Author: Chuck Rolke <cro...@redhat.com>
Authored: Thu Oct 13 16:27:25 2016 -0400
Committer: Chuck Rolke <cro...@redhat.com>
Committed: Thu Oct 13 16:27:25 2016 -0400

----------------------------------------------------------------------
 src/policy.c | 16 +++-------------
 1 file changed, 3 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/d84356fe/src/policy.c
----------------------------------------------------------------------
diff --git a/src/policy.c b/src/policy.c
index ad6bb1f..d03257d 100644
--- a/src/policy.c
+++ b/src/policy.c
@@ -276,16 +276,6 @@ bool qd_policy_open_lookup_user(
     uint64_t    conn_id,
     qd_policy_settings_t *settings)
 {
-    // TODO: crolke 2016-03-24 - Workaround for PROTON-1133: Port number is 
included in Open hostname
-    // Strip the ':NNNN', if any, from the vhost name so that policy will work 
with proton 0.12
-    // This code does not work correctly with IPv6 numeric addresses.
-    char vhostname[HOST_NAME_MAX + 1];
-    strncpy(vhostname, vhost, HOST_NAME_MAX);
-    vhostname[HOST_NAME_MAX] = 0;
-    char * colonp = strstr(vhostname, ":");
-    if (colonp) {
-        *colonp = 0;
-    }
     // Lookup the user/host/vhost for allow/deny and to get settings name
     bool res = false;
     qd_python_lock_state_t lock_state = qd_python_lock();
@@ -295,7 +285,7 @@ bool qd_policy_open_lookup_user(
         if (lookup_user) {
             PyObject *result = PyObject_CallFunction(lookup_user, "(OssssK)",
                                                      (PyObject 
*)policy->py_policy_manager,
-                                                     username, hostip, 
vhostname, conn_name, conn_id);
+                                                     username, hostip, vhost, 
conn_name, conn_id);
             if (result) {
                 const char *res_string = PyString_AsString(result);
                 strncpy(name_buf, res_string, name_buf_size);
@@ -327,7 +317,7 @@ bool qd_policy_open_lookup_user(
             if (lookup_settings) {
                 PyObject *result2 = PyObject_CallFunction(lookup_settings, 
"(OssO)",
                                                         (PyObject 
*)policy->py_policy_manager,
-                                                        vhostname, name_buf, 
upolicy);
+                                                        vhost, name_buf, 
upolicy);
                 if (result2) {
                     settings->maxFrameSize         = 
qd_entity_opt_long((qd_entity_t*)upolicy, "maxFrameSize", 0);
                     settings->maxMessageSize       = 
qd_entity_opt_long((qd_entity_t*)upolicy, "maxMessageSize", 0);
@@ -363,7 +353,7 @@ bool qd_policy_open_lookup_user(
         qd_log(policy->log_source,
            QD_LOG_TRACE,
            "ALLOW AMQP Open lookup_user: %s, rhost: %s, vhost: %s, connection: 
%s. Usergroup: '%s'%s",
-           username, hostip, vhostname, conn_name, name_buf, (res ? "" : " 
Internal error."));
+           username, hostip, vhost, conn_name, name_buf, (res ? "" : " 
Internal error."));
     } else {
         // Denials are logged in python code
     }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org
For additional commands, e-mail: commits-h...@qpid.apache.org

Reply via email to