Bug 5418 - Unexpected results when reading past the end of a directory's entries
Summary: Unexpected results when reading past the end of a directory's entries
Status: NEW
Alias: None
Product: ThinLinc
Classification: Unclassified
Component: Local drive redirection (show other bugs)
Version: trunk
Hardware: PC Unknown
: P2 Normal
Target Milestone: MediumPrio
Assignee: Peter Åstrand
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-03 14:02 CET by Peter Åstrand
Modified: 2015-02-10 10:52 CET (History)
1 user (show)

See Also:
Acceptance Criteria:


Attachments

Description Peter Åstrand cendio 2015-02-03 14:02:41 CET
This is a placeholder for the upstream bug report:

http://sourceforge.net/p/unfs3/bugs/6/

"If a client interleaves readdir() and remove() calls on a mounted NFS share, upon reaching past the end of the directory entries readdir() returns the first directory entry over again, instead of NULL or whatever the signal is supposed to be. This can cause certain programs (in my case, transmission-daemon when removing&trashing a downloaded torrent) to go into an infinite-loop.

More information here (especially comments 3 and laters): https://trac.transmissionbt.com/ticket/5890

I've fixed it in my build by commenting out the following section of readdir.c:

/* ignore cookie if unexpected so we restart from the beginning */
cookie = 0;

However, I don't know if that's an appropriate fix or if there are better ways to fix this problem (because I don't know much C, and even less about the NFS protocol). Just thought you should know about this issue. And also I would like to take this opportunity to thank you for making this awesome and extremely useful program."

Note You need to log in before you can comment on or make changes to this bug.