Revert "Fix allocation of conn->vuid_cache entries"
authorVolker Lendecke <vl@samba.org>
Mon, 5 May 2008 13:06:39 +0000 (15:06 +0200)
committerVolker Lendecke <vl@samba.org>
Mon, 5 May 2008 13:07:01 +0000 (15:07 +0200)
This reverts commit 50c891d3dfb75c9f607f7ad2a578aa3ba5d91988.

There's more to this code -- sorry for the spam
(This used to be commit 6e0e0cb8dd6f57de36c041e2ba4b82feeb357ce8)

source3/smbd/uid.c

index 343a0cf4905e7c55cacd71dfa960c3ce061b9c02..ffa643a8f56b5ebe23c8423b3a053b494e22b8fd 100644 (file)
@@ -123,9 +123,9 @@ static bool check_user_ok(connection_struct *conn, user_struct *vuser,int snum)
                return False;
        }
 
-       i = conn->vuid_cache.entries;
-       conn->vuid_cache.entries =
-               (conn->vuid_cache.entries + 1) % VUID_CACHE_SIZE;
+       i = conn->vuid_cache.entries % VUID_CACHE_SIZE;
+       if (conn->vuid_cache.entries < VUID_CACHE_SIZE)
+               conn->vuid_cache.entries++;
 
        ent = &conn->vuid_cache.array[i];
        ent->vuid = vuser->vuid;