openssh-4.1p1 SFTP client directory listing sorting bug

This is a discussion on openssh-4.1p1 SFTP client directory listing sorting bug within the OpenSSH Development forums, part of the Networking and Network Related category; --===============1526697499== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="K8nIJk4ghYZn606h" Content-Disposition: ...


Go Back   Usenet Forums > Networking and Network Related > OpenSSH Development

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 06-01-2005
Robert Tsai
 
Posts: n/a
Default openssh-4.1p1 SFTP client directory listing sorting bug


--===============1526697499==
Content-Type: multipart/signed; micalg=pgp-sha1;
protocol="application/pgp-signature"; boundary="K8nIJk4ghYZn606h"
Content-Disposition: inline


--K8nIJk4ghYZn606h
Content-Type: multipart/mixed; boundary="17pEHd4RhPHOinZp"
Content-Disposition: inline


--17pEHd4RhPHOinZp
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

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

--17pEHd4RhPHOinZp
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="sftp-openssh-4.1p1.diff"
Content-Transfer-Encoding: quoted-printable

--- 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 @@
}
=20
if (lflag & SORT_FLAGS) {
+ for (n =3D 0; d[n] !=3D NULL; n++);
sort_flag =3D lflag & (SORT_FLAGS|LS_REVERSE_SORT);
qsort(d, n, sizeof(*d), sdirent_comp);
}

--17pEHd4RhPHOinZp--

--K8nIJk4ghYZn606h
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFCne2r18A6pRrdKfkRAn44AJsHgyw8KxAwQGXD4GypxN YI0mh0AACfYACb
YMfTVqa9F+fIjpvfgVclW98=
=YBoT
-----END PGP SIGNATURE-----

--K8nIJk4ghYZn606h--


--===============1526697499==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev@mindrot.org
http://www.mindrot.org/mailman/listi...enssh-unix-dev

--===============1526697499==--

Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 07:08 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0