[SERVER-22729] userCreateNS should call userAllowedCreateNS Created: 18/Feb/16  Updated: 05/Apr/17  Resolved: 28/Nov/16

Status: Closed
Project: Core Server
Component/s: Storage
Affects Version/s: 3.0.9, 3.2.3, 3.3.1
Fix Version/s: 3.5.1

Type: Bug Priority: Major - P3
Reporter: Jonathan Abrahams Assignee: Daniel Gottlieb (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Related
related to SERVER-22723 Invariant failure using copydb Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Storage 2016-12-12
Participants:
Linked BF Score: 0

 Comments   
Comment by Githook User [ 28/Nov/16 ]

Author:

{u'username': u'dgottlieb', u'name': u'Daniel Gottlieb', u'email': u'daniel.gottlieb@10gen.com'}

Message: SERVER-22729: Disallow creating replication collections in non-local databases

A `copydb` command from the `local` database to a user one can create collections
that a primary will allow, but secondaries will not.
Branch: master
https://github.com/mongodb/mongo/commit/079a572dca60f0f60530ad08293597dfe3dc106b

Comment by Eric Milkie [ 14/Nov/16 ]

We should also consider renaming these functions, because they still stand as outliers in the catalog API, with confusing semantics that are easy to get wrong – this ticket is a case in point.

Comment by Eric Milkie [ 14/Nov/16 ]

This crash is happening because userCreateNS() does not call userAllowedCreateNS(), even though it logs oplog entries that cause secondaries to eventually call createCollection() which does call userAllowedCreateNS().
Either we need to audit every call to userCreateNS() and manually call userAllowedCreateNS() for ones that are creating user-requested collections, or we simply need to add userAllowedCreateNS() to userCreateNS() along with all the other namespace validation it does prior to the actual creation.

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