Hello openssh developers-- The SFTP client has a bug that appears to have been in since openssh-3.5p1 and onwards, when "ls" flags were introduced. The symptom is that "ls -1" does not sort the directory entries. The problem is that the call to qsort() is supplies a value of zero for the number of elements in the array. I've attached a patch that works for me (and should work for everyone). Please include me in any replies (that you want me to see); I'm not subscribed to this list. Thanks, --Rob -------------- next part -------------- --- openssh-4.1p1/sftp.c Mon Mar 14 07:08:12 2005 +++ openssh-4.1p1-1/sftp.c Wed Jun 1 12:50:47 2005 @@ -696,6 +696,7 @@ } if (lflag & SORT_FLAGS) { + for (n = 0; d[n] != NULL; n++); sort_flag = lflag & (SORT_FLAGS|LS_REVERSE_SORT); qsort(d, n, sizeof(*d), sdirent_comp); } -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: Digital signature Url : http://lists.mindrot.org/pipermail/openssh-unix-dev/attachments/20050601/98364e3d/attachment.bin