* Example script to set permissions for setuid operation.
This commit is contained in:
		
							parent
							
								
									71e867c5f5
								
							
						
					
					
						commit
						92417600a1
					
				
					 2 changed files with 10 additions and 1 deletions
				
			
		
							
								
								
									
										9
									
								
								fix_setuid
									
										
									
									
									
										Executable file
									
								
							
							
						
						
									
										9
									
								
								fix_setuid
									
										
									
									
									
										Executable file
									
								
							|  | @ -0,0 +1,9 @@ | ||||||
|  | #! /bin/sh | ||||||
|  | if test -z "$prefix"; then prefix=/nix; fi | ||||||
|  | chown -Rf nix.nix $prefix/bin $prefix/etc $prefix/include $prefix/lib \ | ||||||
|  |   $prefix/libexec $prefix/man $prefix/share $prefix/var | ||||||
|  | chown nix.nix $prefix/store | ||||||
|  | chmod 6755 $prefix/bin/nix-env $prefix/bin/nix-instantiate $prefix/bin/nix-store | ||||||
|  | chmod 775 $prefix/var/nix/manifests | ||||||
|  | chmod 775 $prefix/var/nix/gcroots/tmp | ||||||
|  | chmod 775 $prefix/var/nix/gcroots/channels | ||||||
|  | @ -943,7 +943,7 @@ SwitchToOriginalUser::~SwitchToOriginalUser() | ||||||
| void switchToNixUser() | void switchToNixUser() | ||||||
| { | { | ||||||
|     fprintf(stderr, "real = %d/%d, effective = %d/%d\n", |     fprintf(stderr, "real = %d/%d, effective = %d/%d\n", | ||||||
|         getuid(), geteuid(), getgid(), getegid()); |         getuid(), getgid(), geteuid(), getegid()); | ||||||
| 
 | 
 | ||||||
|     /* Note: we require setresuid for now since I don't want to think
 |     /* Note: we require setresuid for now since I don't want to think
 | ||||||
|        to deeply about whether this works on systems that don't have |        to deeply about whether this works on systems that don't have | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue