wok-next annotate sshfs-fuse/stuff/rsshfs @ rev 18940
Up musl-libc (1.1.14) CVE-2015-1817
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Wed Mar 02 11:58:42 2016 +0100 (2016-03-02) |
parents | fc1b98958191 |
children |
rev | line source |
---|---|
pascal@16756 | 1 #!/bin/sh |
pascal@16759 | 2 # from https://github.com/rom1v/rsshfs |
pascal@16756 | 3 |
pascal@16758 | 4 rhost="${2%%:*}" |
pascal@16756 | 5 rpath="${2#*:}" |
pascal@16756 | 6 lpath="$1" |
pascal@16759 | 7 shift 2 |
pascal@16756 | 8 |
pascal@16759 | 9 case "$lpath" in |
pascal@16759 | 10 -u) ssh "$rhost" fusermount -u $@ "$rpath" |
pascal@16756 | 11 ;; |
pascal@16756 | 12 |
pascal@16756 | 13 ''|-*) cat <<EOT |
pascal@16756 | 14 usage: |
pascal@16756 | 15 $0 localpath remotehost:remotepath [-o ro -o allow_other] |
pascal@16759 | 16 $0 -u remotehost:remotepath [-z] |
pascal@16756 | 17 EOT |
pascal@16756 | 18 ;; |
pascal@16756 | 19 |
pascal@16759 | 20 *) fifo=/tmp/rsshfs-$$ |
pascal@16763 | 21 ro="" |
pascal@16756 | 22 mkfifo $fifo |
pascal@16762 | 23 case " $@ " in |
pascal@16763 | 24 *\ -o\ ro\ *) ro="-R" |
pascal@16763 | 25 esac |
pascal@16763 | 26 /usr/sbin/sftp-server $ro <$fifo | \ |
pascal@16763 | 27 ssh "$rhost" sshfs -o slave ":$lpath" "$rpath" "$@" >$fifo |
pascal@16756 | 28 rm -f $fifo |
pascal@16756 | 29 esac |