PATH in maintainer scripts taken from env that calls dpkg
From
Christoph Anton Mitterer@21:1/5 to
All on Thu Aug 22 03:30:01 2024
Hey.
Not sure whether this is a bug or intended behaviour,... but I've just
noticed that is seems that when e.g. purging a package postrm will see
the PATH as it was set in the env from which dpkg --pruge was invoked.
I.e. there is no "sanitisation" to some static value like "/usr/sbin:/usr/bin:/sbin:/bin" or so.
I guess for the maintainer scripts it should never make any sense to
run them in a non-standard PATH, or should it?
I haven't checked how the behaviour is for other env vars, e.g. whether
things like POSIXLY_CORRECT or so are passed on.
In principle, I guess, the env should be most cleaned (other than
perhaps things like TERM) and only some standard env vars be set for
whatever dpkg invokes?
Cheers,
Chris.
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)