-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: 3.3.1
-
Component/s: None
-
None
-
Fully Compatible
-
ALL
-
Platforms 10 (02/19/16), Platforms 12 (04/01/16)
In Mongo, MongoD, and MongoS, we have several options which are implicit options:
- password (mongo)
- PEMKeyPassword (*)
- sslClusterPassword (mongod, mongos)
These are options that have been setup with setImplicitValue.
To quote setImplicitValue
Add an implicit value for this option if it is specified with no argument
This maps to boost::program_options::typed_value::implicit_value which is defined as:
Specifies an implicit value, which will be used if the option is given, but without an adjacent value. Using this implies that an explicit value is optional, but if given, must be strictly adjacent to the option, i.e.: '-ovalue' or '--option=value'. Giving '-o' or '--option' will cause the implicit value to be applied.
Unlike the above overload, the type 'T' need not provide operator<< for ostream, but textual representation of default value must be provided by the user.
This has been documented this way since boost 1.49.
This means that the common way of passing passwords for example on the command line as used by the tests is wrong.
mongo --password foo
and
mongo foo
are supposed to be equivalent.
The correct syntax is
mongo --password=foo
Boost prior to 1.59 had a bug where -password foo was allowed to mean -password=foo. This has been fixed. Now, we need to either correct our tests or change our usage of implicit values to fix our tests or change our code to define these parameters as default values to maintain the existing behavior.
References:
SERVER-20754
http://lists.boost.org/boost-users/2015/09/85130.php
https://github.com/boostorg/program_options/commit/88dea3c6fdea8c9ea894911897b1770599c383e4
- depends on
-
SERVER-20754 mongo/util/options_parser/options_parser_test fails
- Closed
- is depended on by
-
SERVER-17294 Upgrade to boost 1.60
- Closed