sftp remoteserver "ls -l" error

Bug #1028280 reported by Byka
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
openssh (Ubuntu)
Fix Released
High
Unassigned
Precise
Won't Fix
High
Unassigned

Bug Description

When connected via sftp to remote server, the "ls -l *" returns wrong information, other then "ls -l filename".

Example:
-----------------------------------------------
$ uname -a
Linux laptop 2.6.38-15-generic #59-Ubuntu SMP Fri Apr 27 16:04:29 UTC 2012 i686 i686 i386 GNU/Linux
$ ssh -v
OpenSSH_5.8p1 Debian-1ubuntu3, OpenSSL 0.9.8o 01 Jun 2010
....
$ sftp remoteserver
sftp> ls -l *tgz
-rw-r--r-- 0 1001 0 334258 Jun 10 21:59 ifly.root.tgz
-rw-r--r-- 0 1001 0 467990 Jul 24 09:50 ifly_root.tgz
sftp> ls -l ifly.root.tgz
-rw-r--r-- 0 1001 0 467990 Jul 24 09:50 ifly.root.tgz
sftp> ls -l ifly_root.tgz
-rw-r--r-- 0 1001 0 334258 Jun 10 21:59 ifly_root.tgz
sftp>
-----------------------------------------------

The file ifly.root.tgz is really 467990 bytes and Jul 24 09:50, and ifly_root.tgz is 334258 bytes and Jun 10 21:59.
It`s correct.
But when used "ls -l *tgz" sizes and dates not corresponds to filenames, and when "ls -l *" filenames and file attributes may be mixed in random order: directory "/tmp" marked as file "-rw-r--r-", file "index.html" marked as directory, etc.
With other remote servers too.

When connecting to this and other remote servers from FreeBSD (openssh 5.4) all works fine.

Changed in openssh (Ubuntu):
importance: Undecided → High
Revision history for this message
Clint Byrum (clint-fewbar) wrote :

I was able to reproduce this with Precise's SSH, but not quantal's.

clint@clint-MacBookAir:~$ sftp <email address hidden>
Connected to ec2-54-245-13-189.us-west-2.compute.amazonaws.com.
sftp> ls -l *txt
-rw-rw-r-- 0 1000 1000 3764 Aug 4 17:29 tc.a.txt
-rw-rw-r-- 0 1000 1000 5544 Aug 4 17:29 tc_a.txt
sftp> ls -l tc.a.txt
-rw-rw-r-- 0 1000 1000 5544 Aug 4 17:29 tc.a.txt
sftp> ls -l tc_a.txt
-rw-rw-r-- 0 1000 1000 3764 Aug 4 17:29 tc_a.txt
sftp>

on quantal:

sftp> ls -l *txt
-rw-rw-r-- 0 1000 1000 3764 Aug 4 17:29 tc_a.txt
-rw-rw-r-- 0 1000 1000 5544 Aug 4 17:29 tc.a.txt
sftp> ls -l tc_a.txt
-rw-rw-r-- 0 1000 1000 3764 Aug 4 17:29 tc_a.txt
sftp> ls -l tc.a.txt
-rw-rw-r-- 0 1000 1000 5544 Aug 4 17:29 tc.a.txt
sftp>

So, marking Fix Released but opening a task against precise to do an SRU. I'm sure the patch can be found between ssh 5.9 and ssh 6.0

Changed in openssh (Ubuntu):
status: New → Fix Released
Changed in openssh (Ubuntu Precise):
status: New → Triaged
importance: Undecided → High
Revision history for this message
Steve Langasek (vorlon) wrote :

The Precise Pangolin has reached end of life, so this bug will not be fixed for that release

Changed in openssh (Ubuntu Precise):
status: Triaged → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.