On 2016/02/22 23:01, Marc Espie wrote:
> Theo went one step further, let's prevent ftp from fucking up and give it less
> variation from our env.

ok

> Index: OpenBSD/PackageRepository.pm
> ===================================================================
> RCS file: 
> /build/data/openbsd/cvs/src/usr.sbin/pkg_add/OpenBSD/PackageRepository.pm,v
> retrieving revision 1.117
> diff -u -p -r1.117 PackageRepository.pm
> --- OpenBSD/PackageRepository.pm      9 Feb 2016 10:02:27 -0000       1.117
> +++ OpenBSD/PackageRepository.pm      22 Feb 2016 21:59:35 -0000
> @@ -586,8 +586,14 @@ sub drop_privileges_and_setup_env
>               $< = $uid;
>               $> = $uid;
>       } 
> -     $ENV{LC_ALL} = 'C';
>       # don't error out yet if we can't change.
> +
> +     # proper error messages
> +     $ENV{LC_ALL} = 'C';
> +     # sanitize env for ftp
> +     delete $ENV{HOME};
> +     delete $ENV{PAGER};
> +     delete $ENV{TMPDIR};
>  }
>  
>  

Reply via email to