[Bug 581] SFTP "ls" listings never end

bugzilla-daemon at mindrot.org bugzilla-daemon at mindrot.org
Wed Jun 4 17:31:28 EST 2003


http://bugzilla.mindrot.org/show_bug.cgi?id=581





------- Additional Comments From from-bugzilla at geek-central.gen.nz  2003-06-04 17:31 -------
Which way is Tru64's kernel "broken":

1) It doesn't do it the way Linux does (true enough), or
2) It doesn't conform to the official spec (not so clear).

Darren Tucker has previously referenced the spec at <http://
www.opengroup.org/onlinepubs/007904975/functions/readdir.html>. The 
relevant paragraph is the following:

The readdir() function shall return a pointer to a structure representing the 
directory entry at the current position in the directory stream specified by 
the argument dirp, and position the directory stream at the next entry. It 
shall return a null pointer upon reaching the end of the directory stream. 
The structure dirent defined in the <dirent.h> header describes a directory 
entry.

Now, what does this spec say about what happens when you call readdir 
again _after_ it has returned a null pointer? It's not clear at all. There 
doesn't seem to be any prerequisite attached to the post-condition " ...and 
position the directory stream at the next entry". So what is the "next" entry 
after the end of the directory stream? The Tru64 interpretation (start over 
from the beginning) seems as reasonable as anything else.

Remember the robustness principle <ftp://ftp.isi.edu/in-notes/rfc791.txt>: 
"be liberal in what you accept, conservative in what you send."




------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.




More information about the openssh-bugs mailing list