From: Timo Sirainen Date: Fri, 22 Aug 2003 03:34:03 +0000 (+0300) Subject: bugfixes X-Git-Tag: 1.1.alpha1~4401 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7a87427770874f38d1d299635b37d699f9772860;p=thirdparty%2Fdovecot%2Fcore.git bugfixes --HG-- branch : HEAD --- diff --git a/src/auth/auth-master-connection.c b/src/auth/auth-master-connection.c index b14f1d5c65..d717895185 100644 --- a/src/auth/auth-master-connection.c +++ b/src/auth/auth-master-connection.c @@ -144,9 +144,6 @@ static void master_handle_request(struct auth_master_connection *conn, master_send_reply(conn, &failure_reply, sizeof(failure_reply), request->tag); } else { - /* the auth request is finished, we don't need it anymore */ - mech_request_free(client_conn, auth_request, request->id); - master_request = i_new(struct master_userdb_request, 1); master_request->conn = conn; master_request->tag = request->tag; @@ -154,6 +151,9 @@ static void master_handle_request(struct auth_master_connection *conn, conn->refcount++; userdb->lookup(auth_request->user, userdb_callback, master_request); + + /* the auth request is finished, we don't need it anymore */ + mech_request_free(client_conn, auth_request, request->id); } } diff --git a/src/lib-auth/auth-client.c b/src/lib-auth/auth-client.c index e68c248f78..d9981f07bc 100644 --- a/src/lib-auth/auth-client.c +++ b/src/lib-auth/auth-client.c @@ -105,7 +105,9 @@ void auth_client_connect_missing_servers(struct auth_client *client) client->to_reconnect = NULL; } - client->connect_notify_callback(client, - auth_client_is_connected(client), - client->connect_notify_context); + if (client->connect_notify_callback != NULL) { + client->connect_notify_callback(client, + auth_client_is_connected(client), + client->connect_notify_context); + } } diff --git a/src/lib-auth/auth-server-connection.c b/src/lib-auth/auth-server-connection.c index 063d1719f6..6c19df5bbd 100644 --- a/src/lib-auth/auth-server-connection.c +++ b/src/lib-auth/auth-server-connection.c @@ -44,7 +44,8 @@ static void auth_handle_handshake(struct auth_server_connection *conn, conn->client->conn_waiting_handshake_count--; update_available_auth_mechs(conn->client); - if (auth_client_is_connected(conn->client)) { + if (conn->client->connect_notify_callback != NULL && + auth_client_is_connected(conn->client)) { conn->client->connect_notify_callback(conn->client, TRUE, conn->client->connect_notify_context); } @@ -187,7 +188,7 @@ void auth_server_connection_destroy(struct auth_server_connection *conn, if (reconnect) auth_client_connect_missing_servers(client); - else { + else if (client->connect_notify_callback != NULL) { client->connect_notify_callback(client, auth_client_is_connected(client), client->connect_notify_context); diff --git a/src/login-common/main.c b/src/login-common/main.c index e0f640a38a..ca39d65eee 100644 --- a/src/login-common/main.c +++ b/src/login-common/main.c @@ -148,7 +148,6 @@ static void drop_privileges(const char *name) /* Refuse to run as root - we should never need it and it's dangerous with SSL. */ restrict_access_by_env(TRUE); - sleep(5); /* make sure we can't fork() */ restrict_process_size((unsigned int)-1, 1); diff --git a/src/login-common/master.c b/src/login-common/master.c index 1b3b87c14f..99d50fb1af 100644 --- a/src/login-common/master.c +++ b/src/login-common/master.c @@ -29,7 +29,9 @@ static void request_handle(struct master_login_reply *reply) if (client == NULL) i_fatal("Master sent reply with unknown tag %u", reply->tag); + client->master_tag = 0; client->master_callback(client, reply->success); + client->master_callback = NULL; hash_remove(master_requests, POINTER_CAST(reply->tag)); } @@ -60,10 +62,10 @@ void master_request_login(struct client *client, master_callback_t *callback, void master_request_abort(struct client *client) { + hash_remove(master_requests, POINTER_CAST(client->master_tag)); + client->master_tag = 0; client->master_callback = NULL; - - hash_remove(master_requests, POINTER_CAST(client->master_tag)); } void master_notify_finished(void)