It seems this was meant to replace * with __star__ to prevent globbing,
but getconf already handles its values properly so globbing does not
occur. Currently, this replacement was broken due to the double
backslash, causing it to replace a backslash and all following
characters with __star__, instead of a literal *. This is also confirmed
by the fact that some handlers' documentation says to use __star__
instead of * directly in the configuration (and they have special
handling to turn __star__ back into * or something else as appropriate).
Eventually, we should just support using * directly and fixing up all
handling of the variable to not cause any globbing or other expansion
(also because fixing * isn't complete, there is also ? and sometimes ~
and other special characters might be expanded as well).
function getconf() {
ret=`printconf "$1" "$2"`
- # replace * with %, so that it is not globbed.
- ret="${ret//\\*/__star__}"
-
# We use escape the $ in $ret to delay expansion of $ret, so when $1
# is foo, eval sees foo=$ret and properly does the assignment
# (without the backslash, the right part of the assignment would be