summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2011-01-24 03:01:25 +0100
committerBenjamin Otte <otte@redhat.com>2011-01-24 03:01:25 +0100
commitb6c397c60b3c66cb792975071a1edd9193848edb (patch)
tree94fe09315937bf55bd40a5204884ce4f1c3ddc9d
parent89b3936f67c3b7ce89f9f90023c96b198fd3550f (diff)
downloadgvfs-b6c397c60b3c66cb792975071a1edd9193848edb.tar.gz
smb: Catch invalid argument type when setting mtime
-rw-r--r--daemon/gvfsbackendsmb.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/daemon/gvfsbackendsmb.c b/daemon/gvfsbackendsmb.c
index 91c290e2..a2bc097d 100644
--- a/daemon/gvfsbackendsmb.c
+++ b/daemon/gvfsbackendsmb.c
@@ -1715,6 +1715,15 @@ do_set_attribute (GVfsBackend *backend,
if (strcmp (attribute, G_FILE_ATTRIBUTE_TIME_MODIFIED) == 0)
{
+ if (type != G_FILE_ATTRIBUTE_TYPE_UINT64)
+ {
+ g_vfs_job_failed (G_VFS_JOB (job),
+ G_IO_ERROR,
+ G_IO_ERROR_INVALID_ARGUMENT,
+ "%s",
+ _("Invalid attribute type (uint64 expected)"));
+ }
+
smbc_utimes = smbc_getFunctionUtimes (op_backend->smb_context);
tbuf[1].tv_sec = (*(guint64 *)value_p); /* mtime */
tbuf[1].tv_usec = 0;