From a58aee00cbdfeb89fe325434aa8652bfc3654dec Mon Sep 17 00:00:00 2001 From: Slava Zanko Date: Thu, 22 Mar 2012 18:56:03 +0300 Subject: [PATCH 1/2] Ticket #2278: Problem in the Copy operation Previously, copying a file does not change access permissions of the destination file if the check box "Preserve attributes" in the Copy window is not set. For some time it is not so: if you uncheck the "Preserve attributes" then access permissions of the destination file are set in accordance with the value of umask, which can lead to information disclosure(i.e. security problem). Signed-off-by: Slava Zanko --- src/filemanager/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/filemanager/file.c b/src/filemanager/file.c index 8663268ef..74c96f51b 100644 --- a/src/filemanager/file.c +++ b/src/filemanager/file.c @@ -1867,7 +1867,7 @@ copy_file_file (FileOpTotalContext * tctx, FileOpContext * ctx, break; } } - else + else if (!dst_exists) { src_mode = umask (-1); umask (src_mode); From f0f39cb2a77683658a3b7c5a29a300dd79fae31e Mon Sep 17 00:00:00 2001 From: Ilia Maslakov Date: Mon, 26 Mar 2012 10:12:24 +0400 Subject: [PATCH 2/2] code indentation Signed-off-by: Ilia Maslakov --- src/filemanager/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/filemanager/file.c b/src/filemanager/file.c index 74c96f51b..42cf3199d 100644 --- a/src/filemanager/file.c +++ b/src/filemanager/file.c @@ -330,7 +330,7 @@ check_hardlinks (const vfs_path_t * src_vpath, const vfs_path_t * dst_vpath, str lnk->dev = dev; lnk->src_vpath = vfs_path_clone (src_vpath); lnk->dst_vpath = vfs_path_clone (dst_vpath); - linklist = g_slist_prepend (linklist, lnk); + linklist = g_slist_prepend (linklist, lnk); } return FALSE;