[SERVER-11354] Improve log message when auth'd user not found via mongos Created: 24/Oct/13  Updated: 11/Jul/16  Resolved: 05/Nov/13

Status: Closed
Project: Core Server
Component/s: Security
Affects Version/s: 2.5.3
Fix Version/s: 2.5.4

Type: Bug Priority: Major - P3
Reporter: Eric Milkie Assignee: Spencer Brody (Inactive)
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-11635 Bad Error Message for User Not Found ... Closed
Operating System: ALL
Participants:

 Description   

If you attempt to do, in the shell:
db.auth("asdf","1")
when talking to mongos, and user "asdf" does not exist, the error message posted to the mongos log is:

2013-10-24T13:40:23.671-0400 [conn1] Failed to authenticate asdf@admin with mechanism MONGODB-CR: AuthenticationFailed Unknown error code 10065 invalid parameter: expected an object ()

This is due to the userInfo command returning an empty "users" array but the code logic is not checking for this condition and is attempting to reference the first element of that array unilaterally (hence the BSON "expected an object" message)



 Comments   
Comment by auto [ 05/Nov/13 ]

Author:

{u'username': u'stbrody', u'name': u'Spencer T Brody', u'email': u'spencer@10gen.com'}

Message: SERVER-11354 Improve log message when user not found during authentication
Branch: master
https://github.com/mongodb/mongo/commit/cd80af1cfb2fcd2284d4f2a902a84e7423cf0a58

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