mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 08:52:44 +00:00 
			
		
		
		
	Kernel: No need to check is_superuser() after may_execute().
Since may_execute() incorporates a superuser check. :^)
This commit is contained in:
		
							parent
							
								
									5e40aa4f1a
								
							
						
					
					
						commit
						159fa99539
					
				
					 1 changed files with 2 additions and 2 deletions
				
			
		|  | @ -295,7 +295,7 @@ KResultOr<Retained<Inode>> VFS::open_directory(const String& path, Inode& base) | |||
|     auto inode = inode_or_error.value(); | ||||
|     if (!inode->is_directory()) | ||||
|         return KResult(-ENOTDIR); | ||||
|     if (!inode->metadata().may_execute(*current) && !current->is_superuser()) | ||||
|     if (!inode->metadata().may_execute(*current)) | ||||
|         return KResult(-EACCES); | ||||
|     return Retained<Inode>(*inode); | ||||
| } | ||||
|  | @ -589,7 +589,7 @@ KResultOr<InodeIdentifier> VFS::resolve_path(const String& path, InodeIdentifier | |||
| #endif | ||||
|             return KResult(-ENOTDIR); | ||||
|         } | ||||
|         if (!metadata.may_execute(*current) && !current->is_superuser()) | ||||
|         if (!metadata.may_execute(*current)) | ||||
|             return KResult(-EACCES); | ||||
|         auto parent = crumb_id; | ||||
|         crumb_id = crumb_inode->lookup(part); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Andreas Kling
						Andreas Kling