Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
tracker-miner-fs: Fall back if no modification date is found
There are paths in GIO (mainly EACCES errors during stat) that we
may get returned no error, but a GFileInfo that does not contain
all the requested information. Cases that may trigger this are:
- Odd permission patterns. I was able to reproduce with a
directory from another user with 744 permissions, stat would
then cause EACCES with the directory contents.
- Other kernel reasons to deny access (SELinux, AppArmor, etc).
This used not to be a problem, as only modification/access times
missing used to be relevant to us, and we dealt with them as int64_t
so we silently dealt with the returned 0, thus we set those times
as being the "epoch". Now we try to get a GDateTime, and get a NULL
pointer instead, causing crashes in its manipulation.
As we need files to have a modification time for our comparisons
during crawling, make these files have again a fictional date set
in the epoch to avoid the crash and make the machinery work with
these files.- Loading branch information