Commit Graph

183 Commits

Author SHA1 Message Date
Lukas Fink
be884c2bf6 Refactored parsing of usb dev: command line option
Refactored urbdrc_udevman_register_devices with its helper functions,
because the old implementation was a bit quirky. Removed a unsafe
strcpy, that led to a buffer overflow when given misonstructed command
line options. Doing something like "/usb:id,dev🔢1234##abcd:abcd"
won't work anymore, too.
2020-04-21 08:05:06 +02:00
jacobopantoja
0f8437d1d8 Restrict USBDK to Windows builds
This commit restricts ebdaea6f3b to just Win32 builds
2020-04-11 09:04:29 +02:00
akallabeth
aa39e08c29 Fixed URBDRC DEVICE_ADD_FLAG definitions 2020-04-10 14:16:19 +02:00
akallabeth
42d40261c5 Fixed return type for subsystem entry 2020-04-10 14:11:15 +02:00
akallabeth
de7ea07a3d Fixed URBDRC parsing error reported in #6024. 2020-04-09 18:00:51 +02:00
Armin Novak
c58db76e4c Fixed return check for usbdk backend. 2020-03-09 16:40:07 +01:00
Armin Novak
95522923ba Move libusb hotplug registration to polling thread.
* libusb polling thread now is responsible for hotplug registration
  and removal as well as cleanup.
* Only register hotplug callback on systems with support.
2020-03-06 12:07:22 +01:00
Armin Novak
ebdaea6f3b enable usbdk on windows. 2020-03-06 12:07:22 +01:00
Armin Novak
e867ad3c9d Fixed compilation issues against libusb on windows 2020-03-06 12:07:22 +01:00
Armin Novak
34498d4064 URBDRC: Only mark closed if control is closed. 2020-03-03 11:15:34 +01:00
Armin Novak
30990089b8 Implemented del_device by vid/pid 2020-03-02 11:40:05 +01:00
Armin Novak
1b1ab01e43 Cleaned up USB redirection
* Removed obsolete searchman
* Unified device add and virtual channel add
* Unified device id generation
2020-03-02 11:40:05 +01:00
Armin Novak
acb77391a2 Fix #5910: USB hotplug added device wrong
When a USB device was added via hotplug add_device was called
with wrong arguments.
2020-03-02 11:40:05 +01:00
Armin Novak
53c15e3e90 Deactivate USB redirection for IOS and ANDROID by default. 2020-02-26 13:53:25 +01:00
Armin Novak
d633195879 Promoted usb, printer and smartcard dependencies to recommended 2020-02-25 17:36:17 +01:00
Martin Fleisz
e304428a5f
Merge pull request #5857 from akallabeth/scanbuild_fixes
Scanbuild fixes
2020-02-12 10:16:54 +01:00
Armin Novak
b004e01fc8 Exporting URBDRC symbols used by helper library
When building the usb channel with different shared libraries some
necessary symbols were not exported.
2020-02-11 12:42:45 +01:00
Armin Novak
8996fdc797 Fixed unused variable warning. 2020-01-23 10:12:12 +01:00
Armin Novak
f313fabb2b Added fallback for libusb < 1.0.19
we use stream_id functions which were introduced with 1.0.19
2020-01-13 15:23:57 +01:00
Armin Novak
b5bb6e3ea9 Fixed LIBUSB_HOTPLUG_NO_FLAGS definition
libusb documentation is a bit misleading, this flag was
introduced with 1.0.20
2020-01-13 15:13:35 +01:00
Armin Novak
d0929cbf2f Extend LIBUSB_API_VERSION check
The define exists since 1.0.13, so to compensate for older also
check if the variable is defined.
2020-01-10 10:52:23 +01:00
Armin Novak
b0de74cad2 Fallback definition for LIBUSB_HOTPLUG_NO_FLAGS
The flag was first introduced with libusb 1.0.16, so
define it if we are using an older version.

Signed-off-by: Armin Novak <armin.novak@thincast.com>
2020-01-08 17:14:09 +01:00
Armin Novak
d044915a7e Fixed stream handling and missing includes. 2019-12-17 15:51:24 +01:00
Armin Novak
c4a141cd8a Fixed some scanbuild warnings. 2019-11-22 11:47:16 +01:00
Armin Novak
0927d7aa50 Rewrite of urbdrc channel.
* Fix command line parsing
* Properly handle channel creation/destruction
* Use wStream API for parsing
2019-11-22 10:56:21 +01:00
Armin Novak
72ca88f49c Reformatted to new style 2019-11-07 10:53:54 +01:00
Armin Novak
0c87eaee4d COMMAND_LINE_ARGUMENT structs contain parser results, use one per instance
Remove the old global structs as the parser modifies them. When using
multiple instances in the same process space this could break parsing.
2019-10-28 13:30:05 +01:00
AzureusNation
4955a0e5b8 Fixes hub was not found! error
Again as with auto usb detection strtol needs to use base 10 and force to use base 10 else the conversion does not work correctly.
2019-10-23 09:56:23 +02:00
AzureusNation
7d6a10aaff Fixes Auto USB Redirection
Base 0 does not work when converting the string to long int. This ends up not showing the correct device id and sometimes the wrong bus id. By changing it to base 10 conversion instead of base 0 this fixes the issue of auto redirect usb devices.
2019-10-23 09:56:23 +02:00
Kyle Evans
d796920f8f (FreeBSD) Build fixes for urbdrc 2019-08-19 16:57:56 +02:00
Armin Novak
6c9130f7d6 Fixed sign-compare warnings. 2019-04-05 09:14:35 +02:00
Armin Novak
4430187e8d Fixed sign-compare warnings 2019-04-05 09:13:24 +02:00
Armin Novak
ef1728faf5 Fixed NULL dereferences and uninitialized values 2019-01-30 16:11:10 +01:00
Armin Novak
fad20be6e6 Fixed missing includes. 2018-08-27 14:34:42 +02:00
Armin Novak
62c1696d4c Removed use of unchecked sprintf 2018-08-27 14:34:42 +02:00
Armin Novak
114abad767 Removed use of strcpy. 2018-08-27 14:34:09 +02:00
Pascal J. Bourguignon
15f2bafeab Cleaned up const char** -> char** for argv, since we definitely do modify the argv!
(we overwrite the password and pin arguments).
This implies changes in the argument parsing tests that now must pass a mutable argv
(copied from the statically declared test argvs).
Some other const inconsistency have been dealt with too.
2018-06-06 16:43:09 +02:00
Armin Novak
4eb5b8e349 Replaced atoi 2017-11-15 15:52:16 +01:00
David Fort
ff8f7e9474 Disambiguate USB error messages and fix a typo 2017-11-06 22:09:01 +01:00
Armin Novak
8b9e3fa51e Fixed use of reserved keywords for include guards. 2017-07-20 09:35:41 +02:00
Armin Novak
0490aeb018 Fixed clang malloc integer overflow warnings. 2017-07-20 09:29:48 +02:00
David Fort
48163a27db Merge pull request #3906 from akallabeth/addin_cast_fix
Addin cast fix
2017-05-22 11:12:05 +02:00
Ilya Shipitsin
07c2345879 resolve an issue identified by cppcheck:
[channels/urbdrc/client/libusb/libusb_udevice.c:1666] -> [channels/urbdrc/client/libusb/libusb_udevice.c:1661]: (warning) Either the condition 'request' is redundant or there is possible null pointer dereference: request.
2017-05-06 00:05:59 +05:00
Armin Novak
b0289e3ed8 Fixed cast warnings. 2017-04-10 10:39:01 +02:00
Ilya Shipitsin
087671bcbb Remove redundant condition
[channels/urbdrc/client/data_transfer.c:2310] -> [channels/urbdrc/client/data_transfer.c:2322]: (warning) Either the condition 'if(transfer_data)' is redundant or there is possible null pointer dereference: transfer_data.
[channels/urbdrc/client/data_transfer.c:2311] -> [channels/urbdrc/client/data_transfer.c:2322]: (warning) Either the condition 'if(transfer_data)' is redundant or there is possible null pointer dereference: transfer_data.
[channels/urbdrc/client/data_transfer.c:2312] -> [channels/urbdrc/client/data_transfer.c:2322]: (warning) Either the condition 'if(transfer_data)' is redundant or there is possible null pointer dereference: transfer_data.
[channels/urbdrc/client/data_transfer.c:2313] -> [channels/urbdrc/client/data_transfer.c:2322]: (warning) Either the condition 'if(transfer_data)' is redundant or there is possible null pointer dereference: transfer_data.
[channels/urbdrc/client/data_transfer.c:2314] -> [channels/urbdrc/client/data_transfer.c:2322]: (warning) Either the condition 'if(transfer_data)' is redundant or there is possible null pointer dereference: transfer_data.
2017-02-02 00:29:37 +05:00
Ilya Shipitsin
efaf1819ea Resolve possible null pointer dereference
[channels/urbdrc/client/isoch_queue.c:124] -> [channels/urbdrc/client/isoch_queue.c:126]: (warning) Either the condition 'if(isoch)' is redundant or there is possible null pointer dereference: isoch.
2017-01-31 15:59:25 +05:00
Norbert Federa
f71b6b46e8 fix string format specifiers
- fixed invalid, missing or additional arguments
- removed all type casts from arguments
- added missing (void*) typecasts for %p arguments
- use inttypes defines where appropriate
2016-12-16 13:48:43 +01:00
Norbert Federa
c6e6b44143 countless WLog/printf format specifier fixes 2016-11-25 17:06:25 +01:00
Armin Novak
943e295714 WLog using C99 compatible variadic macros. 2016-10-07 14:05:27 +02:00
Armin Novak
b7f8dc3d43 Fixed UUID find. 2016-06-27 10:37:24 +02:00
Norbert Federa
90cdfa7646 cmake: replaced STATIC_CHANNELS with BUILTIN_CHANNELS 2016-06-15 13:36:27 +02:00
Bernhard Miklautz
bafe1aa17e usbdrc: remove unused dependencies 2016-03-29 18:14:34 +02:00
Armin Novak
fb88ad0ee6 Fixed symbol export for sound plugins. 2016-03-03 17:17:13 +01:00
Armin Novak
5acd80dd5b Exporting channel entry points. 2016-02-29 15:18:19 +01:00
Bernhard Miklautz
e6f013eac7 fix spelling
replace occured with occurred
Fixes #3142
2016-02-22 17:01:43 +01:00
Bernhard Miklautz
6fa3608111 cleanup cmake exports and pkg-config files
With this commit the "exported" components (usable with pkg-config and
cmake find module package)
* winpr - winpr library and headers
* freerdp - core library and headers
* freerdp-client - client specific library
* freerdp-server - server specific library
* rdtk - rdtk headers and library

To allow the installation of multiple different version (different major
number) the include files were moved into the respective sub folder:
freerdp -> freerdp{MAJOR}/freerdp (currently freerdp2/freerdp/)
winpr -> winpr{MAJOR}/winpr (currently winrp1/winpr/)
rdtk -> rdpk{MAJOR}/rdtk (currently rdtk0/rdtk/

The generated pkg-config and cmake find modules now also include the major
version number. Currently the following pkg-config are generated and
installed.
* winpr1
* freerdp2
* freerdp-server2
* freerdp-client2
* rdtk0

As cmake is able to handle multiple versions out of the box the
following can be used to find a specific module:

find_package(WinPR)
find_package(FreeRDP)
find_package(FreeRDP-Server)
find_package(FreeRDP-Client)
find_package(RdTk)

As cmake doesn't automatically resolve dependencies for packages it is
necessary to manually include the requirements. For example if
FreeRDP-Client is required WinPR and FreeRDP need to be included
(find_package) as well.

This commit also fixes the installation when STATIC_CHANNELS are built.
WITH STATIC_CHANNELS all channels are linked into libfreerdp-client, for
this all channels are generated as linker archive and linked together in
the final step. Before the intermediate linker archives were, although
not required and useful, installed. Same applies for server side
channels.
2016-01-12 17:32:33 +01:00
Bernhard Miklautz
97edeca204 Merge pull request #2874 from akallabeth/stdtypes
Using stdint.h and stdbool.h for type definitions
2015-12-17 16:37:54 +01:00
Armin Novak
cb958ba9c6 Added pdb files to package target.
Fixed name collision with freerdp-shadow targets.
2015-12-15 12:07:21 +01:00
Armin Novak
90251f5e0d Fixed OnNewChannelConnection arguments 2015-12-14 14:18:50 +01:00
Martin Haimberger
52405a3e79 Remove WIN32ERROR type
All return values are UINT now.
2015-08-27 05:38:20 -07:00
Martin Haimberger
65fd259610 misc fixes:
fixed all bugs from the review
checking all WaitFor*Object/s calls
2015-07-30 06:49:21 -07:00
Martin Haimberger
6ab0187d84 Merge remote-tracking branch 'upstream/master' into mh-channel
Conflicts:
	channels/audin/client/oss/audin_oss.c
	channels/drive/client/drive_main.c
	channels/printer/client/printer_cups.c
	channels/printer/client/printer_main.c
	channels/rail/client/rail_main.c
	channels/rdpgfx/client/rdpgfx_main.c
	channels/rdpsnd/client/oss/rdpsnd_oss.c
	channels/remdesk/client/remdesk_main.c
	channels/remdesk/server/remdesk_main.c
	channels/tsmf/client/tsmf_media.c
2015-07-15 01:57:07 -07:00
MartinHaimberger
b06d83ba80 Merge pull request #2766 from akallabeth/snprintf_to_sprintf_s
Replaced snprintf with sprintf_s
2015-07-15 09:47:43 +02:00
Bernhard Miklautz
68e8569110 winpr/synch: remove the dependency on winsock.h
winsock.h pulls in a lot of defines and dependencies that are not
required and partially unwanted in winpr's core (for parts that are not
related to network). In order to get rid of this dependency and have an
independent defines for extended winpr functions the WINPR_FD_* defines
are used internally (and for exposed functions). Where required, like in
WSAEventSelect, the FD_* is mapped to WINPR_FD_*.
2015-07-14 11:39:41 +02:00
David FORT
b83ab92776 Hardened urbdrc channel 2015-07-06 16:46:21 +02:00
Armin Novak
cf9f975341 Replaced snprintf with sprintf_s 2015-07-03 13:26:15 +02:00
Armin Novak
d18b0fbeb4 Handle API updated. 2015-07-03 09:52:52 +02:00
ivan-83
0fda0eb0de Code style changed. 2015-05-27 22:59:57 +03:00
ivan-83
83a40a32a7 * tsmf: OSS code cleanup
+ urbdrc: add devd support (not tested)
* fix FindUUID detection ubder BSD
* wlog: fix prev commit: build error on Windows
* cmdline: add /usb syntax help
2015-05-27 22:58:41 +03:00
Norbert Federa
1eff1a345e free can handle NULL perfectly fine 2015-05-11 09:07:39 +02:00
Norbert Federa
25fc866a58 Fix unchecked CreateThread calls and misc fixes 2015-05-05 13:55:48 +02:00
Maxim
9b8754ca72 Update urbdrc_main.c 2015-04-12 14:51:27 +03:00
Maxim
d4ad03bbf0 fixed buffer overflow at sprintf 2015-04-10 15:44:27 +03:00
Maxim
0b39a1f72a fixed undefined behaviour of sprintf, buffer overflow 2015-04-08 18:21:52 +03:00
David FORT
cf8c7631bd Kill more exit() occurences
In general we should not have any exit() call in libfreerdp.
2015-03-31 23:56:40 +02:00
Zhang Zhaolong
c2ddb08437 urbdrc: fix undefined behavior of sprintf.
Signed-off-by: Zhang Zhaolong <zhangzl2013@126.com>
2015-03-13 11:15:14 +08:00
TaGUNil
da39686a31 channels/urbdrc: fix segfault
Fix segmentation fault in urbdrc_main.c caused by missing memset.
2014-12-09 19:28:13 +03:00
Armin Novak
059374457d Removed library prefix override. 2014-09-17 11:27:11 +02:00
Armin Novak
bf515cd4b6 Fixed log level of error message. 2014-09-16 10:16:05 +02:00
Armin Novak
6ad4afd190 Decreased logging verbosity. 2014-09-15 19:47:11 +02:00
Armin Novak
046cb4dc7c Changed logging verbosity. 2014-09-15 19:40:54 +02:00
Armin Novak
6011586a80 Increased logging verbosity for error. 2014-09-15 19:39:08 +02:00
Armin Novak
b1e9ffb655 Using wlog for channel logging now.
Fixed compiler warnings and broken callback in urbdrc.
2014-09-15 08:48:46 +02:00
Bernhard Miklautz
0313ca3622 libfreerdp: always build "MONOLITHIC"
"libfreerdp" consisted of multiple (small) single libraries. If the cmake
option MONOLITHIC was used only one library was build combining all of
the libfreerdp-* libraries.
The only exceptions to this are libfreerdp-server and libfreerdp-client these
are build as separate libraries.

This commit obsoltes non-monolithic builds and makes monolithic builds
the default. The cmake option MONOLITHIC is also removed.
2014-09-12 00:19:53 +02:00
Armin Novak
66b8905ac6 Using special log defines for channels now. 2014-08-11 09:12:01 +02:00
Armin Novak
158e1323de Fixed compiler warnings. 2014-08-07 19:05:48 +02:00
Armin Novak
219a760bad Fixed logging, now using log functions. 2014-08-07 17:31:42 +02:00
Armin Novak
b252009d36 Replaced custom logging mechanism with WLog wrapper. 2014-08-07 16:51:49 +02:00
Bernhard Miklautz
6a49bcfe40 winpr: always build "monolitic"
winpr is now always build as single library.
The build option MONOLITHIC_BUILD doesn't influence this behavior anymore.

The only exception is winpr-makecert-tool which is still build as extra
library.

This obsoletes complex_libraries for winpr.
2014-07-10 11:10:58 +02:00
Marc-André Moreau
f37c23b1a7 channels/urbdrc: fix cmake scripts 2014-04-26 13:44:58 -04:00
Marc-André Moreau
37450da55d cmake: fix exporting of targets on pre-2.8.11 2013-10-29 14:47:40 -04:00
Marc-André Moreau
55565e056c freerdp: export targets 2013-10-28 23:06:39 -04:00
Armin Novak
e5c138a5b9 Fixed various memory leaks, allocation size issues and API misuse
warnings shown by clang as well as some compiler warnings.
2013-09-05 12:14:34 +02:00
Armin Novak
a3b531c036 Fixed issues found with clang-analyzer 2013-09-05 12:14:33 +02:00
Armin Novak
71ec4e5a32 Added libusb detection CMake script. 2013-08-02 15:49:53 +02:00
Armin Novak
e1ca852e00 Fixed linking with libusb, now linking against correct library. 2013-08-02 15:49:53 +02:00
Armin Novak
bb1e6ce5e0 Now using libraries detected by CMake for linking against libusb. 2013-08-02 15:49:53 +02:00
Armin Novak
3e56dd108a Added proper CMake checks for libraries linked with urbdrc 2013-08-02 15:49:53 +02:00
Hardening
7701c9d934 Replace printf(...) by fprintf(stderr, ...) 2013-03-28 23:06:34 +01:00
Marc-André Moreau
8c8a82c31f libfreerdp-utils: purge old STREAM utils 2013-03-21 16:45:25 -04:00