Bug 1155540 - Raise error or shutdown broker when --sasl-config is invalid path
Summary: Raise error or shutdown broker when --sasl-config is invalid path
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise MRG
Classification: Red Hat
Component: qpid-cpp
Version: 3.0
Hardware: All
OS: All
medium
low
Target Milestone: 3.2
: ---
Assignee: Ernie
QA Contact: Eric Sammons
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-10-22 10:40 UTC by Pavel Moravec
Modified: 2015-10-08 13:09 UTC (History)
5 users (show)

Fixed In Version: qpid-cpp-0.32-1
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-10-08 13:09:38 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Add various tests on the passed in directory (2.97 KB, patch)
2014-10-31 17:42 UTC, Ernie
no flags Details | Diff
Fixes build problem (1.11 KB, patch)
2014-11-13 19:06 UTC, Ernie
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Apache JIRA QPID-6203 0 None None None Never
Red Hat Product Errata RHEA-2015:1879 0 normal SHIPPED_LIVE Red Hat Enterprise MRG Messaging 3.2 Release 2015-10-08 17:07:53 UTC

Description Pavel Moravec 2014-10-22 10:40:41 UTC
Description of problem:
When starting qpid broker with --sasl-config option (that specifies _path_ to qpidd.conf file for SASL) such that the option value is an invalid directory, qpid broker deals that like the sasl config is empty. No error is printed, broker runs properly.

That is quite confusing. Please either write an error like "sasl-config path does not exist, using empty SASL configuration", or even halt the broker startup.


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


How reproducible:
100%


Steps to Reproduce:
1. echo "nonsense" >> /etc/sasl2/qpidd.conf
2. qpidd --sasl-config=/etc/sasl2/qpidd.conf
3. qpidd --sasl-config=/some/notexisting/directory
4. rm -f /qpidd.conf; qpidd --sasl-config=/


Actual results:
Brokers in steps 2.,3. and 4. starts "successfully"


Expected results:
Neither broker in 2.,3. or 4. should start (or can but logging error message)


Additional info:
Derived from bz728196

Comment 1 Ernie 2014-10-28 15:24:39 UTC
For steps 1 and 2 in comment #0, the directory and file exist. The problem is with the contents of the file.

A typical sasl qpidd.conf looks like:

pwcheck_method: auxprop
auxprop_plugin: sasldb
sasldb_path: /usr/local/etc/qpid/sasl_config/qpidd.sasldb
sql_select: dummy select
mech_list: ANONYMOUS PLAIN DIGEST-MD5 EXTERNAL CRAM-MD5

If we are now going to parse the content of that file, which lines should we validate?

Comment 2 Justin Ross 2014-10-28 19:08:00 UTC
We don't want to parse the contents at all.  We should only attempt to cover case number 3, imo.

Comment 3 Ernie 2014-10-31 17:42:10 UTC
Created attachment 952565 [details]
Add various tests on the passed in directory

The patch adds the following tests:
    That what is passed in is a directory and not a file
    That the directory contains a qpidd.conf file
    That the broker is able to read the qpidd.conf file

Patch has been reviewed.

Comment 4 Ernie 2014-11-03 20:46:41 UTC
Currently the windows sasl implementation does not use the --sasl-config option and so is not affected by this bz and patch.

Comment 5 Justin Ross 2014-11-06 14:37:34 UTC
https://svn.apache.org/r1637122

Comment 6 Ernie 2014-11-13 19:06:50 UTC
Created attachment 957261 [details]
Fixes build problem

Prevents the broker from failing to start if an empty saslConfig directory is used.

Comment 7 Justin Ross 2014-11-13 19:33:07 UTC
https://svn.apache.org/r1639493

Comment 9 Jitka Kocnova 2015-08-13 09:10:18 UTC
This issue is fixed.

Checked on RHEL 6 x86_64 and i386 with packages:

qpid-cpp-client-0.34-1.el6
qpid-cpp-server-rdma-0.34-1.el6
qpid-cpp-server-ha-0.34-1.el6
qpid-proton-c-0.9-4.el6
qpid-cpp-server-0.34-1.el6
qpid-cpp-client-devel-0.34-1.el6
qpid-cpp-server-linearstore-0.34-1.el6
qpid-cpp-server-devel-0.34-1.el6
qpid-qmf-0.34-1.el6
qpid-cpp-client-rdma-0.34-1.el6
qpid-cpp-server-xml-0.34-1.el6
qpid-cpp-debuginfo-0.34-1.el6

and

qpid-cpp-client-rdma-0.32-1.el6
qpid-cpp-debuginfo-0.32-1.el6
qpid-proton-c-0.9-4.el6
qpid-cpp-server-0.32-1.el6
qpid-cpp-client-devel-0.32-1.el6
qpid-cpp-server-rdma-0.32-1.el6
qpid-cpp-server-xml-0.32-1.el6
qpid-cpp-server-linearstore-0.32-1.el6
qpid-cpp-client-0.32-1.el6
qpid-cpp-server-devel-0.32-1.el6
qpid-cpp-server-ha-0.32-1.el6


Broker does not start in both versions in steps 2., 3. and 4. and gives an error message, which is OK.


-> VERIFIED

Comment 12 errata-xmlrpc 2015-10-08 13:09:38 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.

https://rhn.redhat.com/errata/RHEA-2015-1879.html


Note You need to log in before you can comment on or make changes to this bug.