tar/Report-race-on-systems-without-O_DIRECTORY.patch

31 lines
706 B
Diff
Raw Normal View History

2019-09-30 11:18:06 -04:00
From c1b569d9d61f129d2eefd1e87e6ea6cd96810788 Mon Sep 17 00:00:00 2001
From: Pavel Raiskup <praiskup@redhat.com>
Date: Tue, 31 Jul 2018 12:13:48 +0300
Subject: [PATCH 21/58] Report race on systems without O_DIRECTORY
* src/names.c (collect_and_sort_names): Report ENOTDIR after
successful fstat() but !S_ISDIR.
---
src/names.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/names.c b/src/names.c
index f6ad9fe..f4dc978 100644
--- a/src/names.c
+++ b/src/names.c
@@ -1767,6 +1767,11 @@ collect_and_sort_names (void)
name->found_count++;
add_hierarchy_to_namelist (&st, name);
}
+ else
+ {
+ errno = ENOTDIR;
+ open_diag (name->name);
+ }
}
}
--
2.19.1