Commit Graph

12 Commits

Author SHA1 Message Date
Uri Lublin
eb276f4b45 Fix compiler warning (missing backslash in FileXfer::handle_start)
Visual Studio complains:
vdagent\file_xfer.cpp(85) : warning C4129: '%' : unrecognized character escape sequence

Replace "%s\%s" with "%s\\%s"
2014-12-30 17:16:53 +02:00
Cody Chan
6c070843cb Fix g_key_get_string() failure when string contains '['
In vd_agent/file_xfer.cpp is implemented a simple g_key_get_string,
but  when dragging a file with a name containing '[' (like te[st.txt),
it will fail.
From source code,
>next_group_pos = strstr(group_pos + strlen(group_pfx), "[");
>    if (next_group_pos && key_pos > next_group_pos) return false;
we know that it tries to find the end of current group by '[' label,
if we drag a file named te[st.txt, the key_string will be like:
[vdagent-file-xfer]
name=te[st.txt
size=10
so, it will fail when meta parsing and returns the
VD_AGENT_FILE_XFER_STATUS_ERROR message.

Here's the elegant method Christophe proposed and test ok, thanks to
him again!
2014-11-13 16:52:19 +01:00
Cody Chan
21b79679c1 Fix dragging of files with CJK characters in name
I submitted a patch several months ago about this issue,
here http://lists.freedesktop.org/archives/spice-devel/2014-February/016158.html
I check it again, and find that the value of
g_key_file_to_data(keyfile,...) is always utf-8, for the value of
g_uri_list_extract_uris() is utf8 urlencode.

So the display problem is caused by vd_agent, but how it displays
depends on the language of system, the following two screenshots show
the difference:

http://int64ago-tmp.qiniudn.com/guest-Chinese.png
http://int64ago-tmp.qiniudn.com/guest-English.png
2014-11-13 16:52:18 +01:00
Uri Lublin
4335b0d43a vdagent: file_xfer: make g_key_get_string safer
By providing the size of the destination string buffer.
2013-11-13 10:39:57 +02:00
Uri Lublin
066f614cee vdagent: file-xfer: make user desktop the target directory
Before, the target directory was a public one (for all users),
as file creation was not done with user privileges.

Now that the file is created with user privileges, it's
better to make the user desktop the target directory.
2013-11-13 10:39:47 +02:00
Uri Lublin
71193f6581 file_xfer: create file with user privileges 2013-11-13 10:39:37 +02:00
Marc-André Lureau
4b9e9b1d28 Remove usage of more _s functions
Even before this change, it should have handled error conditions. We'd
be better off allocating those strings and failing on io op later on.
2013-07-17 21:20:47 +02:00
Marc-André Lureau
492ee05a6b Replace sscanf_s by sscanf
The _s functions need a recent msvcrt version, not shipped in XP by
default.

Furthermore, it appears that their sscanf_s usage was missing the extra
buffer size argument.
2013-07-17 20:45:22 +02:00
Marc-André Lureau
b9d6baec2d Fix task could be used uninitialized 2013-07-17 20:45:21 +02:00
Marc-André Lureau
462295d9f8 Fix invalid print format for uint64_t values
format '%lu' expects argument of type 'long unsigned int', but argument
9 has type 'uint64_t
2013-07-17 20:45:21 +02:00
Marc-André Lureau
3bf46bc2b2 dos2unix 2013-07-17 20:45:21 +02:00
Arnon Gilboa
c751e8fda0 vdagent: add support for client -> guest file transfers
rhbz#956146
2013-06-27 14:23:49 +03:00