summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2008-06-14 16:59:07 +0200
committerVolker Lendecke <vl@samba.org>2008-06-14 19:49:49 +0200
commit101162257c14338eb2df7f331b18bca41813bff7 (patch)
tree438f40af4b2a339927c1f0c2f0a8ee4b3e12a07e /source3/smbd
parent82d4806ce62a78b0eecc4805b7ecf7f77b196864 (diff)
downloadsamba-101162257c14338eb2df7f331b18bca41813bff7.tar.gz
samba-101162257c14338eb2df7f331b18bca41813bff7.tar.bz2
samba-101162257c14338eb2df7f331b18bca41813bff7.zip
Move connection-specific vuid cache clear to uid.c
(This used to be commit 1025f687910ce40283c7344ed67ebd5bf31217b7)
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/conn.c17
-rw-r--r--source3/smbd/password.c2
-rw-r--r--source3/smbd/uid.c22
3 files changed, 25 insertions, 16 deletions
diff --git a/source3/smbd/conn.c b/source3/smbd/conn.c
index 5c75ed719e..1a67ac9b32 100644
--- a/source3/smbd/conn.c
+++ b/source3/smbd/conn.c
@@ -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);
}
}
diff --git a/source3/smbd/password.c b/source3/smbd/password.c
index 673a1a01c1..ebc72350b5 100644
--- a/source3/smbd/password.c
+++ b/source3/smbd/password.c
@@ -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--;
diff --git a/source3/smbd/uid.c b/source3/smbd/uid.c
index bded780c49..2bc5595661 100644
--- a/source3/smbd/uid.c
+++ b/source3/smbd/uid.c
@@ -143,6 +143,28 @@ static bool check_user_ok(connection_struct *conn, uint16_t vuid,
}
/****************************************************************************
+ 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.
****************************************************************************/