[nautilus/wip/oholy/umask-templates: 88/88] file-operations: Honor umask when creating new files



commit ee035fe0b4257d335687c038bf8b41a64d452d7f
Author: Ondrej Holy <oholy redhat com>
Date:   Mon Nov 18 11:34:10 2019 +0100

    file-operations: Honor umask when creating new files
    
    File creation mask should be honored when creating new files from
    templates as it is when creating new folders, or dragging raw data. But
    it is not because G_FILE_COPY_NONE flag is specified when creating new
    files from templates. Let's use G_FILE_COPY_TARGET_DEFAULT_PERMS flag
    to ensure that file creation mask is honored in this case as well.
    
    Just note that this behavior is not wanted when copying in general
    (although it is also honored by "cp" cmd in this case) as it might have
    some unexpected consequences as discussed on:
    https://bugzilla.gnome.org/show_bug.cgi?id=167102

 src/nautilus-file-operations.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/src/nautilus-file-operations.c b/src/nautilus-file-operations.c
index acf65f3cf..a90706e2e 100644
--- a/src/nautilus-file-operations.c
+++ b/src/nautilus-file-operations.c
@@ -7361,7 +7361,7 @@ retry:
         {
             res = g_file_copy (job->src,
                                dest,
-                               G_FILE_COPY_NONE,
+                               G_FILE_COPY_TARGET_DEFAULT_PERMS,
                                common->cancellable,
                                NULL, NULL,
                                &error);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]