Bug 14082

Summary: readdir() can't always determine file type
Product: PolicyKit Reporter: Martin Pitt <martin.pitt>
Component: libpolkitAssignee: David Zeuthen (not reading bugmail) <zeuthen>
Status: RESOLVED FIXED QA Contact: David Zeuthen (not reading bugmail) <zeuthen>
Severity: normal    
Priority: medium CC: colin
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: fall back to stat() if readdir() can't detect type

Description Martin Pitt 2008-01-15 08:04:39 UTC
Created attachment 13726 [details] [review]
fall back to stat() if readdir() can't detect type

PK 0.7 does not work at all on my box. After some debugging I found out that readdir()'s result (d->d_type) is DT_UNKNOWN, i. e. it cannot determine the type of an entry.

I use various file systems for testing (reiserfs, xfs, ext3 ATM).

Attached patch fixes the issue by falling back to stat() on DT_UNKNOWN, so it's not a performance penalty on ext3.
Comment 1 David Zeuthen (not reading bugmail) 2008-02-26 13:08:07 UTC
I committed another patch for this

http://gitweb.freedesktop.org/?p=PolicyKit.git;a=commitdiff;h=0b59d3e7d4b282da308b362dc440b007b9ecedbf
Comment 2 David Zeuthen (not reading bugmail) 2008-02-26 13:13:10 UTC
*** Bug 13599 has been marked as a duplicate of this bug. ***

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.