mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	pulse-server: only unlink sockets
If the entity specified in a unix socket address exists, check if it is a socket, and bail out if it is not.
This commit is contained in:
		
							parent
							
								
									f19d998906
								
							
						
					
					
						commit
						70c6e6ccc8
					
				
					 1 changed files with 7 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -5971,6 +5971,13 @@ static int start_unix_server(struct server *server, const struct sockaddr_storag
 | 
			
		|||
		}
 | 
			
		||||
	}
 | 
			
		||||
	else if (socket_stat.st_mode & S_IWUSR || socket_stat.st_mode & S_IWGRP) {
 | 
			
		||||
		if (!S_ISSOCK(socket_stat.st_mode)) {
 | 
			
		||||
			res = -EEXIST;
 | 
			
		||||
			pw_log_warn(NAME" %p: '%s' exists and is not a socket",
 | 
			
		||||
				    server, addr_un->sun_path);
 | 
			
		||||
			goto error_close;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		/* socket is there, check if it's stale */
 | 
			
		||||
		if (!is_stale_socket(fd, addr_un)) {
 | 
			
		||||
			res = -EADDRINUSE;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue