[dovecot-cvs] dovecot/src/login-common master.c,1.19,1.20

tss at dovecot.org tss at dovecot.org
Wed Oct 11 13:17:29 UTC 2006


Update of /var/lib/cvs/dovecot/src/login-common
In directory talvi:/tmp/cvs-serv12421/login-common

Modified Files:
	master.c 
Log Message:
Send inode number in login requests and verify that they match.



Index: master.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/login-common/master.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- master.c	6 Aug 2006 20:05:35 -0000	1.19
+++ master.c	11 Oct 2006 12:17:27 -0000	1.20
@@ -50,6 +50,7 @@
 			  unsigned int auth_pid, unsigned int auth_id)
 {
 	struct master_login_request req;
+	struct stat st;
 
 	i_assert(auth_pid != 0);
 
@@ -63,6 +64,10 @@
 	req.local_ip = client->local_ip;
 	req.remote_ip = client->ip;
 
+	if (fstat(client->fd, &st) < 0)
+		i_fatal("fstat(client) failed: %m");
+	req.ino = st.st_ino;
+
 	if (fd_send(master_fd, client->fd, &req, sizeof(req)) != sizeof(req))
 		i_fatal("fd_send(%d) failed: %m", client->fd);
 
@@ -90,6 +95,7 @@
 	memset(&req, 0, sizeof(req));
 	req.version = MASTER_LOGIN_PROTOCOL_VERSION;
 	req.tag = state;
+	req.ino = (ino_t)-1;
 
 	/* sending -1 as fd does the notification */
 	if (fd_send(master_fd, -1, &req, sizeof(req)) != sizeof(req))



More information about the dovecot-cvs mailing list