Hi,

I got a message from a FreeBSD port collection officer.
It cites a problem discovered by a robot which checks how smoothly
different ports are getting installed at FreeBSD.
The robot is not happy with the installtemplates.sh script of the
openxpki-deployment set.

As far as I can trace the problem, we have a conflict of two points.

1. Executables which are not part of the base FreeBSD system,
usually go into /usr/local/bin. In particular, we have
/usr/local/bin/perl and /usr/local/bin/bash.

2. Traditionally all FreeBSD robots (and root user by default too)
have PATH, which does _not_ include /usr/local/bin. (BTW regular
FreeBSD human user has a PATH which by default _does_ include
/usr/local/bin.)

The situation with perl is not that hard, because by default perl
installation creates a link /usr/bin/perl ----> /usr/local/bin/perl
(unfortunately creation of this link can be switched off). And
/usr/bin/perl is in a default path for everybody. The situation with
bash is not that easy.

Hence the construct

#!/usr/bin/env bash

in a first line of a script produce unpredictable results for robots
and root depending on details of configuration tables of env. It
seems, these tables can define substitutions like bash --> sh in
case bash can not be found on a path.

I suggest to change all constructs similar to above into a construct
like follows:

#!/usr/bin/env -S-P/usr/local/bin:${PATH} bash

which explicitly adds /usr/local/bin to the searched path for bash
or perl.

This is borrowed from the env's man, and seems to do no harm to
systems other than FreeBSD.

If you agree, I can do the changes for all perl and bash calls.

All the best, Sergei


------------------------------------------------------------------------------
_______________________________________________
OpenXPKI-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openxpki-devel

Reply via email to