On 24 March 2018 at 03:03, Corinna Vinschen <vinschen at redhat.com> wrote: [...]> session opened for local user corinna from [UNKNOWN] > received client version 3 > debug2: Permitting whitelisted realpath request > debug3: request 1: realpath > realpath "." > debug1: request 1: sent names count 1 > Refusing non-whitelisted statvfs request > debug3: request 2: sent status 3 > sent status Permission denied > debug1: read eof > session closed for local user corinna from [UNKNOWN] > > Can you please explain what's going on there?Adding a "set -x" to test-exec.sh shows the failing command is: The log from the sftp client is: /home/builder/openssh/sftp -q -S /home/builder/openssh/regress/ssh-log-wrapper.sh -F /home/builder/openssh/regress/ssh_config -b /dev/stdin sftp://builder at somehost:4242//home/builder/openssh/regress/copy.dd/ and it gets the commands "version" and ""put ${DATA} copy" on its stdin. The client log says: debug2: Remote version: 3 debug2: Server supports extension "posix-rename at openssh.com" revision 1 debug2: Server supports extension "statvfs at openssh.com" revision 2 debug2: Server supports extension "fstatvfs at openssh.com" revision 2 debug2: Server supports extension "hardlink at openssh.com" revision 1 debug2: Server supports extension "fsync at openssh.com" revision 1 debug3: Sent message fd 6 T:16 I:1 debug3: SSH_FXP_REALPATH . -> /home/builder/openssh/regress size 0 sftp> df / debug3: Received statvfs reply T:101 I:2 debug1: Couldn't statvfs: Permission denied so according to the log, the server is refusing the statvfs request. I don't understand where the "df /" command is coming from or why the server refuses it. FWIW the df works OK with the standalone sftp-server, though. $ ./sftp -vvv -D ./sftp-server localhost debug2: Remote version: 3 debug2: Server supports extension "posix-rename at openssh.com" revision 1 debug2: Server supports extension "statvfs at openssh.com" revision 2 debug2: Server supports extension "fstatvfs at openssh.com" revision 2 debug2: Server supports extension "hardlink at openssh.com" revision 1 debug2: Server supports extension "fsync at openssh.com" revision 1 Attached to ./sftp-server. debug3: Sent message fd 6 T:16 I:1 debug3: SSH_FXP_REALPATH . -> /home/builder/openssh size 0 sftp> df / debug3: 'Received statvfs reply T:201 I:2 Size Used Avail (root) %Capacity 20457468 12423640 8033828 8033828 60% -- Darren Tucker (dtucker at dtucker.net) GPG key 11EAA6FA / A86E 3E07 5B19 5880 E860 37F4 9357 ECEF 11EA A6FA (new) Good judgement comes with experience. Unfortunately, the experience usually comes from bad judgement.
On 24 March 2018 at 06:42, Darren Tucker <dtucker at dtucker.net> wrote:> On 24 March 2018 at 03:03, Corinna Vinschen <vinschen at redhat.com> wrote: > [...] >> session opened for local user corinna from [UNKNOWN] >> received client version 3 >> debug2: Permitting whitelisted realpath request >> debug3: request 1: realpath >> realpath "." >> debug1: request 1: sent names count 1 >> Refusing non-whitelisted statvfs request >> debug3: request 2: sent status 3 >> sent status Permission denied >> debug1: read eof >> session closed for local user corinna from [UNKNOWN] >> >> Can you please explain what's going on there?It's something to do with reading the commands from /dev/stdin although I don't understand why. This passes: --- a/regress/sftp-uri.sh +++ b/regress/sftp-uri.sh @@ -33,12 +33,13 @@ ${SFTP} -q -S "$SSH" -F $OBJ/ssh_config "sftp://${USER}@somehost:${PORT}/${COPY} cmp ${COPY} ${DIR}/copy || fail "corrupted copy" verbose "$tid: put to remote directory (trailing slash)" -sftpclean -${SFTP} -q -S "$SSH" -F $OBJ/ssh_config -b /dev/stdin \ - "sftp://${USER}@somehost:${PORT}/${DIR}/" > /dev/null 2>&1 << EOF +cat >batch << EOF version put ${DATA} copy EOF +sftpclean +${SFTP} -S "$SSH" -F $OBJ/ssh_config -b batch \ + "sftp://${USER}@somehost:${PORT}/${DIR}/" r=$? if [ $r -ne 0 ]; then fail "sftp failed with $r" -- Darren Tucker (dtucker at dtucker.net) GPG key 11EAA6FA / A86E 3E07 5B19 5880 E860 37F4 9357 ECEF 11EA A6FA (new) Good judgement comes with experience. Unfortunately, the experience usually comes from bad judgement.
On Mar 24 07:03, Darren Tucker wrote:> On 24 March 2018 at 06:42, Darren Tucker <dtucker at dtucker.net> wrote: > > On 24 March 2018 at 03:03, Corinna Vinschen <vinschen at redhat.com> wrote: > > [...] > >> session opened for local user corinna from [UNKNOWN] > >> received client version 3 > >> debug2: Permitting whitelisted realpath request > >> debug3: request 1: realpath > >> realpath "." > >> debug1: request 1: sent names count 1 > >> Refusing non-whitelisted statvfs request > >> debug3: request 2: sent status 3 > >> sent status Permission denied > >> debug1: read eof > >> session closed for local user corinna from [UNKNOWN] > >> > >> Can you please explain what's going on there? > > It's something to do with reading the commands from /dev/stdin > although I don't understand why. > > This passes: > > --- a/regress/sftp-uri.sh > +++ b/regress/sftp-uri.sh > @@ -33,12 +33,13 @@ ${SFTP} -q -S "$SSH" -F $OBJ/ssh_config > "sftp://${USER}@somehost:${PORT}/${COPY} > cmp ${COPY} ${DIR}/copy || fail "corrupted copy" > > verbose "$tid: put to remote directory (trailing slash)" > -sftpclean > -${SFTP} -q -S "$SSH" -F $OBJ/ssh_config -b /dev/stdin \Why does it not use `-b -'? This is documented as reading the batch from stdin without the /dev/stdin workaround. I'm not sure ATM why `-b /dev/stdin' doesn't work here(*), but is it important for the test? Thanks, Corinna (*) likely a bug in Cygwin -- Corinna Vinschen Cygwin Maintainer Red Hat -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: not available URL: <http://lists.mindrot.org/pipermail/openssh-unix-dev/attachments/20180324/6c461b41/attachment.asc>