aboutsummaryrefslogtreecommitdiffstats
path: root/src/fcopy/main.c
diff options
context:
space:
mode:
authorLibravatar Alexander Gerasiov <a@gerasiov.net>2023-08-13 17:02:38 +0300
committerLibravatar Alexander Gerasiov <a@gerasiov.net>2023-08-14 11:37:32 +0300
commite0afbfb5862a820311f4e4e0ad100c4735d69630 (patch)
treee0f33bb51e2f45f101f5627ca66b6403599745e5 /src/fcopy/main.c
parentbuild: fix wrong man page paths (diff)
downloadfirejail-e0afbfb5862a820311f4e4e0ad100c4735d69630.tar.gz
firejail-e0afbfb5862a820311f4e4e0ad100c4735d69630.tar.zst
firejail-e0afbfb5862a820311f4e4e0ad100c4735d69630.zip
fcopy: Use lstat when copy directory.
When copying directories use lstat when reading info about source files.
Diffstat (limited to 'src/fcopy/main.c')
-rw-r--r--src/fcopy/main.c4
1 files 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
277 277
278 // don't copy it if we already have the file 278 // don't copy it if we already have the file
279 struct stat s; 279 struct stat s;
280 if (stat(outfname, &s) == 0) { 280 if (lstat(outfname, &s) == 0) {
281 if (first) 281 if (first)
282 first = 0; 282 first = 0;
283 else if (!arg_quiet) 283 else if (!arg_quiet)
@@ -286,7 +286,7 @@ static int fs_copydir(const char *infname, const struct stat *st, int ftype, str
286 } 286 }
287 287
288 // extract mode and ownership 288 // extract mode and ownership
289 if (stat(infname, &s) != 0) 289 if (lstat(infname, &s) != 0)
290 goto out; 290 goto out;
291 291
292 uid_t uid = s.st_uid; 292 uid_t uid = s.st_uid;