]> git.ipfire.org Git - thirdparty/tar.git/commitdiff
Report race on systems without O_DIRECTORY
authorPavel Raiskup <praiskup@redhat.com>
Tue, 31 Jul 2018 09:13:48 +0000 (12:13 +0300)
committerSergey Poznyakoff <gray@gnu.org>
Tue, 31 Jul 2018 09:13:48 +0000 (12:13 +0300)
* src/names.c (collect_and_sort_names): Report ENOTDIR after
successful fstat() but !S_ISDIR.

src/names.c

index f6ad9fe0a64254789dfd9092f17db7b7da45c6f0..f4dc978ce4710bf2eb8e60464c38193815bb293b 100644 (file)
@@ -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);
+               }
            }
        }