[dovecot-cvs] dovecot/src/lib-auth auth-client.c, 1.7,
1.8 auth-client.h, 1.11, 1.12 auth-server-connection.c, 1.15,
1.16 auth-server-connection.h, 1.9, 1.10 auth-server-request.c,
1.24, 1.25
cras at dovecot.org
cras at dovecot.org
Sat Jan 14 20:47:25 EET 2006
- Previous message: [dovecot-cvs] dovecot/src/imap-login client-authenticate.c, 1.37,
1.38 client.c, 1.46, 1.47 imap-proxy.c, 1.6, 1.7
- Next message: [dovecot-cvs]
dovecot/src/auth auth-cache.c, 1.16, 1.17 auth-cache.h,
1.5, 1.6 auth-client-connection.c, 1.39,
1.40 auth-client-connection.h, 1.10,
1.11 auth-master-connection.c, 1.39,
1.40 auth-master-connection.h, 1.12,
1.13 auth-master-listener.c, 1.4, 1.5 auth-master-listener.h,
1.2, 1.3 auth-module.c, 1.3, 1.4 auth-module.h, 1.1,
1.2 auth-request-handler.c, 1.10, 1.11 auth-request-handler.h,
1.6, 1.7 auth-request.c, 1.43, 1.44 auth-request.h, 1.21,
1.22 auth-worker-client.c, 1.20, 1.21 auth-worker-client.h,
1.2, 1.3 auth-worker-server.c, 1.6, 1.7 auth.c, 1.23,
1.24 auth.h, 1.16, 1.17 db-ldap.c, 1.36, 1.37 db-ldap.h, 1.19,
1.20 db-passwd-file.c, 1.17, 1.18 db-passwd-file.h, 1.8,
1.9 db-sql.c, 1.3, 1.4 db-sql.h, 1.2, 1.3 main.c, 1.52,
1.53 mech-gssapi.c, 1.3, 1.4 passdb-cache.c, 1.15,
1.16 passdb-checkpassword.c, 1.12, 1.13 passdb-ldap.c, 1.40,
1.41 passdb-pam.c, 1.33, 1.34 passdb-passwd-file.c, 1.23,
1.24 passdb-sql.c, 1.24, 1.25 passdb.c, 1.40,
1.41 password-scheme.c, 1.19, 1.20 userdb-ldap.c, 1.38,
1.39 userdb-passwd-file.c, 1.18, 1.19 userdb-sql.c, 1.12,
1.13 userdb.c, 1.24, 1.25
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /var/lib/cvs/dovecot/src/lib-auth
In directory talvi:/tmp/cvs-serv16037/lib-auth
Modified Files:
auth-client.c auth-client.h auth-server-connection.c
auth-server-connection.h auth-server-request.c
Log Message:
deinit, unref, destroy, close, free, etc. functions now take a pointer to
their data pointer, and set it to NULL. This makes double-frees less likely
to cause security holes.
Index: auth-client.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-auth/auth-client.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- auth-client.c 13 Jan 2006 20:26:03 -0000 1.7
+++ auth-client.c 14 Jan 2006 18:47:23 -0000 1.8
@@ -34,12 +34,15 @@
return client;
}
-void auth_client_free(struct auth_client *client)
+void auth_client_free(struct auth_client **_client)
{
+ struct auth_client *client = *_client;
struct auth_server_connection *next;
struct auth_mech_desc *mech;
size_t i, size;
+ *_client = NULL;
+
mech = buffer_get_modifyable_data(client->available_auth_mechs, &size);
size /= sizeof(*mech);
for (i = 0; i < size; i++)
@@ -48,12 +51,12 @@
while (client->connections != NULL) {
next = client->connections->next;
- auth_server_connection_destroy(client->connections, FALSE);
+ auth_server_connection_destroy(&client->connections, FALSE);
client->connections = next;
}
if (client->to_reconnect != NULL)
- timeout_remove(client->to_reconnect);
+ timeout_remove(&client->to_reconnect);
i_free(client->socket_paths);
i_free(client);
}
@@ -189,10 +192,8 @@
client->to_reconnect =
timeout_add(5000, reconnect_timeout, client);
}
- } else if (client->to_reconnect != NULL) {
- timeout_remove(client->to_reconnect);
- client->to_reconnect = NULL;
- }
+ } else if (client->to_reconnect != NULL)
+ timeout_remove(&client->to_reconnect);
if (client->connect_notify_callback != NULL) {
client->connect_notify_callback(client,
Index: auth-client.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-auth/auth-client.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- auth-client.h 13 Jan 2006 20:26:03 -0000 1.11
+++ auth-client.h 14 Jan 2006 18:47:23 -0000 1.12
@@ -42,7 +42,7 @@
/* Create new authentication client. */
struct auth_client *auth_client_new(unsigned int client_pid);
-void auth_client_free(struct auth_client *client);
+void auth_client_free(struct auth_client **client);
bool auth_client_is_connected(struct auth_client *client);
void auth_client_set_connect_notify(struct auth_client *client,
Index: auth-server-connection.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-auth/auth-server-connection.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- auth-server-connection.c 13 Jan 2006 20:26:03 -0000 1.15
+++ auth-server-connection.c 14 Jan 2006 18:47:23 -0000 1.16
@@ -135,13 +135,13 @@
return;
case -1:
/* disconnected */
- auth_server_connection_destroy(conn, TRUE);
+ auth_server_connection_destroy(&conn, TRUE);
return;
case -2:
/* buffer full - can't happen unless auth is buggy */
i_error("BUG: Auth server sent us more than %d bytes of data",
AUTH_CLIENT_MAX_LINE_LENGTH);
- auth_server_connection_destroy(conn, FALSE);
+ auth_server_connection_destroy(&conn, FALSE);
return;
}
@@ -156,7 +156,7 @@
AUTH_CLIENT_PROTOCOL_MAJOR_VERSION) {
i_error("Authentication server not compatible with "
"this client (mixed old and new binaries?)");
- auth_server_connection_destroy(conn, FALSE);
+ auth_server_connection_destroy(&conn, FALSE);
return;
}
conn->version_received = TRUE;
@@ -184,7 +184,7 @@
}
if (!ret) {
- auth_server_connection_destroy(conn, FALSE);
+ auth_server_connection_destroy(&conn, FALSE);
break;
}
}
@@ -249,18 +249,21 @@
if (o_stream_send_str(conn->output, handshake) < 0) {
errno = conn->output->stream_errno;
i_warning("Error sending handshake to auth server: %m");
- auth_server_connection_destroy(conn, TRUE);
+ auth_server_connection_destroy(&conn, TRUE);
return NULL;
}
return conn;
}
-void auth_server_connection_destroy(struct auth_server_connection *conn,
+void auth_server_connection_destroy(struct auth_server_connection **_conn,
bool reconnect)
{
+ struct auth_server_connection *conn = *_conn;
struct auth_client *client = conn->client;
struct auth_server_connection **pos;
+ *_conn = NULL;
+
if (conn->fd == -1)
return;
@@ -279,10 +282,8 @@
client->ext_input_remove(conn->ext_input_io);
conn->ext_input_io = NULL;
}
- if (conn->io != NULL) {
- io_remove(conn->io);
- conn->io = NULL;
- }
+ if (conn->io != NULL)
+ io_remove(&conn->io);
i_stream_close(conn->input);
o_stream_close(conn->output);
@@ -312,8 +313,8 @@
hash_destroy(conn->requests);
buffer_free(conn->auth_mechs_buf);
- i_stream_unref(conn->input);
- o_stream_unref(conn->output);
+ i_stream_unref(&conn->input);
+ o_stream_unref(&conn->output);
pool_unref(conn->pool);
}
Index: auth-server-connection.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-auth/auth-server-connection.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- auth-server-connection.h 13 Jan 2006 20:26:03 -0000 1.9
+++ auth-server-connection.h 14 Jan 2006 18:47:23 -0000 1.10
@@ -54,7 +54,7 @@
struct auth_server_connection *
auth_server_connection_new(struct auth_client *client, const char *path);
-void auth_server_connection_destroy(struct auth_server_connection *conn,
+void auth_server_connection_destroy(struct auth_server_connection **conn,
bool reconnect);
struct auth_server_connection *
Index: auth-server-request.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-auth/auth-server-request.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- auth-server-request.c 13 Jan 2006 20:26:03 -0000 1.24
+++ auth-server-request.c 14 Jan 2006 18:47:23 -0000 1.25
@@ -117,7 +117,7 @@
if (ret < 0) {
errno = conn->output->stream_errno;
i_warning("Error sending request to auth server: %m");
- auth_server_connection_destroy(conn, TRUE);
+ auth_server_connection_destroy(&conn, TRUE);
return FALSE;
}
@@ -144,7 +144,7 @@
if (o_stream_sendv(conn->output, iov, 3) < 0) {
errno = conn->output->stream_errno;
i_warning("Error sending continue request to auth server: %m");
- auth_server_connection_destroy(conn, TRUE);
+ auth_server_connection_destroy(&conn, TRUE);
}
}
- Previous message: [dovecot-cvs] dovecot/src/imap-login client-authenticate.c, 1.37,
1.38 client.c, 1.46, 1.47 imap-proxy.c, 1.6, 1.7
- Next message: [dovecot-cvs]
dovecot/src/auth auth-cache.c, 1.16, 1.17 auth-cache.h,
1.5, 1.6 auth-client-connection.c, 1.39,
1.40 auth-client-connection.h, 1.10,
1.11 auth-master-connection.c, 1.39,
1.40 auth-master-connection.h, 1.12,
1.13 auth-master-listener.c, 1.4, 1.5 auth-master-listener.h,
1.2, 1.3 auth-module.c, 1.3, 1.4 auth-module.h, 1.1,
1.2 auth-request-handler.c, 1.10, 1.11 auth-request-handler.h,
1.6, 1.7 auth-request.c, 1.43, 1.44 auth-request.h, 1.21,
1.22 auth-worker-client.c, 1.20, 1.21 auth-worker-client.h,
1.2, 1.3 auth-worker-server.c, 1.6, 1.7 auth.c, 1.23,
1.24 auth.h, 1.16, 1.17 db-ldap.c, 1.36, 1.37 db-ldap.h, 1.19,
1.20 db-passwd-file.c, 1.17, 1.18 db-passwd-file.h, 1.8,
1.9 db-sql.c, 1.3, 1.4 db-sql.h, 1.2, 1.3 main.c, 1.52,
1.53 mech-gssapi.c, 1.3, 1.4 passdb-cache.c, 1.15,
1.16 passdb-checkpassword.c, 1.12, 1.13 passdb-ldap.c, 1.40,
1.41 passdb-pam.c, 1.33, 1.34 passdb-passwd-file.c, 1.23,
1.24 passdb-sql.c, 1.24, 1.25 passdb.c, 1.40,
1.41 password-scheme.c, 1.19, 1.20 userdb-ldap.c, 1.38,
1.39 userdb-passwd-file.c, 1.18, 1.19 userdb-sql.c, 1.12,
1.13 userdb.c, 1.24, 1.25
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the dovecot-cvs
mailing list