Project

General

Profile

Actions

Bug #1826

closed

mod_webdav readdir POSIX compatibility issue

Added by Joakim over 15 years ago. Updated over 8 years ago.

Status:
Fixed
Priority:
Normal
Category:
mod_webdav
Target version:
ASK QUESTIONS IN Forums:

Description

We noticed during porting that mod _webdav gave an invalid response on PROPFIND request at depth one where the dav:response entry containing the properties for the target resource was missing.

Looking at the code, mod_webdav assumes that while iterating over the entries in the target collection using readdir(), there should be a dot entry to get properties for the target resource. If the usage of readdir should be POSIX compatible I belive this assumption is a bit to strict. According to IEEE Std 1003.1 2004.

"If entries for dot or dot-dot exist, one entry shall be returned for dot and one entry shall be returned for dot-dot; otherwise, they shall not be returned."

http://www.opengroup.org/onlinepubs/009695399/functions/readdir.html

This has also been noted for the GNU C library.

"Portability Note: On some systems readdir may not return entries for . and .., even though these are always valid file names in any directory. See File Name Resolution."

http://www.gnu.org/software/libc/manual/html_mono/libc.html#Reading_002fClosing-Directory

To remain compatible it would be nice to have this assumption removed


Files

Actions #1

Updated by gstrauss over 8 years ago

  • Status changed from New to Patch Pending

At first glance, patch looks reasonable, though deleted lines in patch should just be deleted instead of being replaced with blank lines

Actions #2

Updated by gstrauss over 8 years ago

edited patch as I had suggested above

Actions #3

Updated by gstrauss over 8 years ago

  • Status changed from Patch Pending to Fixed

committed in f4cb07f7

Actions

Also available in: Atom