This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix readdir_r with long file names


On 05/16/2013 02:50 PM, Siddhesh Poyarekar wrote:
I did not suggest modifying the general error handling mechanism.
It's only in the case of the name buffer overflow that we ought to set
offsets to skip the entry and move ahead.  That won't result in an
infinite loop.  The recommendation in the manual for this would be
that if you encounter $THE_ERRNO_WE_FINALLY_AGREE_ON, it is safe to
proceed to the next entry since that errno only means that the current
entry name was too long; there was no system error that should
necessitate aborting the directory traversal.

This will break existing applications which currently treat the garbled d_name as a concurrently deleted directory entry and move on. If we change the behavior as you suggest, the directory list will be truncated at the first long name until the application is updated.

--
Florian Weimer / Red Hat Product Security Team


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]