From 04d6910c8ce3ceedafe1a8c0de34c51f2c099b93 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Mon, 13 Oct 2008 16:02:11 +0200 Subject: [PATCH] Ensure sessions with different auth IDs are not shared. This patch re-establishes the check for non-ZOOM code which ensure that Z39.50 sessions with different authentication parameters are not shared (reused). --- src/connection.c | 13 +++---------- src/connection.h | 1 - 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/src/connection.c b/src/connection.c index cdbe4da..b9964be 100644 --- a/src/connection.c +++ b/src/connection.c @@ -71,7 +71,6 @@ struct connection { struct client *client; char *ibuf; int ibufsize; - char *authentication; // Empty string or authentication string if set char *zproxy; enum { Conn_Resolving, @@ -181,7 +180,6 @@ static struct connection *connection_create(struct client *cl) new->next = new->host->connections; new->host->connections = new; new->client = cl; - new->authentication = ""; new->zproxy = 0; client_set_connection(cl, new); new->link = 0; @@ -426,11 +424,6 @@ const char *connection_get_url(struct connection *co) return client_get_url(co->client); } -void connection_set_authentication(struct connection *co, char *auth) -{ - co->authentication = auth; -} - // Ensure that client has a connection associated int client_prep_connection(struct client *cl) { @@ -454,9 +447,9 @@ int client_prep_connection(struct client *cl) for (co = host->connections; co; co = co->next) if (connection_is_idle(co) && (!co->client || client_get_session(co->client) != se) && - !strcmp(co->authentication, - session_setting_oneval(client_get_database(cl), - PZ_AUTHENTICATION))) + !strcmp(ZOOM_connection_option_get(co->link, "user"), + session_setting_oneval(client_get_database(cl), + PZ_AUTHENTICATION))) { if (zproxy == 0 && co->zproxy == 0) break; diff --git a/src/connection.h b/src/connection.h index 13fdd14..e208fca 100644 --- a/src/connection.h +++ b/src/connection.h @@ -35,7 +35,6 @@ struct session; void connection_destroy(struct connection *co); void connect_resolver_host(struct host *host); -void connection_set_authentication(struct connection *co, char *auth); int connection_connect(struct connection *con); struct connection *connection_get_available(struct connection *con_list, struct session *se); -- 1.7.10.4