diff options
author | Volker Lendecke <vl@samba.org> | 2008-05-05 14:43:57 +0200 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2008-05-05 14:46:03 +0200 |
commit | 50c891d3dfb75c9f607f7ad2a578aa3ba5d91988 (patch) | |
tree | d7a90992059dfe51078d8a0b605310ab559c05eb /source/smbd/uid.c | |
parent | 1b1614c3261e1e93a2cad1f1063e28cbbb13f434 (diff) | |
download | samba-50c891d3dfb75c9f607f7ad2a578aa3ba5d91988.tar.gz samba-50c891d3dfb75c9f607f7ad2a578aa3ba5d91988.tar.xz samba-50c891d3dfb75c9f607f7ad2a578aa3ba5d91988.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
Diffstat (limited to 'source/smbd/uid.c')
-rw-r--r-- | source/smbd/uid.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/smbd/uid.c b/source/smbd/uid.c index ffa643a8f56..343a0cf4905 100644 --- a/source/smbd/uid.c +++ b/source/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; |