Hi,
On 29.03.15 00:47, Wietse Venema wrote:
I think that should be
eval junk=\"\$$name\"
The quotes are needed to contain value of the indirectly-referenced
parameter. The quotes are not needed for $name which cannot contain
spaces, as $name is generated with ``for name in $MOST_PARAMETERS''.
I believe the quotes enclosing \$$name might not be strictly necessary,
either.
Subsection 2.9.1. ("Simple Commands") [1] of "The Shell and Utilities
volume of POSIX.1-2008" [2] seems to imply that variable assignments are
not subject to field splitting.
In any case, please note that the idiom
eval junk=\$$name
is used in multiple other places within post-install (see patch below).
Also, there may be other, similar instances of that idiom.
[1]:
<http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_09_01>
[2]: <http://pubs.opengroup.org/onlinepubs/9699919799/>
Regards,
Julian Reich
diff -ru postfix-3.0.0/conf/post-install postfix/conf/post-install
--- postfix-3.0.0/conf/post-install 2014-06-28 14:49:13.000000000 +0200
+++ postfix/conf/post-install 2015-03-29 11:58:30.000000000 +0200
@@ -332,7 +332,7 @@
test -f $config_directory/install.cf && {
for name in sendmail_path newaliases_path mailq_path setgid
manpages
do
- eval junk=\$$name
+ eval junk=\"\$$name\"
case "$junk" in
"") eval unset $name;;
esac
@@ -349,7 +349,7 @@
test -f $config_directory/main.cf && {
for name in $MOST_PARAMETERS
do
- eval junk=\$$name
+ eval junk=\"\$$name\"
case "$junk" in
"") eval unset $name;;
esac
@@ -436,7 +436,7 @@
for name in $MOST_PARAMETERS
do
- eval junk=\$$name
+ eval junk=\"\$$name\"
case "$junk" in
*"$mail_version"*)
case "$pattern" in