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: ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
--===============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==-- |