Fixed returning EPERM when not allowed as owner
For actions which may be allowed depending on the ownership rather than permissions (such as utime()), return EPERM if the owner cannot be determined.pull/2/head
							parent
							
								
									314b5396bd
								
							
						
					
					
						commit
						aa7af7d53b
					
				| 
						 | 
				
			
			@ -3048,13 +3048,13 @@ BOOL ntfs_allowed_as_owner(struct SECURITY_CONTEXT *scx, ntfs_inode *ni)
 | 
			
		|||
				free(oldattr);
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
		allowed = FALSE;
 | 
			
		||||
		if (gotowner) {
 | 
			
		||||
/* TODO : use CAP_FOWNER process capability */
 | 
			
		||||
			if (!processuid || (processuid == uid))
 | 
			
		||||
				allowed = TRUE;
 | 
			
		||||
			else
 | 
			
		||||
				errno = EPERM;
 | 
			
		||||
		if (gotowner
 | 
			
		||||
		    && (!processuid || (processuid == uid)))
 | 
			
		||||
			allowed = TRUE;
 | 
			
		||||
		else {
 | 
			
		||||
			allowed = FALSE;
 | 
			
		||||
			errno = EPERM;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	return (allowed);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue