From e0afbfb5862a820311f4e4e0ad100c4735d69630 Mon Sep 17 00:00:00 2001 From: Alexander Gerasiov Date: Sun, 13 Aug 2023 17:02:38 +0300 Subject: fcopy: Use lstat when copy directory. When copying directories use lstat when reading info about source files. --- src/fcopy/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/fcopy/main.c b/src/fcopy/main.c index a56e8a91b..84fe44d73 100644 --- a/src/fcopy/main.c +++ b/src/fcopy/main.c @@ -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) @@ -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; -- cgit v1.2.3-70-g09d2