diff options
Diffstat (limited to 'src/chroot-tools/distcc-tool')
-rwxr-xr-x | src/chroot-tools/distcc-tool | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/chroot-tools/distcc-tool b/src/chroot-tools/distcc-tool index 7633029..f2e43dd 100755 --- a/src/chroot-tools/distcc-tool +++ b/src/chroot-tools/distcc-tool @@ -2,7 +2,9 @@ # -*- tab-width: 4; sh-basic-offset: 4 -*- # distcc-tool -# Copyright 2013 Luke Shumaker +# Copyright (C) 2013-2014 Luke Shumaker <lukeshu@sbcglobal.net> +# +# License: GNU GPLv3+ # # This file is part of Parabola. # @@ -32,6 +34,8 @@ if ! type gettext &>/dev/null; then gettext() { echo "$@"; } fi +q0="$(printf '%q' "$0")" # quoted $0 + panic() { echo "$(gettext 'panic: malformed call to internal function')" >&2 exit 1 @@ -50,7 +54,7 @@ print() { } usage() { - print "Usage: $0 COMMAND [COMMAND-ARGS]" + print "Usage: %s COMMAND [COMMAND-ARGS]" "$q0" print "Tool for using distcc within a networkless chroot" echo print "Commands:" @@ -125,7 +129,7 @@ parse_DISTCC_HOSTS() { *@*) # SSH_HOST doesn't allow custom port numbers, and even if it # did, ssh would complain about MITM. Instead, we'll count on - # ssh ProxyCommand being configured to used `client`. + # ssh ProxyCommand being configured to use `client`. newhosts+=("$HOSTSPEC") ;; # GLOBAL_OPTION @@ -135,7 +139,7 @@ parse_DISTCC_HOSTS() { ;; # ZEROCONF +zeroconf) - error "%s does not support the +zeroconf option" "$0" + error "%s does not support the +zeroconf option" "$q0" exit 1 ;; # TCP_HOST or OLDSTYLE_TCP_HOST @@ -159,7 +163,7 @@ parse_DISTCC_HOSTS() { # set up port forwaring if $forward_ports; then - socat TCP-LISTEN:${newport},fork SYSTEM:"$0 client $HOSTID ${PORT:-3632}" & + socat TCP-LISTEN:${newport},fork SYSTEM:"$q0 client $HOSTID ${PORT:-3632}" & pids+=($!) fi @@ -222,8 +226,8 @@ odaemon() { local chrootpath=$1 umask 111 - socat UNIX-LISTEN:"$chrootpath/socket",fork SYSTEM:"$0 server" & - trap "kill -- $!; rm -f '$chrootpath/socket'" EXIT + socat UNIX-LISTEN:"$chrootpath/socket",fork SYSTEM:"$q0 server" & + trap "kill -- $!; rm -f -- $(printf '%q' "$chrootpath/socket")" EXIT wait } |