I know this is a wontfix, but maybe this should be reconsidered in light of 
buster’s changes?
With the switch of su as referenced here: 
https://sources.debian.org/src/util-linux/2.33.1-0.1/debian/util-linux.NEWS , 
there is no reason why dpkg shouldn’t add /sbin and /usr/sbin to the back of 
the path, after any other user-defined path entries which would override it. 
Supposedly “dpkg ensures that the PATH is set to a reasonable value” but it’s 
certainly failing in this case. No harm is done- only benefit. With the new 
‘su’ as people get used to it, we’re going to see lots of failures. Failures 
that could incorrectly configure packages and lead to more bugs due to 
configuration issues. Bugs like this one ( 
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=926449 )

> Upgrading from 3.4.4 to 3.4.5-1, I see the following messages after a 'su'
> to root Preconfiguring packages ...
>     Can't exec "postconf": No such file or directory at
> /tmp/postfix.config.swGX60 line 220, <STDIN> line 14. Can't exec
> "postconf": No such file or directory at /tmp/postfix.config.swGX60 line
> 284, <STDIN> line 16. Can't exec "postconf": No such file or directory at
> /tmp/postfix.config.swGX60 line 386, <STDIN> line 21.



Scott Kitterman’s comment when this bug was reported I think accurately points 
to this bug (thank you Scott)
“If there is a bug here, it's probably in dpkg.  I think that the postfix  
package is aligned to policy and Debian best practices.  See below.  Please  
review and consider if this should be reassigned.

Here's an extract from policy 6.1:

Programs called from maintainer scripts should not normally have a path 
prepended to them. Before installation is started, the package management 
system checks to see if the programs ldconfig, start-stop-daemon, and 
update-rc.d can be found via the PATH environment variable. Those programs, and 
any other program that one would expect to be in the PATH, should thus be 
invoked 
without an absolute pathname. Maintainer scripts should also not reset the 
PATH, though they might choose to modify it by prepending or appending 
package-specific directories. These considerations really apply to all shell 
scripts.

There is a related lintian [1] check which says, in part:

Programs called from maintainer scripts normally should not have a path 
prepended. dpkg ensures that the PATH is set to a reasonable value, and 
prepending a path may prevent the local administrator from using a replacement 
version of a command for some local reason.

[1] https://lintian.debian.org/tags/command-with-path-in-maintainer-script.html

Reply via email to