diff options
author | smitsohu <smitsohu@gmail.com> | 2019-09-17 14:47:39 +0200 |
---|---|---|
committer | smitsohu <smitsohu@gmail.com> | 2019-09-17 14:47:39 +0200 |
commit | 20360ed200b894e3464bca11dfe0ebac60b4d4f2 (patch) | |
tree | 9f4b2877e678ffbd4300ae55da4b3587ca0e9979 | |
parent | fail gracefully if argc is zero (diff) | |
download | firejail-20360ed200b894e3464bca11dfe0ebac60b4d4f2.tar.gz firejail-20360ed200b894e3464bca11dfe0ebac60b4d4f2.tar.zst firejail-20360ed200b894e3464bca11dfe0ebac60b4d4f2.zip |
fix the fix: tune file copy limit width
-rw-r--r-- | src/fcopy/main.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/fcopy/main.c b/src/fcopy/main.c index a08cc66b3..00cbe8d12 100644 --- a/src/fcopy/main.c +++ b/src/fcopy/main.c | |||
@@ -28,8 +28,8 @@ int arg_quiet = 0; | |||
28 | int arg_debug = 0; | 28 | int arg_debug = 0; |
29 | static int arg_follow_link = 0; | 29 | static int arg_follow_link = 0; |
30 | 30 | ||
31 | static unsigned long long copy_limit = 500 * 1024 * 1024; // 500 MB | 31 | static unsigned long copy_limit = 500 * 1024 * 1024; // 500 MB |
32 | static unsigned long long size_cnt = 0; | 32 | static unsigned long size_cnt = 0; |
33 | static int size_limit_reached = 0; | 33 | static int size_limit_reached = 0; |
34 | static unsigned file_cnt = 0; | 34 | static unsigned file_cnt = 0; |
35 | 35 | ||
@@ -186,7 +186,7 @@ static int fs_copydir(const char *infname, const struct stat *st, int ftype, str | |||
186 | 186 | ||
187 | // recalculate size | 187 | // recalculate size |
188 | if ((s.st_size + size_cnt) > copy_limit) { | 188 | if ((s.st_size + size_cnt) > copy_limit) { |
189 | fprintf(stderr, "Error fcopy: size limit of %lluMB reached\n", (copy_limit / 1024) / 1024); | 189 | fprintf(stderr, "Error fcopy: size limit of %lu MB reached\n", (copy_limit / 1024) / 1024); |
190 | size_limit_reached = 1; | 190 | size_limit_reached = 1; |
191 | free(outfname); | 191 | free(outfname); |
192 | return 0; | 192 | return 0; |
@@ -393,7 +393,7 @@ int main(int argc, char **argv) { | |||
393 | if (cl) { | 393 | if (cl) { |
394 | copy_limit = strtoul(cl, NULL, 10) * 1024 * 1024; | 394 | copy_limit = strtoul(cl, NULL, 10) * 1024 * 1024; |
395 | if (arg_debug) | 395 | if (arg_debug) |
396 | printf("file copy limit %llu bytes\n", copy_limit); | 396 | printf("file copy limit %lu bytes\n", copy_limit); |
397 | } | 397 | } |
398 | 398 | ||
399 | // copy files | 399 | // copy files |