if you are interested in readdir(3), seekdir(3) and telldir(3) then you should look at

this patches around a problem in seekdir() that breaks Samba.
Seekdir(3) will not work as expected when files prior to the point of interest in directory have been deleted since the directory was opened.

Windows clients using Samba cause both these things to happen, causing the next readdir(3) after the bad seekdir(3) to skip some entries and return the wrong file.

Samba only needs to step back a single directory entry in the case where it reads an entry and then discovers it can't fit it into the buffer it is sending to the windows client. It turns out we can reliably cater to Samba's requirement because the "last returned element" is always still in memory, so with a little care, we can
set our filepointer back to it safely. (once)

seekdir and readdir (and telldir()) need a complete rewrite along with getdirentries() but that is more than a small edit like this.

freebsd-current@freebsd.org mailing list
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"

Reply via email to