Age | Commit message (Collapse) | Author | Files | Lines |
|
We currently have macros silently replacing use of strncpy/strcat with
strcpy_s/strcat_s when using MSVC++. However, these macros can have
unexpected effects as they use sizeof to find out the maximum size of
the destination string. This is a very significant behaviour from
strncpy/strcat, which can lead to subtle bugs as the behaviour is
different between mingw and MSVC++.
Now that we have our implementation of strcpy_s/strcat_s, we don't need
these #defines.
|
|
|
|
These security functions are available when building with MSVC++. With
mingw, they can be used at build time, but their availability will
depend on the version of MSVCRT the user has installed on their system.
In particular, a default install of Windows XP will not have a new
enough MSVCRT version, causing runtime failures as the binary built with
mingw and using strcat_s will not be able to find the necessary entry
point in the MSVCRT runtime.
This commit adds some strcat_s/strcpy_s-like functions used with mingw
which will always be available.
|
|
This is a follow-up to commits 492ee05a6b and 4b9e9b1d28
Visual Studio complains:
.\file_xfer.cpp(90) : warning C4996: 'strcat': This function or variable
may be unsafe. Consider using strcat_s instead.
To disable deprecation, use _CRT_SECURE_NO_WARNINGS.
See online help for details.
And a similar complain for sscanf.
Replace them with the secure function when compiling with Visual Studio.
Note that the size provided is sizeof(d), which means all calls to
sscanf and strcat must be done with the first param (destination) being
an array and not a pointer.
|
|
Visual Studio complains:
vdagent\file_xfer.h(28) : warning C4996: 'strncpy': This function or variable may
Consider using strncpy_s instead.
To disable deprecation, use _CRT_SECURE_NO_WARNINGS.
See online help for details.
Replace strncpy with strcpy_s when building with Visual Studio.
Adjust parameter order and difference in meaning of length:
- length param is last in strncpy and second in strcpy_s
- many calls to strncpy are given length param n-1, as
strncpy does not guarantee that destination ends with '\0'
- it's safer to set length param not larger than sizeof(d)
(assuming d is an array not a pointer)
Trying to use strcpy_s for both Visual Studio and mingw
failed as strcpy_s is missing from the default msvcrt.dll
on WinXP (See OLDMSVCRT in common/vdcommon.h).
|
|
This commit is an addition to 4b9e9b1d28ea7eaec44ff73e2f91c4064986b12a
Building with Visual Studio breaks as snprintf is not implemented:
vdagent\file_xfer.cpp(198) : error C3861: 'snprintf': identifier not found
Replace it with sprintf_s for Visual Studio.
Trying to use sprintf_s for both Visual Studio and mingw
failed for mingw64 (build succeeds but runtime error appears).
|
|
|
|
Fixes the following error:
====
In file included from vdagent/vdagent.cpp:18:0:
./common/vdcommon.h:51:0: warning: "_ftime_s" redefined
#define _ftime_s(timeb) _ftime(timeb)
^
In file included from /usr/x86_64-w64-mingw32/sys-root/mingw/include/sys/timeb.h:124:0,
=====
|
|
|
|
focus"
This reverts commit dd9d1f41cace5e73bfd847ff8d0cfa303e141b1c.
|
|
Running the helper with ShellExecute(..."runas"...) is the way to SendInput()
to the UAC dialog in Windows Vista and above.
http://stackoverflow.com/questions/2426594/starting-a-uac-elevated-process-
from-a-non-interactive-service-win32-net-power
http://www.microsoft-questions.com/microsoft/Platform-SDK-Security/29620442/
how-to-proper-use-sendinput-to-a-elevated-window-from-a-service.aspx
rhbz #908422
|
|
rhbz #919451 preparation
|
|
Terminate agent politely instead of ugly TerminateProcess(), so now
VD_AGENT_CLIPBOARD_RELEASE is sent (if guest owned the clipboard),
followed by cleanup.
rhbz #903379
|
|
Aliasing _ftime_s to _ftime when OLDMSVCRT is defined makes it
possible to remove the timestamp-less implementation of LOG()
while still getting a binary working on Windows XP. I've tested
this with a MinGW build, hopefully this won't break VC++ builds...
|
|
vdlog.cpp has an #ifdef check for OLDMSVC to choose between using
swprintf or swprintf_s. Since vdcommon.h provides a compat #define
for swprintf_s when OLDMSVC is set, it's better to use this one.
|
|
|
|
Apparently, it comes with a recent version of C library (msvcrt90?),
but I don't know if we can/should ship also a MS dll. Probably it used
to work with an inlined version with VS headers.
The build can be tweaked to use the -non-_s variant with -DOLDMSVCRT
CFLAGS.
|
|
mingw has a _ftime_s prototype in its headers, but no corresponding
symbol available at link time. Workaround this issue for now by
#defining it to _ftime. This is untested on win64 where the workaround
may not be needed.
|
|
It automatically chooses between using the gcc construct or the
visual-c++ construct at compile-time.
|
|
|
|
mingw already has SIZE_MAX defined so don't try to redefine it to
avoid a warning.
|
|
Most of them are caused by not using %lu to print a DWORD (which
is an unsigned long).
|
|
-use RHEV log format
-add log levels & macros
-remove LOG_ENABLED ifdefs
|
|
This patch is a little dirty due to EOL convertion to windows format.
+ add pci_vdi_port with PCIVDIPort taken from last commit before
changing to virtio-serial (a17ccbf323768c3cb977f0f062366ba7cf7f19db)
+ move handle_error to VDIPort (identical in VIRTIOVDIPort and PCIVDIPort)
+ make VDService create first a virtio, then init, the pci, then init,
stopping when the first init succeeds, and reporting to log which was
created.
|
|
This reverts commit 53b32d4db33af4422382fbe629bb0314e252bdda which becomes irrelevant due to previous revert.
|
|
This reverts commit 349e6a5bf8804b25c3af6e1f439122a7cc269cc2 which breaks vsdervice on Windows 7
|
|
|
|
|
|
smoothing)
The configuration is received from Spice client.
The main usage of this option is for disabling display features in order to accelerate Spice performance over limited network connections.
|
|
-add VDAgent::dispatch_message()
-in VDAgent::read_completion() handle multi-chunk msgs
-fix chunk size bug in VDService::handle_pipe_data()
-add size to VDPipeMessage
|
|
* mutex.h inlined into common/vdcommon.h
* vdagent.h renamed to spice/vd_agent.h
|
|
|
|
|
|
|