Move the definition of struct vuid_cache_entry *ent outside blocks.
authorJeremy Allison <jra@samba.org>
Thu, 20 Dec 2012 19:51:55 +0000 (11:51 -0800)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 9 Jan 2013 04:28:28 +0000 (15:28 +1100)
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source3/smbd/uid.c

index 2aa9fff..9361e49 100644 (file)
@@ -93,10 +93,9 @@ static bool check_user_ok(connection_struct *conn,
        unsigned int i;
        bool readonly_share;
        bool admin_user;
+       struct vuid_cache_entry *ent = NULL;
 
        {
-               struct vuid_cache_entry *ent;
-
                for (i=0; i<VUID_CACHE_SIZE; i++) {
                        ent = &conn->vuid_cache.array[i];
                        if (ent->vuid == vuid) {
@@ -145,8 +144,7 @@ static bool check_user_ok(connection_struct *conn,
                NULL, session_info->security_token, lp_admin_users(snum));
 
        {
-               struct vuid_cache_entry *ent =
-                       &conn->vuid_cache.array[conn->vuid_cache.next_entry];
+               ent = &conn->vuid_cache.array[conn->vuid_cache.next_entry];
 
                conn->vuid_cache.next_entry =
                        (conn->vuid_cache.next_entry + 1) % VUID_CACHE_SIZE;