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



commit d53695c2fa4ec7e7661ff0e89aedc57208e8d579
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 e288a9afe..5bc235b89 100644
--- a/src/nautilus-file-operations.c
+++ b/src/nautilus-file-operations.c
@@ -7289,7 +7289,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]