diff options
| author | Michael Goulish <mgoulish@apache.org> | 2013-01-09 19:23:36 +0000 |
|---|---|---|
| committer | Michael Goulish <mgoulish@apache.org> | 2013-01-09 19:23:36 +0000 |
| commit | e1435b83f0ca7bde4fb83c41263a047075d9509b (patch) | |
| tree | c5cf87020488633b4feb4ef4bb2d821d7f1d8fba /cpp/src/qpidd.cpp | |
| parent | d5452e94146085ca967b09ab522a3276267a9920 (diff) | |
| download | qpid-python-e1435b83f0ca7bde4fb83c41263a047075d9509b.tar.gz | |
QPID-4518 : disallow unknown args in config file
Change EnvOptMapper::configFileLine to take ar arg telling it if
it's OK to have unknown args or not. If not, throw upon encountering.
From the higher level of run_broker(), there are two passes of
arg parsing. In the first pass it's normal to have unknown args,
because the loadable modules are not loaded yet. But I change the
second parsing to pass down the arg that says "unknowns are not okay."
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1431016 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpidd.cpp')
| -rw-r--r-- | cpp/src/qpidd.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/cpp/src/qpidd.cpp b/cpp/src/qpidd.cpp index 8e0c52f770..e17dea3164 100644 --- a/cpp/src/qpidd.cpp +++ b/cpp/src/qpidd.cpp @@ -82,10 +82,12 @@ int run_broker(int argc, char *argv[], bool hidden) qpid::loadModuleDir (bootOptions.module.loadDir, isDefault); } - // Parse options + // Parse options. In the second pass, do not allow unknown options. + // All the modules have been added now, so any unknown options + // should be flagged as errors. try { options.reset(new QpiddOptions(argv[0])); - options->parse(argc, argv, options->common.config); + options->parse(argc, argv, options->common.config, false); } catch (const std::exception& /*e*/) { if (helpArgSeen) { // provide help even when parsing fails |
