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

ASF GitHub Bot commented on DISPATCH-1518:
------------------------------------------

kgiusti commented on pull request #676: DISPATCH-1518: Added ability to turn on 
protocol frame trace logging …
URL: https://github.com/apache/qpid-dispatch/pull/676#discussion_r377676750
 
 

 ##########
 File path: src/router_core/agent_connection.c
 ##########
 @@ -563,47 +568,103 @@ void qdra_connection_update_CT(qdr_core_t      *core,
         // Find the connection that the user connected on. This connection 
must have the correct policy rights which
         // will allow the user on this connection to terminate some other 
connection.
         qdr_connection_t *user_conn = _find_conn_CT(core, query->in_conn);
+        qd_parsed_field_t *trace_field   = qd_parse_value_by_key(in_body, 
qdr_connection_columns[QDR_CONNECTION_ENABLE_PROTOCOL_TRACE]);
+        bool enable_protocol_trace = !!trace_field ? 
qd_parse_as_bool(trace_field) : false;
+
+        qdr_connection_t *conn = 0;
+
+        bool admin_status_bad_or_forbidden = false;
+
+        if (admin_state) {
+
+            if (!user_conn) {
+                // This is bad. The user connection (that was requesting that 
some
+                // other connection be dropped) is gone
+                query->status.description = "Parent connection no longer 
exists";
+                qdra_connection_set_bad_request(query);
+                admin_status_bad_or_forbidden = true;
+            }
+            else {
+                if (!user_conn->policy_allow_admin_status_update) {
+                    //
+                    // Policy on the connection that is requesting that some 
other connection be deleted does not allow
+                    // for the other connection to be deleted.Set the status 
to QD_AMQP_FORBIDDEN and just quit.
+                    //
+                    query->status = QD_AMQP_FORBIDDEN;
+                    query->status.description = "You are not allowed to 
perform this operation.";
+                    qd_compose_start_map(query->body);
+                    qd_compose_end_map(query->body);
+                    admin_status_bad_or_forbidden = true;
+                 }
+                else if (admin_state) { //admin state and trace are the only 
fields that can be updated via the update management request for type 
connection.
+                    if (identity) {
+                        conn = qdr_connection_find_by_identity_CT(core, 
identity);
 
 Review comment:
   Same here - identity was checked above in line 562
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Add ability to turn on router trace logging for a specific connection 
> ----------------------------------------------------------------------
>
>                 Key: DISPATCH-1518
>                 URL: https://issues.apache.org/jira/browse/DISPATCH-1518
>             Project: Qpid Dispatch
>          Issue Type: Improvement
>          Components: Container
>    Affects Versions: 1.9.0
>            Reporter: Ganesh Murthy
>            Assignee: Ganesh Murthy
>            Priority: Major
>             Fix For: 1.11.0
>
>
> It would be nice to be able to turn on tracing per connection, e.g. something 
> like `qdmanage update --type=connection id=897644 tracing=true`
> That way you could benefit from protocol level tracing on connections of 
> interest as and when needed. Perhaps also there could be some way of 
> specifying a policy for connection tracing, e.g. all connections whose 
> container id is 'foo' or who are connecting from 192.666.555.444 or similar.



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

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

Reply via email to