mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 06:02:44 +00:00 
			
		
		
		
	Kernel+Tests: Allow deleting someone else's file in my sticky directory
This should be allowed according to Dr. POSIX. :^)
This commit is contained in:
		
							parent
							
								
									47b9e8e651
								
							
						
					
					
						commit
						16f934474f
					
				
					 2 changed files with 50 additions and 1 deletions
				
			
		|  | @ -868,8 +868,13 @@ ErrorOr<void> VirtualFileSystem::rmdir(Credentials const& credentials, StringVie | |||
|         return EACCES; | ||||
| 
 | ||||
|     if (parent_metadata.is_sticky()) { | ||||
|         if (!credentials.is_superuser() && inode.metadata().uid != credentials.euid()) | ||||
|         // [EACCES] The S_ISVTX flag is set on the directory containing the file referred to by the path argument
 | ||||
|         //          and the process does not satisfy the criteria specified in XBD Directory Protection.
 | ||||
|         if (!credentials.is_superuser() | ||||
|             && inode.metadata().uid != credentials.euid() | ||||
|             && parent_metadata.uid != credentials.euid()) { | ||||
|             return EACCES; | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     size_t child_count = 0; | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Andreas Kling
						Andreas Kling