[dovecot-cvs] dovecot/src/login-common master.c,1.18.2.1,1.18.2.2

tss at dovecot.org tss at dovecot.org
Wed Oct 11 13:16:58 UTC 2006


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

Modified Files:
      Tag: branch_1_0
	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.18.2.1
retrieving revision 1.18.2.2
diff -u -d -r1.18.2.1 -r1.18.2.2
--- master.c	6 Aug 2006 20:05:24 -0000	1.18.2.1
+++ master.c	11 Oct 2006 12:16:56 -0000	1.18.2.2
@@ -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