Project

General

Profile

Bug #1826

mod_webdav readdir POSIX compatibility issue

Added by Joakim over 8 years ago. Updated 12 months ago.

Status:
Fixed
Priority:
Normal
Assignee:
-
Category:
mod_webdav
Target version:
Start date:
2008-11-20
Due date:
% Done:

0%

Missing in 1.5.x:

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

mod_webdav_POSIX_readdir.patch View (1.65 KB) Joakim, 2008-11-20 16:07

mod_webdav_POSIX_readdir-upd.patch View (1.96 KB) gstrauss, 2016-03-30 15:22

Associated revisions

Revision f4cb07f7 (diff)
Added by gstrauss 12 months ago

[mod_webdav] readdir POSIX compat (fixes #1826)

do not expect '.' to be part of dir listing

x-ref:
"mod_webdav readdir POSIX compatibility issue"
https://redmine.lighttpd.net/issues/1826

History

#1 Updated by gstrauss 12 months 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

#2 Updated by gstrauss 12 months ago

edited patch as I had suggested above

#3 Updated by gstrauss 12 months ago

  • Status changed from Patch Pending to Fixed

committed in f4cb07f7

Also available in: Atom