summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2008-05-05 14:43:57 +0200
committerVolker Lendecke <vl@samba.org>2008-05-05 14:46:03 +0200
commit8dd53811d57da9a079f81e1f742f803131239b09 (patch)
tree7ffadaf3b1b3217a064d063682eb2bf2fc35477b /source3/smbd
parent768c0d6b22f85ff9fe34922e30a822c69e1d5bd7 (diff)
downloadsamba-8dd53811d57da9a079f81e1f742f803131239b09.tar.gz
samba-8dd53811d57da9a079f81e1f742f803131239b09.tar.bz2
samba-8dd53811d57da9a079f81e1f742f803131239b09.zip
Fix allocation of conn->vuid_cache entries
With the old code, if more than VUID_CACHE_SIZE elements were used all new entries ended up in slot 0. With this checkin we do cycle. Jeremy, please revert if the old behaviour was intentional (This used to be commit 50c891d3dfb75c9f607f7ad2a578aa3ba5d91988)
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/uid.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/source3/smbd/uid.c b/source3/smbd/uid.c
index ffa643a8f5..343a0cf490 100644
--- a/source3/smbd/uid.c
+++ b/source3/smbd/uid.c
@@ -123,9 +123,9 @@ static bool check_user_ok(connection_struct *conn, user_struct *vuser,int snum)
return False;
}
- i = conn->vuid_cache.entries % VUID_CACHE_SIZE;
- if (conn->vuid_cache.entries < VUID_CACHE_SIZE)
- conn->vuid_cache.entries++;
+ i = conn->vuid_cache.entries;
+ conn->vuid_cache.entries =
+ (conn->vuid_cache.entries + 1) % VUID_CACHE_SIZE;
ent = &conn->vuid_cache.array[i];
ent->vuid = vuser->vuid;