Skip to content

tracker-miner-fs: Fall back if no modification date is found

Carlos Garnacho requested to merge wip/carlosg/modified-time-fallback into master

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.

Merge request reports