GNOME Bugzilla – Bug 672219
GFileEnumerator return wrong file type for symlinked directories on NTFS volumes
Last modified: 2018-05-24 13:51:07 UTC
After commit 8863071b9d17fa37036549b8c6579736d259a9cd GFileEnumerator uses readdir() calls (when available, e.g. under linux), to obtain file type info. This does not always work for files on NTFS volumes. Namely, a symlink to a directory is reported as a normal directory, even with G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS flag.
Created attachment 209913 [details] [review] localfileenumerator: don't trust readdir() when reports DT_DIR -- In case it is decided that this is not a NOTGNOME, a possible workaround is not trusting the readdir() result "DT_DIR"
Created attachment 209918 [details] [review] workaround If it is decided that this is not a NOTGNOME, a possible workaround is not trusting the readdir() result "DT_DIR"
Isn't that a bug in the NTFS implementation of your kernel of choice rather than a bug in gio?
I just did some more research and it indeed is a bug in ntfs-3g. I filed this bug upstream along with a simple testcase and they have already created a fix for it. When applied this issue is resolved automatically by it. Upstream bugreport with patch: http://tuxera.com/forum/viewtopic.php?f=2&t=29578
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/glib/issues/524.