wok-current rev 19919
dropbear/sshx: add proxy ssh support
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Wed Apr 19 17:06:08 2017 +0200 (2017-04-19) |
parents | b537b3456464 |
children | e4d1fb5556df |
files | dropbear/stuff/sshx linld/stuff/src/VCPI.ASM |
line diff
1.1 --- a/dropbear/stuff/sshx Sun Apr 16 11:52:13 2017 +0200 1.2 +++ b/dropbear/stuff/sshx Wed Apr 19 17:06:08 2017 +0200 1.3 @@ -6,19 +6,25 @@ 1.4 svr=${DISPLAY#*:} 1.5 n=$((10+($RANDOM % 90))); dpy=localhost:$n 1.6 scr=${DISPLAY/${DISPLAY%.*}/$dpy} 1.7 - r="" 1.8 + r="" ; p="22"; k="" 1.9 while true; do 1.10 a="$1" 1.11 r="$r $1"; shift 1.12 case "$a" in 1.13 + -p) p=$1 ;; 1.14 + -i) k="$k-i $1 " ;; 1.15 + esac 1.16 + case "$a" in 1.17 -[piIlLRWKBJ]) r="$r $1"; shift;; 1.18 -*) ;; 1.19 *) break ;; 1.20 esac 1.21 done 1.22 xhost +localhost > /dev/null 2>&1 1.23 + pxypass="${DBPROXY_PASSWORD:+export DROPBEAR_PASSWORD=$DBPROXY_PASSWORD; }" 1.24 [ -n "$1" ] || set -- "${TERM:-xterm} -ls || ${TERM:-sakura} -l || xterm -ls" 1.25 exec dbclient -f -R $((6000+$n)):localhost:$((6000+${svr%.*})) $r \ 1.26 + ${DBPROXY:+-J "sh -c '${pxypass}dbclient ${k}-B ${a#*@}:$p $DBPROXY'"} \ 1.27 "xauth add $dpy $data; export DISPLAY=$scr; $@ ; xauth remove $dpy" \ 1.28 </dev/null >/dev/null 1.29 }
2.1 --- a/linld/stuff/src/VCPI.ASM Sun Apr 16 11:52:13 2017 +0200 2.2 +++ b/linld/stuff/src/VCPI.ASM Wed Apr 19 17:06:08 2017 +0200 2.3 @@ -145,52 +145,44 @@ 2.4 ;push bx 2.5 ;push ax 2.6 prepare_vcpi: 2.7 - ;push esi 2.8 - ;push es 2.9 2.10 ;Calculate pagedir/page0 addrs, initialize cr3 and pagedir[0] 2.11 xor eax,eax 2.12 ; heap_top = prepare_vcpi(malloc_or_die(8*1024+4)); 2.13 mov cx,8*1024+4 2.14 extrn malloc_or_die:near 2.15 - call malloc_or_die 2.16 + call malloc_or_die ;keep cx 2.17 2.18 - mov cl,4 2.19 mov edx,cs 2.20 shl edx,cl ;edx = linear addr of CS 2.21 mov si,offset gdt_vcpi 2.22 ; Fix up base of some gdt descriptors 2.23 ; Note: 'add [dword xx.base0],edx' actually updates 24 bit quantity! 2.24 ; Do NOT replace with mov! 2.25 - mov bx,-28h 2.26 + mov ebx,10000h-28h 2.27 add [dword bx+si+sw2pm_idtr_ptr-gdt_vcpi+28h],edx 2.28 @@fixup: 2.29 add [dword bx+si+(gdt_code.base0)-gdt_vcpi+28h],edx 2.30 - add bl,8 2.31 + add bx,8 2.32 js @@fixup 2.33 + mov bh,10h 2.34 add eax,edx 2.35 - dec eax 2.36 - shr eax,cl 2.37 - inc ah 2.38 - mov al,0 ;eax = 4k aligned linear addr of pagebuf 2.39 - mov es,ax ;es:0->page0,es:1000h->pagedir 2.40 - shl eax,cl ;eax=page0 linear addr 2.41 + and ax,0f000h ;eax = 4k aligned linear addr of pagebuf 2.42 + add eax,ebx ;eax=page0 linear addr 2.43 add [si+sw2pm_cr3-gdt_vcpi],eax 2.44 - mov di,ax 2.45 + mov edi,eax 2.46 + sub edi,edx 2.47 mov al,3 ;add present+writable bits 2.48 - mov [es:1000h],eax ;stuff it into pagedir[0] 2.49 + mov [bx+di],eax ;stuff it into pagedir[0] 2.50 push ds 2.51 - pop es 2.52 - sub di,dx ;ES:DI => page0 2.53 + pop es ;es:di->page0,es:di+1000h->pagedir 2.54 ;page directory will use only one entry (4 bytes): 2.55 ;cr3 => pagedir => page0 => ######## 2.56 ; (1 entry) (1024 => # 4M # 2.57 ; entries)=> # page # 2.58 ; => ######## 2.59 ; Return 2.60 - ;pop es 2.61 - ;pop esi 2.62 - lea ax,[di+1004h] 2.63 + lea ax,[bx+di+4] 2.64 extrn _heap_top:word 2.65 mov [_heap_top],ax 2.66 ;ret