bugfix: chdir(/) after chroot
Fix the famous chdir(".") vs chdir("/") after chroot(something).
			
			
This commit is contained in:
		
							parent
							
								
									6be5d4f5b6
								
							
						
					
					
						commit
						d4f9863635
					
				
					 1 changed files with 1 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -465,7 +465,7 @@ static bool drop_privs() {
 | 
			
		|||
	}
 | 
			
		||||
	if (do_chroot) {
 | 
			
		||||
		tzset();	/* for proper timestamps in logs */
 | 
			
		||||
		if (chroot(confbase) != 0 || chdir(".") != 0) {
 | 
			
		||||
		if (chroot(confbase) != 0 || chdir("/") != 0) {
 | 
			
		||||
			logger(LOG_ERR, _("%s failed"), "chroot()");
 | 
			
		||||
			return false;
 | 
			
		||||
		}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue