[dovecot-cvs] dovecot/src/auth auth-client-connection.c, 1.45, 1.46 auth-master-connection.c, 1.48, 1.49
tss at dovecot.org
tss at dovecot.org
Mon Apr 16 21:02:04 EEST 2007
Update of /var/lib/cvs/dovecot/src/auth
In directory talvi:/tmp/cvs-serv21831
Modified Files:
auth-client-connection.c auth-master-connection.c
Log Message:
Log an error and disconnect with unknown commands.
Index: auth-client-connection.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/auth/auth-client-connection.c,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -d -r1.45 -r1.46
--- auth-client-connection.c 15 Dec 2006 18:38:08 -0000 1.45
+++ auth-client-connection.c 16 Apr 2007 18:02:02 -0000 1.46
@@ -7,6 +7,7 @@
#include "network.h"
#include "array.h"
#include "str.h"
+#include "str-sanitize.h"
#include "safe-memset.h"
#include "auth-request-handler.h"
#include "auth-client-interface.h"
@@ -182,10 +183,9 @@
line + 5);
}
- /* ignore unknown command */
- if (conn->auth->verbose_debug)
- i_info("client in (unknown command): %s", line);
- return TRUE;
+ i_error("BUG: Authentication client sent unknown command: %s",
+ str_sanitize(line, 80));
+ return FALSE;
}
static void auth_client_input(struct auth_client_connection *conn)
@@ -234,6 +234,12 @@
auth_client_connection_destroy(&conn);
return;
}
+ } else {
+ i_error("BUG: Authentication client sent "
+ "unknown handshake command: %s",
+ str_sanitize(line, 80));
+ auth_client_connection_destroy(&conn);
+ return;
}
}
Index: auth-master-connection.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/auth/auth-master-connection.c,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -d -r1.48 -r1.49
--- auth-master-connection.c 21 Mar 2007 20:13:00 -0000 1.48
+++ auth-master-connection.c 16 Apr 2007 18:02:02 -0000 1.49
@@ -5,6 +5,7 @@
#include "buffer.h"
#include "hash.h"
#include "str.h"
+#include "str-sanitize.h"
#include "ioloop.h"
#include "istream.h"
#include "ostream.h"
@@ -193,9 +194,15 @@
ret = master_input_request(conn, line + 8);
else if (strncmp(line, "USER\t", 5) == 0)
ret = master_input_user(conn, line + 5);
- else {
+ else if (strncmp(line, "CPID\t", 5) == 0) {
+ i_error("Authentication client trying to connect to "
+ "master socket");
+ ret = FALSE;
+ } else {
/* ignore unknown command */
- ret = TRUE;
+ i_error("BUG: Unknown command in master socket: %s",
+ str_sanitize(line, 80));
+ ret = FALSE;
}
t_pop();
More information about the dovecot-cvs
mailing list