Commit Graph

14 Commits

Author SHA1 Message Date
Christophe Fergeau
3d452a312b Don't limit spice controller socket name to 50 chars
The spice controller socket name used to be hardcoded to
/tmp/SpiceController-%lu.uds and generated using snprintf. A 50 bytes
buffer was enough for that, but this was changed in commit 79fffbf95
because this was predictable and allowed other users on the system
to sniff the browser/client communication. spicec now uses the value
of the environment SPICE_XPI_SOCKET as the name of the socket to use.
However, since the name that is used is no longer generated by spicec,
no assumption can be made about its size. Currently, the socket is
created inside the user home directory, which means that if the
user name is too long, spicec will not be able to read the controller
socket name.
This commit directly uses the string from getenv as he name of the
controller socket (on Linux) instead of limiting its size to 50 characters,
which should fix this issue.
This fixes rhbz #804561
2012-03-20 16:53:40 +01:00
Marc-André Lureau
1ab589f39e Use SPICE_FOREIGN_MENU_SOCKET if it's available
If specified, use SPICE_FOREIGN_MENU_SOCKET environment variable over
snprintf(pipe_name, PIPE_NAME_MAX_LEN, PIPE_NAME,
Platform::get_process_id()); since it's impossible to guess the client
pid when spice-xpi launches the client as a grand-child (via script
etc).

This is also more aligned with the way we handle SPICE_XPI_SOCKET
location.
2012-03-05 22:52:27 +01:00
Christophe Fergeau
a50619e733 Fix compilation when smartcard support is disabled
The addition of smartcard control to the controller doesn't handle
the case when smartcard support is disabled at compile time. When
this is the case, this causes compile errors.
2012-02-29 18:20:01 +01:00
Alon Levy
26516fc5a2 client: handle CONTROLLER_ENABLE_SMARTCARD (rhbz 641828) 2012-02-28 14:40:42 +02:00
Uri Lublin
5d28d1662e client controller/foreign_menu: use memmove instead of memcpy in readers
When src/dst memory areas may overlap, it's safer to use memmove.
2011-12-20 18:27:32 +02:00
Christophe Fergeau
78c1465ed3 add #include <config.h> to all source files
When using config.h, it must be the very first include in all source
files since it contains #define that may change the compilation process
(eg libc structure layout changes when it's used to enable large file
support on 32 bit x86 archs). This commit adds it at the beginning
of all .c and .cpp files
2011-05-03 14:44:10 +02:00
Christophe Fergeau
56a4a05ae7 client: s/AVAILIBLE/AVAILABLE in CmdLineParser
It was mispelt in a CmdLineParser enum.
2011-04-18 12:38:39 +02:00
Uri Lublin
e9ee6cf914 client: exit nicely for --controller with no SPICE_XPI_SOCKET (rhbz#644292)
When starting spicec with --controller, SPICE_XPI_SOCKET environment
variable must be defined so spicec and the controller can be connected.
2011-03-01 17:58:47 +02:00
Alon Levy
9728ea7f5c mingw32 build: remove unused, initialize uninitialized, reorder constructor initializers 2010-12-08 17:11:45 +02:00
Arnon Gilboa
429fae02ba spicec-win: remove redundent strdup & buggy free
text refered a substr of item_dup and was used after free(item_dup).
no need to strdup, we can destroy the resource string.
2010-10-25 13:22:24 +02:00
Hans de Goede
a1cef5b81a controller: Make menu text utf-8
We are making all text send over the controller socket utf-8, rather then
having somethings as 8 bit (hostname) and others (title, menu) unicode16,
this patch completes this change by converting the menu handling.
2010-10-25 11:36:35 +02:00
Hans de Goede
fa2e125ec4 client: Interpret the title control message as utf8 instead of unicode16
The activex browser plugin is sending unicode16 text, where as the
xpi one is sending utf8 text. After discussing this on irc we've decided
that utf8 is what we want to use. So the client (this patch), and the
activex will be changed to expect resp. send utf8 text as the title.
2010-10-21 13:19:51 +02:00
Hans de Goede
79fffbf95d spicec-x11: Change source of controller socket name, fixing CVE-2010-2792
The socket name used to communicate between the xpi browser plugin and the
spicec was predictable allowing a non priviliged user on the same system
to create the socket before spicec does and thus intercept the messages from
the xpi to the client, including login credentials. This security vulnerability
has been registred with mitre as CVE-2010-2792:
http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2010-2792

This patch changes the controller code to instead read the socket name
from an environment variable which gets set by the xpi before executing
the spicec, making the socketname private between the client and the xpi.

Note that this means that the controller will only work with an xpi which
has matching changes, the changes are present in the latest version of the
xpi as available as update for / with RHEL-5.5 and RHEL-6.0 .
2010-10-21 13:06:14 +02:00
Arnon Gilboa
4d0e6e525c spicec: add controller
Spice client controller enables external control (e.g., by XPI or ActiveX) of
the client functionality.

The controller protocol enables setting parameters (host, port, sport, pwd,
secure channels, disabled channels, title, menus, hotkeys etc.), connecting
the server, showing and hiding the client etc.

The controller is based on the cross-platform named pipe.
2010-10-18 10:17:28 +02:00