Skip to content

Commit

Permalink
Merge pull request #5957 from gerasiov/fcopy-fix-size-calculation
Browse files Browse the repository at this point in the history
fcopy: Use lstat when copy directory.
  • Loading branch information
netblue30 authored Nov 24, 2023
2 parents 46c8e93 + e0afbfb commit a9867d5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/fcopy/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ static int fs_copydir(const char *infname, const struct stat *st, int ftype, str

// don't copy it if we already have the file
struct stat s;
if (stat(outfname, &s) == 0) {
if (lstat(outfname, &s) == 0) {
if (first)
first = 0;
else if (!arg_quiet)
Expand All @@ -286,7 +286,7 @@ static int fs_copydir(const char *infname, const struct stat *st, int ftype, str
}

// extract mode and ownership
if (stat(infname, &s) != 0)
if (lstat(infname, &s) != 0)
goto out;

uid_t uid = s.st_uid;
Expand Down

0 comments on commit a9867d5

Please sign in to comment.