Bug 2733 - sftp wildcard list missing stats if more than one match
Summary: sftp wildcard list missing stats if more than one match
Status: CLOSED DUPLICATE of bug 3465
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: sftp (show other bugs)
Version: 7.4p1
Hardware: amd64 Linux
: P5 minor
Assignee: Assigned to nobody
URL:
Keywords:
Depends on:
Blocks: V_9_1
  Show dependency treegraph
 
Reported: 2017-06-29 20:12 AEST by blackluck
Modified: 2022-10-04 21:58 AEDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description blackluck 2017-06-29 20:12:56 AEST
PLatform and version: Tried it on debian ans opensuse, and older debians where version is 6.0p1 or 5.1p1 so it's not a new error.

Problem: when listing files in sftp with wildcard and there is more than one match to the wildcard, then there is no file stats and order by also not working.

For example:
when there is one match to wildcard:
sftp> ls -l /var*
debug3: Sending SSH2_FXP_READDIR I:3
debug3: Received reply T:104 I:3
debug3: Received 25 SSH2_FXP_NAME responses
debug3: Sending SSH2_FXP_READDIR I:4
debug3: Received reply T:101 I:4
debug3: Received SSH2_FXP_STATUS 1
debug3: Sent message SSH2_FXP_CLOSE I:5
debug3: SSH2_FXP_STATUS 0
debug3: Sent message fd 3 T:7 I:6
debug3: Received stat reply T:105 I:6
debug3: Sending SSH2_FXP_READDIR I:8
debug3: Received reply T:104 I:8
debug3: Received 13 SSH2_FXP_NAME responses
debug3: Sending SSH2_FXP_READDIR I:9
debug3: Received reply T:101 I:9
debug3: Received SSH2_FXP_STATUS 1
debug3: Sent message SSH2_FXP_CLOSE I:10
debug3: SSH2_FXP_STATUS 0
drwxr-xr-x    2 root     root         4096 Jun 28 06:29 backups
drwxr-xr-x   11 root     root         4096 Jun 19 05:52 cache
drwxr-xr-x   52 root     root         4096 Jun 19 06:09 lib
drwxrwsr-x    2 root     staff        4096 Dec  4  2013 local
lrwxrwxrwx    1 root     root            9 Jan 13  2014 lock
drwxr-xr-x   10 root     root         4096 Jun 28 06:25 log
drwxrwsr-x    2 root     mail         4096 Nov  4  2014 mail
drwxr-xr-x    2 root     root         4096 Jan 13  2014 opt
lrwxrwxrwx    1 root     root            4 Jan 13  2014 run
drwxr-xr-x    5 root     root         4096 Jan 13  2014 spool
drwxrwxrwt    5 root     root         4096 Jun 28 03:18 tmp

there are file owners and everything, also if I want to order by date it's working fine.


But if there are more then one match to wildcard (it doesn't matter match to dirs or filenames), then there is no stats and order by not working, got random order

sftp> ls -l /lib*
debug3: Sending SSH2_FXP_READDIR I:12
debug3: Received reply T:104 I:12
debug3: Received 25 SSH2_FXP_NAME responses
debug3: Sending SSH2_FXP_READDIR I:13
debug3: Received reply T:101 I:13
debug3: Received SSH2_FXP_STATUS 1
debug3: Sent message SSH2_FXP_CLOSE I:14
debug3: SSH2_FXP_STATUS 0
debug3: Sent message fd 3 T:7 I:15
debug3: Received stat reply T:105 I:15
debug3: Sent message fd 3 T:7 I:16
debug3: Received stat reply T:105 I:16
drwxr-xr-x    0 0        0            4096 Jun 19 06:09 /lib/
drwxr-xr-x    0 0        0            4096 Jun 20 10:50 /lib64/


As it can see in debug messeges when working fine with one match there is "Sending SSH2_FXP_READDIR" message, but if there are more matches to wildcard then not sending that request.
Comment 1 Damien Miller 2022-09-28 12:06:52 AEST

*** This bug has been marked as a duplicate of bug 3465 ***
Comment 2 Damien Miller 2022-10-04 21:58:02 AEDT
Closing bugs from OpenSSH 9.1 release cycle