[SERVER-35101] Handle differently a badly formed bindIp argument Created: 18/May/18  Updated: 29/Oct/23  Resolved: 12/Jun/18

Status: Closed
Project: Core Server
Component/s: Networking
Affects Version/s: 3.6.4
Fix Version/s: 3.6.6, 4.0.1, 4.1.1

Type: Improvement Priority: Major - P3
Reporter: Daniel Coupal Assignee: Adam Cooper (Inactive)
Resolution: Fixed Votes: 5
Labels: neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Related
Backwards Compatibility: Minor Change
Backport Requested:
v4.0, v3.6
Sprint: Platforms 2018-06-18
Participants:

 Description   

mongod should properly handle a "poorly" formed bind_ip argument, for example when it contains whitespace.

mongod --dbpath /data/db --bind_ip "127.0.0.1, 192.168.36.100"
...
2018-05-18T21:46:45.481+0000 I NETWORK  [initandlisten] getaddrinfo(" 192.168.36.100") failed: Temporary failure in name resolution
2018-05-18T21:46:45.481+0000 W NETWORK  [initandlisten] Found no addresses for  192.168.36.100
...
2018-05-18T21:46:46.018+0000 I NETWORK  [initandlisten] waiting for connections on port 27017

However, the process starts, listening on 127.0.0.1

1) Starting the process, without one of the IP the user specified, should abort.

2) since the most common issue is having a space in the config or cmd-line argument, mongod should start by triming the spaces.



 Comments   
Comment by Githook User [ 02/Jul/18 ]

Author:

{'username': 'super-cooper', 'name': 'Adam Cooper', 'email': 'adam.cooper@mongodb.com'}

Message: SERVER-35101 Strip trailing and leading whitespace from bind_ip arguments and change to
std::vector internally
Branch: v4.0
https://github.com/mongodb/mongo/commit/96de688b8f978a3e26983aa9c1dca740bfde9c55

Comment by Githook User [ 02/Jul/18 ]

Author:

{'username': 'super-cooper', 'name': 'Adam Cooper', 'email': 'adam.cooper@mongodb.com'}

Message: SERVER-35101 Strip trailing and leading whitespace from bind_ip arguments and change to
std::vector internally

(cherry picked from commit 84ccd279f2910a73b10678685b2a6a90bb6dd8fb)
Branch: v3.6
https://github.com/mongodb/mongo/commit/4f09fb49ad01fb90e7065d11efd353f8fe164f49

Comment by Githook User [ 11/Jun/18 ]

Author:

{'name': 'Adam Cooper', 'email': 'adam.cooper@mongodb.com'}

Message: SERVER-35101 Strip trailing and leading whitespace from bind_ip arguments and change to
std::vector internally
Branch: master
https://github.com/mongodb/mongo/commit/84ccd279f2910a73b10678685b2a6a90bb6dd8fb

Generated at Thu Feb 08 04:38:50 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.