From: Christian Grothoff Date: Sat, 18 Feb 2012 21:37:48 +0000 (+0000) Subject: -do not try to desearialize search directories X-Git-Tag: initial-import-from-subversion-38251~14810 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=01c0d4c4f48eb02440c357f0e989d8dd8acb7a58;p=oweals%2Fgnunet.git -do not try to desearialize search directories --- diff --git a/src/fs/fs_api.c b/src/fs/fs_api.c index cae2c693d..b930f35bd 100644 --- a/src/fs/fs_api.c +++ b/src/fs/fs_api.c @@ -2641,7 +2641,15 @@ deserialize_search_file (void *cls, const char *filename) char *emsg; struct GNUNET_BIO_ReadHandle *rh; struct GNUNET_FS_SearchContext *sc; + struct stat buf; + if (0 != STAT (filename, &buf)) + { + GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, "stat", filename); + return GNUNET_OK; + } + if (S_ISDIR (buf.st_mode)) + return GNUNET_OK; /* skip directories */ ser = get_serialization_short_name (filename); rh = GNUNET_BIO_read_open (filename); if (rh == NULL)