summaryrefslogtreecommitdiff
path: root/src/mongo/db/auth/user.h
diff options
context:
space:
mode:
authorAndy Schwerin <schwerin@10gen.com>2013-11-12 14:39:37 -0500
committerAndy Schwerin <schwerin@10gen.com>2013-11-13 13:07:37 -0500
commitc2036cf47e4b771bc455a1a3c02256b541874f4f (patch)
treeb54d347f9a73dbcebc9c755e82e517c7c58762b2 /src/mongo/db/auth/user.h
parentcf79f24096a017c2290f7524997813b266e09d71 (diff)
downloadmongo-c2036cf47e4b771bc455a1a3c02256b541874f4f.tar.gz
SERVER-9516 User objects must be immutable after first returned from AuthManager.
The mechanism for probing schemaVersion24 users was not respecting this requirement before this patch, which would have led to concurrency errors. Also, with this change the internalSecurity.user is never stored in the cache, and its reference count is never altered.
Diffstat (limited to 'src/mongo/db/auth/user.h')
-rw-r--r--src/mongo/db/auth/user.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/mongo/db/auth/user.h b/src/mongo/db/auth/user.h
index 577318a5db4..f1e679cb3ba 100644
--- a/src/mongo/db/auth/user.h
+++ b/src/mongo/db/auth/user.h
@@ -112,13 +112,12 @@ namespace mongo {
*/
uint32_t getRefCount() const;
-
- // Mutators below. Mutation functions should *only* be called by the AuthorizationManager
-
/**
- * Copies the contents of other into this User.
+ * Clones this user into a new, valid User object with refcount of 0.
*/
- void copyFrom(const User& other);
+ User* clone() const;
+
+ // Mutators below. Mutation functions should *only* be called by the AuthorizationManager
/**
* Sets this user's authentication credentials.