Skip to content

Commit

Permalink
Merge pull request #54 from dscho/fix-tar-xf-with-symlinks
Browse files Browse the repository at this point in the history
Fix `tar xf` with symlinks
  • Loading branch information
dscho authored Jul 5, 2023
2 parents b8ff8df + aa056f2 commit ea78182
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions winsup/cygwin/syscalls.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4580,7 +4580,7 @@ fchownat (int dirfd, const char *pathname, uid_t uid, gid_t gid, int flags)
int res = gen_full_path_at (path, dirfd, pathname);
if (res)
{
if (!(errno == ENOENT && (flags & AT_EMPTY_PATH)))
if (!((errno == ENOENT || errno == ENOTDIR) && (flags & AT_EMPTY_PATH)))
__leave;
/* pathname is an empty string. Operate on dirfd. */
if (dirfd == AT_FDCWD)
Expand Down Expand Up @@ -4625,7 +4625,7 @@ fstatat (int dirfd, const char *__restrict pathname, struct stat *__restrict st,
int res = gen_full_path_at (path, dirfd, pathname);
if (res)
{
if (!(errno == ENOENT && (flags & AT_EMPTY_PATH)))
if (!((errno == ENOENT || errno == ENOTDIR) && (flags & AT_EMPTY_PATH)))
__leave;
/* pathname is an empty string. Operate on dirfd. */
if (dirfd == AT_FDCWD)
Expand Down

0 comments on commit ea78182

Please sign in to comment.