[Xfce4-commits] [xfce/thunar] 01/01: Correctly check if destination is writable (Bug #14718)

noreply at xfce.org noreply at xfce.org
Sat Apr 6 04:20:29 CEST 2019


This is an automated email from the git hooks/post-receive script.

a   n   d   r   e       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       x   f   c   e   -   4   .   1   2   
   in repository xfce/thunar.

commit d137b6f924476ec7fabbd4c4dcc8da9134984ce2
Author: Andre Miranda <andreldm at xfce.org>
Date:   Fri Apr 5 23:16:52 2019 -0300

    Correctly check if destination is writable (Bug #14718)
---
 thunar/thunar-transfer-job.c | 23 +++++++++++++++++------
 1 file changed, 17 insertions(+), 6 deletions(-)

diff --git a/thunar/thunar-transfer-job.c b/thunar/thunar-transfer-job.c
index 91df479..71d0d81 100644
--- a/thunar/thunar-transfer-job.c
+++ b/thunar/thunar-transfer-job.c
@@ -827,14 +827,25 @@ thunar_transfer_job_verify_destination (ThunarTransferJob  *transfer_job,
         }
     }
 
-  if (succeed && g_file_info_get_attribute_boolean (filesystem_info, G_FILE_ATTRIBUTE_FILESYSTEM_READONLY))
+  if (succeed)
     {
-      g_set_error (error, G_IO_ERROR, G_IO_ERROR_READ_ONLY,
-                   _("Error while copying to \"%s\": The destination is read-only"),
-                   dest_name);
+      dest_info = g_file_query_info (dest, G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE, 0,
+                                     exo_job_get_cancellable (EXO_JOB (transfer_job)),
+                                     NULL);
 
-      /* meh */
-      succeed = FALSE;
+      if (dest_info != NULL)
+        {
+          if (!g_file_info_get_attribute_boolean (dest_info, G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE))
+            {
+              g_set_error (error, G_IO_ERROR, G_IO_ERROR_READ_ONLY,
+                           _("Error while copying to \"%s\": The destination is read-only"),
+                           dest_name);
+
+              succeed = FALSE;
+            }
+
+          g_object_unref (G_OBJECT (dest_info));
+        }
     }
 
   g_object_unref (filesystem_info);

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list