[gvfs] sftp: Catch invalid argument type for chmod command



commit 89b3936f67c3b7ce89f9f90023c96b198fd3550f
Author: Benjamin Otte <otte redhat com>
Date:   Mon Jan 24 03:01:20 2011 +0100

    sftp: Catch invalid argument type for chmod command

 daemon/gvfsbackendsftp.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/daemon/gvfsbackendsftp.c b/daemon/gvfsbackendsftp.c
index f6b7785..ff44828 100644
--- a/daemon/gvfsbackendsftp.c
+++ b/daemon/gvfsbackendsftp.c
@@ -4638,6 +4638,15 @@ try_set_attribute (GVfsBackend *backend,
       return TRUE;
     }
 
+  if (type != G_FILE_ATTRIBUTE_TYPE_UINT32) 
+    {
+      g_vfs_job_failed (G_VFS_JOB (job),
+                        G_IO_ERROR,
+                        G_IO_ERROR_INVALID_ARGUMENT,
+                        "%s",
+                        _("Invalid attribute type (uint32 expected)"));
+    }
+
   command = new_command_stream (op_backend,
                                 SSH_FXP_SETSTAT);
   put_string (command, filename);



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