[SERVER-4113] shell should validate database name passed in command line Created: 21/Oct/11  Updated: 11/Jul/16  Resolved: 28/Oct/11

Status: Closed
Project: Core Server
Component/s: Shell
Affects Version/s: None
Fix Version/s: 2.1.0

Type: Bug Priority: Major - P3
Reporter: Aaron Staple Assignee: Brandon Diamond
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by SERVER-3898 Unknown DB Closed
Operating System: ALL
Participants:

 Description   

Aaron-Staples-MacBook-Pro:mongo aaron$ mongo *
MongoDB shell version: 1.8.2
connecting to: *
> db.c.save({})
> show dbs

  • 0.078125GB
    local (empty)
    >

Apparently a db named '*' isn't allowed - we should validate the db name passed to the shell to prevent this situation.



 Comments   
Comment by Brandon Diamond [ 28/Oct/11 ]

Since it seems things work when "*" is used (the issue is that it's just not great UX) I've added an extra bit of validation in the shell launch code and let the rest be.

Comment by auto [ 28/Oct/11 ]

Author:

{u'login': u'', u'name': u'Brandon Diamond', u'email': u'brandon@10gen.com'}

Message: SERVER-4113: shell validation to avoid "*" db name
Branch: master
https://github.com/mongodb/mongo/commit/f9a94a82e8a6145711d5f924070401c502629ec0

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