[SERVER-29974] Comment in checkAuthForRenameCollectionCommand doesn't match behavior Created: 05/Jul/17  Updated: 30/Oct/23  Resolved: 14/Aug/17

Status: Closed
Project: Core Server
Component/s: Security
Affects Version/s: None
Fix Version/s: 3.5.12

Type: Improvement Priority: Minor - P4
Reporter: Sam Dunietz Assignee: Sam Dunietz
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Participants:

 Description   

The comment in checkAuthForRenameCollectionCommands (https://github.com/mongodb/mongo/blob/r3.5.9/src/mongo/db/commands/rename_collection_common.cpp?utf8=%E2%9C%93#L63-L66) says that "if you have renameCollectionSameDB and either can read both of source and dest collections or can't read either of source or dest collection", you can do the rename. However, this doesn't match the behavior in line 82. After talking with Spencer Brody and Spencer Jackson, it seems the code is correct, but the comment is not.



 Comments   
Comment by Kyle Suarez [ 14/Aug/17 ]

Cool, thanks!

Comment by Sam Dunietz [ 14/Aug/17 ]

Was just given push access this morning, and pushed just now! Also closed the CR.

Comment by Githook User [ 14/Aug/17 ]

Author:

{'name': 'Sam Dunietz', 'username': 'samdunietz', 'email': 'sdunietz@gmail.com'}

Message: SERVER-29974 Comment in checkAuthForRenameCollectionCommand doesn't match behavior
Branch: master
https://github.com/mongodb/mongo/commit/87d24c252b2531a66358b0bf6d327b5002527940

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