@@ -52,7 +52,7 @@ func (rsf *ReverseSSHFS) Prepare() error {
52
52
sshArgs = append (sshArgs , "-p" , strconv .Itoa (rsf .Port ))
53
53
}
54
54
sshArgs = append (sshArgs , rsf .Host , "--" )
55
- sshArgs = append (sshArgs , "mkdir" , "-p" , rsf .RemotePath )
55
+ sshArgs = append (sshArgs , "mkdir" , "-p" , strconv . Quote ( rsf .RemotePath ) )
56
56
sshCmd := exec .Command (sshBinary , sshArgs ... )
57
57
logrus .Debugf ("executing ssh for preparing sshfs: %s %v" , sshCmd .Path , sshCmd .Args )
58
58
out , err := sshCmd .CombinedOutput ()
@@ -138,7 +138,7 @@ func (rsf *ReverseSSHFS) Start() error {
138
138
sshArgs = append (sshArgs , "-p" , strconv .Itoa (rsf .Port ))
139
139
}
140
140
sshArgs = append (sshArgs , rsf .Host , "--" )
141
- sshArgs = append (sshArgs , "sshfs" , ":" + rsf .LocalPath , rsf .RemotePath , "-o" , "slave" )
141
+ sshArgs = append (sshArgs , "sshfs" , strconv . Quote ( ":" + rsf .LocalPath ), strconv . Quote ( rsf .RemotePath ) , "-o" , "slave" )
142
142
if rsf .Readonly {
143
143
sshArgs = append (sshArgs , "-o" , "ro" )
144
144
}
@@ -261,7 +261,8 @@ export LANG LC_ALL
261
261
i=0
262
262
while : ; do
263
263
# FIXME: not really robust
264
- if mount | grep "on ${dir}" | egrep -qw "fuse.sshfs|osxfuse"; then
264
+ # spaces in file names are encoded as '\040' in the mount table
265
+ if mount | sed 's/\\040/ /g' | grep "on ${dir}" | egrep -qw "fuse.sshfs|osxfuse"; then
265
266
echo '{"return":{}}'
266
267
exit 0
267
268
fi
0 commit comments