wok-next rev 21715

Up cookutils (1146)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue Jul 28 07:53:22 2020 +0000 (2020-07-28)
parents 5e27791cf19c
children 2ca805ec78e8
files cookutils/receipt dropbear/stuff/sshx
line diff
     1.1 --- a/cookutils/receipt	Mon Jul 06 17:32:49 2020 +0100
     1.2 +++ b/cookutils/receipt	Tue Jul 28 07:53:22 2020 +0000
     1.3 @@ -1,7 +1,7 @@
     1.4  # SliTaz package receipt v2.
     1.5  
     1.6  PACKAGE="cookutils"
     1.7 -VERSION="1143"
     1.8 +VERSION="1146"
     1.9  CATEGORY="base-system"
    1.10  SHORT_DESC="SliTaz packages builder new generation"
    1.11  MAINTAINER="devel@slitaz.org"
     2.1 --- a/dropbear/stuff/sshx	Mon Jul 06 17:32:49 2020 +0100
     2.2 +++ b/dropbear/stuff/sshx	Tue Jul 28 07:53:22 2020 +0000
     2.3 @@ -4,7 +4,7 @@
     2.4  {
     2.5  	read host data
     2.6  	svr=${DISPLAY#*:}
     2.7 -	n=$((10+($RANDOM % 90))); dpy=localhost:$n
     2.8 +	n=$((10+($RANDOM % 90))); dpy=127.0.0.1:$n
     2.9  	scr=${DISPLAY/${DISPLAY%.*}/$dpy}
    2.10  	r="" ; p="22"; k=""
    2.11  	while true; do
    2.12 @@ -20,11 +20,11 @@
    2.13  		*)		break ;;
    2.14  		esac
    2.15  	done
    2.16 -	xhost +localhost > /dev/null 2>&1
    2.17 +	xhost +127.0.0.1 > /dev/null 2>&1
    2.18  	pxypass="${DBPROXY_PASSWORD:+export DROPBEAR_PASSWORD=$DBPROXY_PASSWORD; }"
    2.19 -	[ -n "$1" ] || set -- "${TERM:-xterm} -ls || ${TERM:-sakura} -l || xterm -ls"
    2.20 -	exec dbclient -f -R $((6000+$n)):localhost:$((6000+${svr%.*})) $r \
    2.21 -	   ${DBPROXY:+-J "sh -c '${pxypass}dbclient ${k}-B ${a#*@}:$p $DBPROXY'"} \
    2.22 +	[ -n "$1" ] || set -- "${TERMINAL:-sakura} -l || ${TERM:-xterm} -ls || lxterminal"
    2.23 +	exec dbclient -f -R $((6000+$n)):127.0.0.1:$((6000+${svr%.*})) ${r/:/ -p } \
    2.24 +	   ${DBPROXY:+-J "sh -c '${pxypass}dbclient ${k}-B ${a#*@}:$p ${DBPROXY/:/ -p }'"} \
    2.25  	   "xauth add $dpy $data; export DISPLAY=$scr; $@ ; xauth remove $dpy" \
    2.26  	   </dev/null >/dev/null
    2.27  }
    2.28 @@ -32,12 +32,13 @@
    2.29  pppssh()
    2.30  {
    2.31  	ssh="dbclient -y"
    2.32 -	$ssh $1 true || {
    2.33 +	$ssh ${1/:/ -p } true || {
    2.34  		[ -z "$DROPBEAR_PASSWORD" ] && echo -n "ssh password: " &&
    2.35  		read -s -t 30 DROPBEAR_PASSWORD && export DROPBEAR_PASSWORD
    2.36 -		$ssh $1 true || exit 1
    2.37 +		$ssh ${1/:/ -p } true || exit 1
    2.38  	}
    2.39 -	extra="$(route -n | awk -vd=$(nslookup ${1#*@} | sed '/::/d' | \
    2.40 +	ipsvr=${1#*@}; ipsvr=${ipsvr%:*}
    2.41 +	extra="$(route -n | awk -vd=$(nslookup $ipsvr | sed '/::/d' | \
    2.42  		 sed '$!d;s/.*: \([^ ]*\).*/\1/') \
    2.43  		'$1=="0.0.0.0"{ print d " gw " $2 " dev " $8 }')"
    2.44  	for i in ${4/default/128.0.0.0/1 0.0.0.0/1} ; do
    2.45 @@ -48,13 +49,13 @@
    2.46  	n=10.$(($$%256)).$(($$/256))
    2.47  	n="${2:-$n.1:$n.2} passive"
    2.48  	ppp="/usr/sbin/pppd local noauth nodetach"
    2.49 -	arg="$n pty '$ssh $1 $ppp ${3:-proxyarp} notty'"
    2.50 +	arg="$n pty '$ssh ${1/:/ -p } $ppp ${3:-proxyarp} notty'"
    2.51  	pppsvr="$ppp $n ${3:-proxyarp} notty >/dev/null"
    2.52  	sshcmd="nc -ulp $5 -e $pppsvr"
    2.53 -	udpcmd="nc -u ${1#*@} $5"
    2.54 -	[ "$6" == "test" ] && sshcmd="nc -ulp $5 -e nc localhost 22" &&
    2.55 -	udpcmd="dbclient -y -J \"nc -u ${1#*@} $5\" ${1%@*}@localhost $pppsvr"
    2.56 -	[ -n "$5" ] && arg="noipdefault pty '$udpcmd'" && $ssh -f $1 "$sshcmd"
    2.57 +	udpcmd="nc -u $ipsvr $5"
    2.58 +	[ "$6" = "test" ] && sshcmd="nc -ulp $5 -e nc 127.0.0.1 22" &&
    2.59 +	udpcmd="dbclient -y -J \"nc -u $ipsvr $5\" ${1%@*}@127.0.0.1 $pppsvr"
    2.60 +	[ -n "$5" ] && arg="noipdefault pty '$udpcmd'" && $ssh -f ${1/:/ -p } "$sshcmd"
    2.61  	eval $ppp $arg ipparam pppssh$$
    2.62  	[ "$4" ] && route del $extra
    2.63  	rm -f /etc/ppp/ip-up.d/pppssh$$ 2> /dev/null
    2.64 @@ -65,8 +66,8 @@
    2.65  	p=5900
    2.66  	while netstat -tln | grep -q ":$p " ; do p=$(($p+1)); done
    2.67  	[ -r /dev/input/mice ] || echo "Warning: Cannot read mouse input." 1>&2
    2.68 -	svr=${1#*/}; [ "$svr" == "$1" ] && svr=127.0.0.1
    2.69 -	dbclient -y -f -N -L $p:$svr:${2:-5900} ${1%/*}
    2.70 +	r=${1%/*}; svr=${1#*/}; [ "$svr" = "$1" ] && svr=127.0.0.1
    2.71 +	dbclient -y -f -N -L $p:$svr:${2:-5900} ${r/:/ -p }
    2.72  	fbvnc 127.0.0.1 $p
    2.73  	kill $(netstat -tlnp 2> /dev/null | \
    2.74  	       sed "/:$p /!d;s|.* \\([0-9]*\\)/[^ ]*|\\1|")
    2.75 @@ -74,11 +75,11 @@
    2.76  
    2.77  case "$(basename $0)" in
    2.78  *vnc)	[ -z "$1" ] && cat <<EOT || xfbvnc "$@" ;;
    2.79 -Usage: $0 '[sshargs] user@remote[/lanip]' [vncport]
    2.80 +Usage: $0 '[sshargs] user@remote[:port][/lanip]' [vncport]
    2.81  $(fbvnc --help 2>&1 | sed '1,/Usage:/d')
    2.82  EOT
    2.83  ppp*)	[ -z "$1" ] && cat <<EOT || pppssh "$@" ;;
    2.84 -Usage: $0 '[sshargs] user@remote' '[localip:remoteip] [localpppargs]' 'remotepppargs' 'routes' [udp-port]
    2.85 +Usage: $0 '[sshargs] user@remote[:port]' '[localip:remoteip] [localpppargs]' 'remotepppargs' 'routes' [udp-port]
    2.86  Example: $0 tux@slitaz.org '' '' '192.168.1.0/24 10.1.2.0/24'
    2.87  EOT
    2.88  *)	[ -z "$DISPLAY" ] && exec dbclient -y "$@"