libmisc: minimum id check for system accounts
The minimum id allocation for system accounts shouldn't be 0 as this is reserved for root. Signed-off-by: Tomáš Mráz <tm@t8m.info> Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
This commit is contained in:
		
				
					committed by
					
						
						Serge Hallyn
					
				
			
			
				
	
			
			
			
						parent
						
							ead03afeba
						
					
				
				
					commit
					d324c6776b
				
			@@ -60,6 +60,13 @@ static int get_ranges (bool sys_group, gid_t *min_id, gid_t *max_id,
 | 
			
		||||
                            (unsigned long) *max_id);
 | 
			
		||||
			return EINVAL;
 | 
			
		||||
		}
 | 
			
		||||
		/*
 | 
			
		||||
		 * Zero is reserved for root and the allocation algorithm does not
 | 
			
		||||
		 * work right with it.
 | 
			
		||||
		 */
 | 
			
		||||
		if (*min_id == 0) {
 | 
			
		||||
			*min_id = (gid_t) 1;
 | 
			
		||||
		}
 | 
			
		||||
	} else {
 | 
			
		||||
		/* Non-system groups */
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user