Skip to content

Commit a2bcbc7

Browse files
committed
check file format in dir_list_file
1 parent dc50ba7 commit a2bcbc7

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

dir.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,13 @@ dir_list_file_internal(parray *files, const char *root, bool exclude,
354354
/* skip if the file is in black_list defined by user */
355355
if (black_list && parray_bsearch(black_list, root, BlackListCompare))
356356
{
357-
/* found in black_list. skip this item */
357+
elog(LOG, "Skip file \"%s\": file is in the user's black list", file->path);
358+
return;
359+
}
360+
361+
if (!S_ISDIR(file->mode) && !S_ISLNK(file->mode) && !S_ISREG(file->mode))
362+
{
363+
elog(WARNING, "Skip file \"%s\": Unexpected file format", file->path);
358364
return;
359365
}
360366

0 commit comments

Comments
 (0)