Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/bsd/openresolv/dist PR port-evbarm/53661 (which has...



details:   https://anonhg.NetBSD.org/src/rev/2d6832fca998
branches:  trunk
changeset: 836290:2d6832fca998
user:      kre <kre%NetBSD.org@localhost>
date:      Mon Oct 08 14:09:38 2018 +0000

description:
PR port-evbarm/53661 (which has nothing particular to do with port-evbarm)

When eval'ing RESTARTCMD don't field split it, only to join the words
again (by eval) - that converts newlines and tabs to spaces, and the
first of those causes sh syntax errors with the way that the various
RESTARTCMDs are now written (but it was always dangerous, as filename
expansions could also have happened, which is not wanted, I believe.)

Also correct a translation error.

diffstat:

 external/bsd/openresolv/dist/resolvconf.in |  10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diffs (28 lines):

diff -r c2da4b087582 -r 2d6832fca998 external/bsd/openresolv/dist/resolvconf.in
--- a/external/bsd/openresolv/dist/resolvconf.in        Mon Oct 08 11:28:22 2018 +0000
+++ b/external/bsd/openresolv/dist/resolvconf.in        Mon Oct 08 14:09:38 2018 +0000
@@ -329,11 +329,11 @@
                        fi'
        elif [ -x /usr/sbin/service ]; then
                # Could be FreeBSD
-               RESTARTCMD='
-                       if /usr/sbin/service $1 $status >/dev/null 2>&1
+               RESTARTCMD="
+                       if /usr/sbin/service \$1 $status >/dev/null 2>&1
                        then
-                               /usr/sbin/service $1 restart
-                       fi'
+                               /usr/sbin/service \$1 restart
+                       fi"
        elif [ -x /bin/sv ]; then
                RESTARTCMD='/bin/sv status $1 >/dev/null 2>&1 &&
                            /bin/sv try-restart $1'
@@ -697,7 +697,7 @@
        detect_init || exit 1
        if [ "$cmd" = r ]; then
                set -- $args
-               eval $RESTARTCMD
+               eval "$RESTARTCMD"
        else
                echo "$RESTARTCMD"
        fi



Home | Main Index | Thread Index | Old Index