mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 11:12:45 +00:00 
			
		
		
		
	LibFileSystemAccessClient: Don't make illegal operation on files
`handle_prompt_end` is calling `is_device` and `is_directory` on the
path chosen by the user. However, this path is not necessarily unveiled.
Meaning that it the both functions results in an illegal operation.
This is a regression introduced with the usage of LibFileSystem in
1d24f394. This patch, revert the behavior at its previous state, i.e.
calling both functions with the fd provided by the FSAS.
			
			
This commit is contained in:
		
							parent
							
								
									3400779047
								
							
						
					
					
						commit
						832478ad0c
					
				
					 1 changed files with 2 additions and 2 deletions
				
			
		|  | @ -129,13 +129,13 @@ void Client::handle_prompt_end(i32 request_id, i32 error, Optional<IPC::File> co | |||
|         return; | ||||
|     } | ||||
| 
 | ||||
|     if (FileSystem::is_device(*chosen_file)) { | ||||
|     if (FileSystem::is_device(ipc_file->fd())) { | ||||
|         GUI::MessageBox::show_error(request_data.parent_window, DeprecatedString::formatted("Opening \"{}\" failed: Cannot open device files", *chosen_file)); | ||||
|         request_data.promise->resolve(Error::from_string_literal("Cannot open device files")).release_value_but_fixme_should_propagate_errors(); | ||||
|         return; | ||||
|     } | ||||
| 
 | ||||
|     if (FileSystem::is_directory(*chosen_file)) { | ||||
|     if (FileSystem::is_directory(ipc_file->fd())) { | ||||
|         GUI::MessageBox::show_error(request_data.parent_window, DeprecatedString::formatted("Opening \"{}\" failed: Cannot open directory", *chosen_file)); | ||||
|         request_data.promise->resolve(Error::from_errno(EISDIR)).release_value_but_fixme_should_propagate_errors(); | ||||
|         return; | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Lucas CHOLLET
						Lucas CHOLLET