lib: Make fd_load work for non-regular files

Enterprise / Samba - Volker Lendecke [samba.org] - 26 March 2019 04:43 EDT

Follow-up to

https://lists.samba.org/archive/samba/2018-September/217992.html

and following. This also fixes a small and very theoretical race: Between the fstat and the read call the file size might change. This would make us fail on potentially legitimate files.

This is more complex and probably slower, but looking at the use cases I don't think the speed matters.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13859

ac487bf4d04 lib: Make fd_load work for non-regular files
lib/util/util_file.c | 63 +++++++++++++++++++++++++++++++++++++++-------------
1 file changed, 48 insertions(+), 15 deletions(-)

Upstream: gitweb.samba.org


  • Share