mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 09:26:05 +00:00 
			
		
		
		
	Give tmux sockets (but not the containing folder) group
permissions. This allows hardlinks to the sockets to be used more easily.
This commit is contained in:
		
							
								
								
									
										6
									
								
								server.c
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								server.c
									
									
									
									
									
								
							@@ -86,7 +86,7 @@ server_create_socket(void)
 | 
			
		||||
	if ((fd = socket(AF_UNIX, SOCK_STREAM, 0)) == -1)
 | 
			
		||||
		fatal("socket failed");
 | 
			
		||||
 | 
			
		||||
	mask = umask(S_IXUSR|S_IRWXG|S_IRWXO);
 | 
			
		||||
	mask = umask(S_IXUSR|S_IXGRP|S_IRWXO);
 | 
			
		||||
	if (bind(fd, (struct sockaddr *) &sa, SUN_LEN(&sa)) == -1)
 | 
			
		||||
		fatal("bind failed");
 | 
			
		||||
	umask(mask);
 | 
			
		||||
@@ -310,9 +310,9 @@ server_update_socket(void)
 | 
			
		||||
	if (n != last) {
 | 
			
		||||
		last = n;
 | 
			
		||||
		if (n != 0)
 | 
			
		||||
			chmod(socket_path, S_IRWXU);
 | 
			
		||||
			chmod(socket_path, S_IRWXU|S_IRWXG);
 | 
			
		||||
		else
 | 
			
		||||
			chmod(socket_path, S_IRUSR|S_IWUSR);
 | 
			
		||||
			chmod(socket_path, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP);
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user