diff src/master/login-process.c @ 2779:1fd55b4341b9 HEAD

Added version to login <-> master communication as well.
author Timo Sirainen <tss@iki.fi>
date Tue, 19 Oct 2004 04:17:39 +0300
parents 0f31778d3c34
children 634cf6aa34d1
line wrap: on
line diff
--- a/src/master/login-process.c	Tue Oct 19 04:17:20 2004 +0300
+++ b/src/master/login-process.c	Tue Oct 19 04:17:39 2004 +0300
@@ -238,6 +238,14 @@
 	}
 
 	ret = fd_read(p->fd, &req, sizeof(req), &client_fd);
+	if (ret >= (ssize_t)sizeof(req.version) &&
+	    req.version != MASTER_LOGIN_PROTOCOL_VERSION) {
+		i_error("login: Protocol version mismatch "
+			"(mixed old and new binaries?)");
+		login_process_destroy(p);
+		return;
+	}
+
 	if (ret != sizeof(req)) {
 		if (ret == 0) {
 			/* disconnected, ie. the login process died */