Move connection-specific vuid cache clear to uid.c
authorVolker Lendecke <vl@samba.org>
Sat, 14 Jun 2008 14:59:07 +0000 (16:59 +0200)
committerVolker Lendecke <vl@samba.org>
Sat, 14 Jun 2008 17:49:49 +0000 (19:49 +0200)
(This used to be commit 1025f687910ce40283c7344ed67ebd5bf31217b7)

source3/smbd/conn.c
source3/smbd/password.c
source3/smbd/uid.c

index 5c75ed719e1dc36374c949790a11876bc81bf3e6..1a67ac9b3223b55a130aca77da2d0e57a8c46eca 100644 (file)
@@ -225,28 +225,15 @@ bool conn_idle_all(time_t t)
  Clear a vuid out of the validity cache, and as the 'owner' of a connection.
 ****************************************************************************/
 
-void conn_clear_vuid_cache(uint16 vuid)
+void conn_clear_vuid_caches(uint16_t vuid)
 {
        connection_struct *conn;
-       unsigned int i;
 
        for (conn=Connections;conn;conn=conn->next) {
                if (conn->vuid == vuid) {
                        conn->vuid = UID_FIELD_INVALID;
                }
-
-               for (i=0; i<VUID_CACHE_SIZE; i++) {
-                       struct vuid_cache_entry *ent;
-
-                       ent = &conn->vuid_cache.array[i];
-
-                       if (ent->vuid == vuid) {
-                               ent->vuid = UID_FIELD_INVALID;
-                               TALLOC_FREE(ent->server_info);
-                               ent->read_only = False;
-                               ent->admin_user = False;
-                       }
-               }
+               conn_clear_vuid_cache(conn, vuid);
        }
 }
 
index 673a1a01c13156749f8d2bb17f41466054581a2f..ebc72350b5a74f21b10bd1865fb1ffdf7c845960 100644 (file)
@@ -127,7 +127,7 @@ void invalidate_vuid(uint16 vuid)
 
        /* clear the vuid from the 'cache' on each connection, and
           from the vuid 'owner' of connections */
-       conn_clear_vuid_cache(vuid);
+       conn_clear_vuid_caches(vuid);
 
        TALLOC_FREE(vuser);
        num_validated_vuids--;
index bded780c4977dedbfbe5be1d826108c735b94bf9..2bc5595661ca0c5c0e4499e396d3de135ff2e741 100644 (file)
@@ -142,6 +142,28 @@ static bool check_user_ok(connection_struct *conn, uint16_t vuid,
        return(True);
 }
 
+/****************************************************************************
+ Clear a vuid out of the connection's vuid cache
+****************************************************************************/
+
+void conn_clear_vuid_cache(connection_struct *conn, uint16_t vuid)
+{
+       int i;
+
+       for (i=0; i<VUID_CACHE_SIZE; i++) {
+               struct vuid_cache_entry *ent;
+
+               ent = &conn->vuid_cache.array[i];
+
+               if (ent->vuid == vuid) {
+                       ent->vuid = UID_FIELD_INVALID;
+                       TALLOC_FREE(ent->server_info);
+                       ent->read_only = False;
+                       ent->admin_user = False;
+               }
+       }
+}
+
 /****************************************************************************
  Become the user of a connection number without changing the security context
  stack, but modify the current_user entries.