diff options
-rwxr-xr-x | lacme | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -237,9 +237,9 @@ sub drop_privileges($$$) { # sanitize environment my $term = $ENV{TERM}; - my @ent = getpwuid($>) or die "getpwuid($>): $!"; + my @ent = getpwuid($<) or die "getpwuid($<): $!"; %ENV = ( USER => $ent[0], LOGNAME => $ent[0], HOME => $ent[7], SHELL => $ent[8] ); - $ENV{PATH} = $> == 0 ? "/usr/sbin:/usr/bin:/sbin:/bin" : "/usr/bin:/bin"; + $ENV{PATH} = $< == 0 ? "/usr/sbin:/usr/bin:/sbin:/bin" : "/usr/bin:/bin"; $ENV{TERM} = $term if defined $term; # preserve $TERM chdir $dir or die "chdir($dir): $!"; |