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 2aa9fff34bb998b87049edb0db57bc51b8a654d7..9361e490a3cc597a9736c5b23fdde2b7629c0dd7 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;