From 51ff7dc13c9623b46d14b48350fd96a9cc04ce98 Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Sun, 29 Sep 2024 12:24:24 +0300 Subject: [PATCH] (copy_file_file): handling "Abort" button on chown/chmod/chattr error. The "Abort" buton must interrupt the copy/move of a directory mot a file only. Signed-off-by: Andrew Borodin --- src/filemanager/file.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/filemanager/file.c b/src/filemanager/file.c index 88b378221..dcc62158e 100644 --- a/src/filemanager/file.c +++ b/src/filemanager/file.c @@ -2833,6 +2833,11 @@ copy_file_file (file_op_total_context_t *tctx, file_op_context_t *ctx, && !ctx->skip_all) { temp_status = file_error (TRUE, _("Cannot chown target file \"%s\"\n%s"), dst_path); + if (temp_status == FILE_ABORT) + { + return_status = FILE_ABORT; + goto ret_fast; + } if (temp_status == FILE_RETRY) continue; if (temp_status == FILE_SKIPALL) @@ -2849,6 +2854,11 @@ copy_file_file (file_op_total_context_t *tctx, file_op_context_t *ctx, && !ctx->skip_all) { temp_status = file_error (TRUE, _("Cannot chmod target file \"%s\"\n%s"), dst_path); + if (temp_status == FILE_ABORT) + { + return_status = FILE_ABORT; + goto ret_fast; + } if (temp_status == FILE_RETRY) continue; if (temp_status == FILE_SKIPALL) @@ -2888,6 +2898,8 @@ copy_file_file (file_op_total_context_t *tctx, file_op_context_t *ctx, temp_status = file_error (TRUE, _("Cannot set attributes for target file \"%s\"\n%s"), dst_path); + if (temp_status == FILE_ABORT) + return_status = FILE_ABORT; if (temp_status == FILE_RETRY) { attrs_ok = TRUE;