freebsd-dev/usr.bin/sort
Conrad Meyer 7a590a370a sort(1): Simplify and bound random seeding
Bound input file processing length to avoid the issue reported in [1].  For
simplicity, only allow regular file and character device inputs.  For
character devices, only allow /dev/random (and /dev/urandom symblink).

32 bytes of random is perfectly sufficient to seed MD5; we don't need any
more.  Users that want to use large files as seeds are encouraged to truncate
those files down to an appropriate input file via tools like sha256(1).

(This does not change the sort algorithm of sort -R.)

[1]: https://lists.freebsd.org/pipermail/freebsd-hackers/2018-August/053152.html

PR:		230792
Reported by:	Ali Abdallah <aliovx AT gmail.com>
Relnotes:	yes
2019-04-11 05:08:49 +00:00
..
nls
tests sort(1): Add bits to allow easy checking against NetBSD tests 2018-06-20 03:10:49 +00:00
bwstring.c various: general adoption of SPDX licensing ID tags. 2017-11-27 15:37:16 +00:00
bwstring.h various: general adoption of SPDX licensing ID tags. 2017-11-27 15:37:16 +00:00
coll.c sort(1): randomcoll: Skip the memory allocation entirely 2019-04-04 23:32:27 +00:00
coll.h various: general adoption of SPDX licensing ID tags. 2017-11-27 15:37:16 +00:00
file.c sort(1): Fix -m when only implicit stdin is used for input 2018-06-20 03:31:19 +00:00
file.h sort(1): Fix -m when only implicit stdin is used for input 2018-06-20 03:31:19 +00:00
Makefile Don't use absolute path to sed when building usr.bin/join 2018-08-23 18:18:43 +00:00
Makefile.depend DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
mem.c various: general adoption of SPDX licensing ID tags. 2017-11-27 15:37:16 +00:00
mem.h various: general adoption of SPDX licensing ID tags. 2017-11-27 15:37:16 +00:00
radixsort.c Fix the WITH_SORT_THREADS build. 2018-02-07 20:36:37 +00:00
radixsort.h various: general adoption of SPDX licensing ID tags. 2017-11-27 15:37:16 +00:00
sort.1.in
sort.c sort(1): Simplify and bound random seeding 2019-04-11 05:08:49 +00:00
sort.h various: general adoption of SPDX licensing ID tags. 2017-11-27 15:37:16 +00:00
vsort.c various: general adoption of SPDX licensing ID tags. 2017-11-27 15:37:16 +00:00
vsort.h various: general adoption of SPDX licensing ID tags. 2017-11-27 15:37:16 +00:00