mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 09:26:05 +00:00 
			
		
		
		
	Allow the file descriptor received from the client to be -1.
This commit is contained in:
		@@ -825,8 +825,6 @@ server_client_msg_dispatch(struct client *c)
 | 
				
			|||||||
		case MSG_IDENTIFY:
 | 
							case MSG_IDENTIFY:
 | 
				
			||||||
			if (datalen != sizeof identifydata)
 | 
								if (datalen != sizeof identifydata)
 | 
				
			||||||
				fatalx("bad MSG_IDENTIFY size");
 | 
									fatalx("bad MSG_IDENTIFY size");
 | 
				
			||||||
			if (imsg.fd == -1)
 | 
					 | 
				
			||||||
				fatalx("MSG_IDENTIFY missing fd");
 | 
					 | 
				
			||||||
			memcpy(&identifydata, imsg.data, sizeof identifydata);
 | 
								memcpy(&identifydata, imsg.data, sizeof identifydata);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			server_client_msg_identify(c, &identifydata, imsg.fd);
 | 
								server_client_msg_identify(c, &identifydata, imsg.fd);
 | 
				
			||||||
@@ -972,6 +970,8 @@ server_client_msg_identify(
 | 
				
			|||||||
		return;
 | 
							return;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if (fd == -1)
 | 
				
			||||||
 | 
							return;
 | 
				
			||||||
	if (!isatty(fd)) {
 | 
						if (!isatty(fd)) {
 | 
				
			||||||
		close(fd);
 | 
							close(fd);
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user