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.
*** This bug has been marked as a duplicate of bug 3465 ***
Closing bugs from OpenSSH 9.1 release cycle