* Unbreak programs that are not setuid (such as nix-hash).
This commit is contained in:
		
							parent
							
								
									e77fbe0fa2
								
							
						
					
					
						commit
						1c90fabccc
					
				
					 1 changed files with 3 additions and 0 deletions
				
			
		|  | @ -177,6 +177,9 @@ void switchToNixUser() | ||||||
| { | { | ||||||
| #if SETUID_HACK | #if SETUID_HACK | ||||||
| 
 | 
 | ||||||
|  |     /* Don't do anything if this is not a setuid binary. */ | ||||||
|  |     if (getuid() == geteuid()) return; | ||||||
|  | 
 | ||||||
|     /* Here we set the uid and gid to the Nix user and group,
 |     /* Here we set the uid and gid to the Nix user and group,
 | ||||||
|        respectively, IF the current (real) user is a member of the Nix |        respectively, IF the current (real) user is a member of the Nix | ||||||
|        group.  Otherwise we just drop all privileges. */ |        group.  Otherwise we just drop all privileges. */ | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue