Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

modif: fcopy: use lstat when copying directory #5957

Merged
merged 1 commit into from
Nov 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
gerasiov marked this conversation as resolved.
Show resolved Hide resolved
goto out;

uid_t uid = s.st_uid;
Expand Down