winfsp / sshfs-win

SSHFS For Windows
https://winfsp.dev
Other
5.21k stars 264 forks source link

Files opened using readlink rather than open #73

Open davidbartonau opened 6 years ago

davidbartonau commented 6 years ago

I have Linux machines successfully mounting directories on /Dropbox however it fails when accessed from Windows.

Successful running on Linux. Note the success = yes on the last line.

time->Mon Nov 12 14:16:33 2018
type=PROCTITLE msg=audit(1542003393.562:281921): proctitle="/usr/lib/openssh/sftp-server"
type=PATH msg=audit(1542003393.562:281921): item=0 name="/Dropbox/" inode=4 dev=00:25 mode=042750 ouid=1020 ogid=1005 rdev=00:00 nametype=NORMAL
type=CWD msg=audit(1542003393.562:281921):  cwd="/home/david"
type=SYSCALL msg=audit(1542003393.562:281921): arch=c000003e syscall=2 success=yes exit=3 a0=55df62adf9a0 a1=90800 a2=7ffc3b749bf0 a3=0 items=1 ppid=27295 pid=27297 auid=1001 uid=1001 gid=1006 euid=1001 suid=1001 fsuid=1001 egid=1006 sgid=1006 fsgid=1006 tty=(none) ses=256183 comm="sftp-server" exe="/usr/lib/openssh/sftp-server" key="Dropbox"

Failure running from Windows. Note the success = no on the last line.

time->Mon Nov 12 14:10:38 2018
type=PROCTITLE msg=audit(1542003038.074:281328): proctitle="/usr/lib/openssh/sftp-server"
type=PATH msg=audit(1542003038.074:281328): item=0 name="/Dropbox/" inode=4 dev=00:25 mode=042750 ouid=1020 ogid=1005 rdev=00:00 nametype=NORMAL
type=CWD msg=audit(1542003038.074:281328):  cwd="/home/zahran"
type=SYSCALL msg=audit(1542003038.074:281328): arch=c000003e syscall=89 success=no exit=-22 a0=55a9d647a9b0 a1=7ffe7338f670 a2=fff a3=0 items=1 ppid=26520 pid=26523 auid=1003 uid=1003 gid=1008 euid=1003 suid=1003 fsuid=1003 egid=1008 sgid=1008 fsgid=1008 tty=(none) ses=256173 comm="sftp-server" exe="/usr/lib/openssh/sftp-server" key="Dropbox"

I have tried a --bind mount to mount the same directory into the user's home directory.

time->Mon Nov 12 14:40:23 2018
type=PROCTITLE msg=audit(1542004823.260:291861): proctitle="/usr/lib/openssh/sftp-server"
type=PATH msg=audit(1542004823.260:291861): item=0 name="/home/zahran/Dropbox/" inode=4 dev=00:25 mode=042750 ouid=1020 ogid=1005 rdev=00:00 nametype=NORMAL
type=CWD msg=audit(1542004823.260:291861):  cwd="/home/zahran"
type=SYSCALL msg=audit(1542004823.260:291861): arch=c000003e syscall=89 success=no exit=-22 a0=5636685879b0 a1=7ffe7bb05b60 a2=fff a3=0 items=1 ppid=30791 pid=30793 auid=1003 uid=1003 gid=1005 euid=1003 suid=1003 fsuid=1003 egid=1005 sgid=1005 fsgid=1005 tty=(none) ses=256221 comm="sftp-server" exe="/usr/lib/openssh/sftp-server" key="Dropbox"

However it fails the same way. The key difference seems to be the sycall 2 vs 89

This is coming from ausearch as part of audit d. Here is a verbose output from auth.log

Nov 12 06:21:29 prod-oneit-sshfs sftp-server[28210]: session opened for local user abc from [112.134.xxx.xxx]
Nov 12 06:21:29 prod-server sftp-server[28210]: received client version 3
Nov 12 06:21:30 prod-server sftp-server[28210]: lstat name "/Dropbox"
Nov 12 06:21:30 prod-server sftp-server[28210]: debug1: request 0: sent attrib have 0xf
Nov 12 06:21:30 prod-server sftp-server[28210]: stat name "."
Nov 12 06:21:30 prod-server sftp-server[28210]: debug1: request 1: sent attrib have 0xf
Nov 12 06:21:30 prod-server sftp-server[28210]: statvfs "/Dropbox"
Nov 12 06:21:30 prod-server sftp-server[28210]: lstat name "/Dropbox"
Nov 12 06:21:30 prod-server sftp-server[28210]: debug1: request 3: sent attrib have 0xf
Nov 12 06:21:30 prod-server sftp-server[28210]: readlink "/Dropbox"
Nov 12 06:21:30 prod-server sftp-server[28210]: sent status Bad message
billziss-gh commented 6 years ago

Which version of SSHFS-Win exhibits this problem?