Finally, I see the one true way ;-)
Do this for each "name":

    - open each file/dir. with fd = openat (fts_cwd_fd, name, ...
    - if that succeeds, then call fstatfs (fd, ...

Using the combination of openat and fstatfs is required in order to
avoid using the full relative name of each object that chmod processes.

The above works for all readable objects.
For unreadable ones, revert to using the statfs with the full relative name.


Reply via email to