Re: [Tracker] Tracker to do list



Le vendredi 08 septembre 2006 Ã 10:35 +0100, Jamie McCracken a Ãcrit :
Laurent Aguerreche wrote:
Le jeudi 07 septembre 2006 Ã 22:22 +0200, Laurent Aguerreche a Ãcrit :
There is another bug now: tracker_db_save_file_contents() is called with
directory as file_name... So, of course, fgets() blocks on it.
It seems I've found the reason: text_filter_file was sometimes wrongly
set to a non-NULL value (because no initialisation happened) in
tracker_metadata_get_text_file().

I provide a patch.

I am sorry. This patch doesn't correct the bug, but it still needs to be
applied. I continue to investigate.


All files that cause problems are links to directories...

In tracker-utils.c, in tracker_get_files(), tracker_is_directory() is
called to know whether a file is a directory or not.

Let see tracker_is_directory():

        if (dir_in_locale) {
                struct stat finfo;

                g_lstat (dir_in_locale, &finfo);

                g_free (dir_in_locale);

                return S_ISDIR (finfo.st_mode);
        }

g_lstat() is just a wrapper for lstat(). This system call works on the
link itself and not on the pointed file. So S_ISDIR() pretends that the
link is not a directory. Furthermore Tracker will mark this link as a
regular file and I think that trackerd will try to open it with fgets()
which will make it to block.

IMHO, we should use g_stat() here to know properties of the pointed
file.

What do you think about that?

okay please combine your bug fixes with existing patch. I will wait for 
it. :)

Thank you.



Laurent.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]