Bug 1029446

Summary: Invalid message filter on purge is ignored
Product: Red Hat Enterprise MRG Reporter: Gordon Sim <gsim>
Component: qpid-cppAssignee: Gordon Sim <gsim>
Status: CLOSED ERRATA QA Contact: Petr Matousek <pematous>
Severity: unspecified Docs Contact:
Priority: medium    
Version: 3.0CC: iboverma, jross, lzhaldyb, pematous
Target Milestone: 3.0   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: qpid-cpp-0.22-26 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1109190 (view as bug list) Environment:
Last Closed: 2014-09-24 15:09:10 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 1109190    

Description Gordon Sim 2013-11-12 12:05:22 UTC
Description of problem:

If an invalid 'filter' map is specified to the purge operation on a queue, it is ignored and all messages are deleted (up to the count specified). This is error prone as an accidental mistake by an operator can lead to the wrong messages being purged.

Version-Release number of selected component (if applicable):

MRG 2.3

How reproducible:

100%

Steps to Reproduce:
1. create queue
2. using qpidtool, purge the queue with an invalid filter, e.g. call 131 purge 0 {'subject':abc'}

Actual results:

All messages are purged

Expected results:

Get an exception informing operator that the filter is not valid
Additional info:

Comment 1 Gordon Sim 2013-11-12 12:06:10 UTC
Fixed upstream: https://svn.apache.org/r1540794 and https://svn.apache.org/r1541002

Comment 3 Petr Matousek 2014-01-03 15:14:22 UTC
This issue has been fixed. Verified on rhel6.5 (x86_64, i386).

QE note:

Following error is now displayed when using incorrect filter:
qpid: Unrecognized message filter: '{subject:abc}' (/builddir/build/BUILD/qpid-0.22/cpp/src/qpid/broker/Queue.cpp:697) (7)

valid filter format:
{"filter_type":"header_match_str","filter_params":"header_key":"qpid.subject","header_value":"abc"}}


packages under test:
qpid-cpp-*-0.22-29

-> VERIFIED

Comment 4 errata-xmlrpc 2014-09-24 15:09:10 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHEA-2014-1296.html